+ type for signature

This commit is contained in:
swrup 2025-12-03 16:19:11 +01:00
parent eb56150120
commit 577b2117a4
5 changed files with 217 additions and 201 deletions

View file

@ -51,8 +51,8 @@ end
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 sign : key:EddsaPrivateKey.t -> string -> t
val verify : key:EddsaPublicKey.t -> t -> msg:string -> bool
val of_b32 : string -> (t, string) result
val to_b32 : t -> string
val to_octets : t -> string
@ -78,11 +78,9 @@ end = struct
let bin = Bin.map (Bin.bytes 64) of_octets to_octets
let sign ~key s =
(* 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
(* mirage_crypto: "The result is the concatenation of r and s, as specified in RFC 8032." *)
let sign ~key s = Mirage_crypto_ec.Ed25519.sign ~key s
let verify ~key s ~msg = Mirage_crypto_ec.Ed25519.verify ~key s ~msg
let check_size t =
match String.length t = 64 with