use Jsont.Error for unsupported CS denom + wip type binary signature
This commit is contained in:
parent
4568b1bd4c
commit
eb56150120
6 changed files with 66 additions and 45 deletions
|
|
@ -52,6 +52,7 @@ module EddsaSignature : sig
|
|||
type t
|
||||
|
||||
val sign : key:Mirage_crypto_ec.Ed25519.priv -> string -> t
|
||||
val sign_as_string : key:Mirage_crypto_ec.Ed25519.priv -> string -> string
|
||||
val of_b32 : string -> (t, string) result
|
||||
val to_b32 : t -> string
|
||||
val to_octets : t -> string
|
||||
|
|
@ -81,6 +82,8 @@ end = struct
|
|||
(* mirage_crypto: "The result is the concatenation of r and s, as specified in RFC 8032." *)
|
||||
Mirage_crypto_ec.Ed25519.sign ~key s
|
||||
|
||||
let sign_as_string ~key s = sign ~key s
|
||||
|
||||
let check_size t =
|
||||
match String.length t = 64 with
|
||||
| false -> Error "EddsaSignature: invalid string length"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue