working database~~

This commit is contained in:
swrup 2025-11-22 21:40:24 +01:00
parent 0c5622324c
commit 056c111d88
5 changed files with 99 additions and 92 deletions

View file

@ -11,10 +11,7 @@ module EddsaPublicKey = struct
let to_octets t = pub_to_octets t
let of_octets t = pub_of_octets t |> Result.get_ok
let bin =
let open Bin in
map (bytes 32) of_octets to_octets
let bin = Bin.map (Bin.bytes 32) of_octets to_octets
let of_b32 s =
let open Syntax in
@ -37,10 +34,7 @@ module EddsaPrivateKey = struct
let to_octets t = priv_to_octets t
let of_octets t = priv_of_octets t |> Result.get_ok
let bin =
let open Bin in
map (bytes 32) of_octets to_octets
let bin = Bin.map (Bin.bytes 32) of_octets to_octets
let of_b32 s =
let open Syntax in
@ -80,9 +74,7 @@ end = struct
Fmt.failwith "EddsaSignature.of_octets failure: data is not 64 bytes."
| true -> v
let bin =
let open Bin in
map (bytes 64) of_octets to_octets
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." *)