more /management
This commit is contained in:
parent
85ddb8194f
commit
a5f726ce9d
6 changed files with 68 additions and 14 deletions
|
|
@ -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
16
include/gen_eddsa_key.ml
Normal 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;
|
||||
|
||||
()
|
||||
Loading…
Add table
Add a link
Reference in a new issue