This commit is contained in:
swrup 2026-02-16 17:55:21 +01:00
parent 6bf2771f1c
commit e8b1277b7c
4 changed files with 12 additions and 91 deletions

View file

@ -1,21 +1,9 @@
(* test vectors taken from GNUnet:
https://git.gnunet.org/gnunet/gnunet/file/src/cli/util/crypto-test-vectors.json.html *)
let encode = B32.encode
let decode s = B32.decode s |> Result.get_ok
let round_trip s =
let s' = s |> encode |> decode in
match s' = s with
| false -> Fmt.failwith "b32 round trip failure: @\nin :`%S`@\nout:`%S`" s' s
| true -> ()
let () =
let s = String.init 0xff Char.chr in
round_trip s;
let s_l = List.init 0x0f (fun i -> String.init i Char.chr) in
List.iter round_trip s_l; ()
(* test vectors from:
https://git.gnunet.org/gnunet/gnunet/file/src/cli/util/crypto-test-vectors.json.html *)
let () =
(* hash *)
let input = "91JPRV3F5GG4EKJNDSJQ8" in
@ -96,7 +84,7 @@ let () =
()
let () =
(* rsa blinding *)
(* rsa_blind_signing *)
(* rsa_private_key data is given in gcrypt sexpr format.. *)
let message_hash =
"XKQMJ4CNTXBFE1V2WR6JS063J7PZQE4XMB5JH3RS5X0THQ1JQSQ69Y7KDBC9TYRJEZH48MEPY2SF4QHQ4VHXC0YQX5935MQEGP0AX6R"