more management

This commit is contained in:
swrup 2025-10-18 18:19:09 +02:00
parent 85ddb8194f
commit 2a4ff1a35b
6 changed files with 68 additions and 14 deletions

View file

@ -9,6 +9,11 @@
(modules gen_taler_signatures)
(libraries fmt angstrom))
(executable
(name gen_eddsa_key)
(modules gen_eddsa_key)
(libraries fmt mirage-crypto-rng.unix mirage-crypto-ec b32))
(executable
(name parse_config)
(modules parse_config)

16
include/gen_eddsa_key.ml Normal file
View file

@ -0,0 +1,16 @@
let () =
Mirage_crypto_rng_unix.use_default ();
let open Mirage_crypto_ec.Ed25519 in
let _priv, pub = generate () in
let octets = pub_to_octets pub in
let pub_b32 = B32.encode octets in
let octets' = B32.decode pub_b32 |> Result.get_ok in
assert (octets = octets');
(*
Fmt.pr "public key :@.%S@." octets;
Fmt.pr "len: %d@." (String.length octets);
Fmt.pr "len: %d@." (String.length pub_b32);
*)
Fmt.pr "%s@." pub_b32;
()