rename crockford
This commit is contained in:
parent
34b979a9bc
commit
10df5181a0
14 changed files with 80 additions and 70 deletions
14
test/test.ml
14
test/test.ml
|
|
@ -1,6 +1,6 @@
|
|||
let get_ok = Result.get_ok
|
||||
let encode = B32.encode
|
||||
let decode s = B32.decode s |> get_ok
|
||||
let encode = Crockford.encode
|
||||
let decode s = Crockford.decode s |> get_ok
|
||||
|
||||
let test_b32 () =
|
||||
let round_trip s =
|
||||
|
|
@ -84,7 +84,7 @@ module Test_crypto = struct
|
|||
|> Eddsa.priv_of_octets
|
||||
|> get_ok
|
||||
|> Eddsa.pub_of_priv
|
||||
|> Eddsa.pub_to_b32
|
||||
|> Eddsa.pub_to_crockford
|
||||
in
|
||||
assert (pub = pub')
|
||||
|
||||
|
|
@ -139,8 +139,8 @@ module Test_crypto = struct
|
|||
let blinded_message =
|
||||
"3KHKZJZ30ABB4E56MA2V0EQWGCWH0QQG9P2ZHYHR186C5HZXJMM4N9WXAQTKS94QSV9Y17GGNXN5MB1PZZFG7Q0FY88QPKKRG4MYCPSMTZK5W59R0MJVNJ4P4AQM96TDG5W7RV8GSNR1QQZ1GNHW3CX6D6ZRTMXB2NKB5SSYTDJS79F5ZFBRZ4HVED9JBBPWSR79KVV5QQ4APBGHBCKGMF9NJJS53A1BVYHDEVYAGFYF2SNEP827ZP50FKJ5GKGV8NQ15ESEZ69AT7GJG0T3TZVENY2YN9CVR98W3BKEZ53J7VTANARG8SJS8AMJQ7S23P5HRJ7XE9KTNRNXKH49MXV9JHHYE5535N7AGWEKR47SBCGNF44Z7XJ9RV5BQV12ZRJKN4HBZQHDNCMH3QKX9Z6G64"
|
||||
in
|
||||
let pub = rsa_public_key |> Rsa.pub_of_b32 |> get_ok in
|
||||
assert (Rsa.pub_to_b32 pub = rsa_public_key);
|
||||
let pub = rsa_public_key |> Rsa.pub_of_crockford |> get_ok in
|
||||
assert (Rsa.pub_to_crockford pub = rsa_public_key);
|
||||
let bks = blinding_key_secret |> decode in
|
||||
let msg = decode message_hash in
|
||||
let bmsg = Rsa.blind_msg pub ~bks msg |> encode in
|
||||
|
|
@ -169,10 +169,10 @@ module Test_crypto = struct
|
|||
in
|
||||
let h_pub' =
|
||||
rsa_pub
|
||||
|> Rsa.pub_of_b32
|
||||
|> Rsa.pub_of_crockford
|
||||
|> get_ok
|
||||
|> DenominationHash.hash
|
||||
|> DenominationHash.to_b32
|
||||
|> DenominationHash.to_crockford
|
||||
in
|
||||
assert (h_pub' = h_pub)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue