fdh_rsa.ml
This commit is contained in:
parent
61150598d2
commit
e0a9d7f1e2
4 changed files with 107 additions and 117 deletions
|
|
@ -77,7 +77,7 @@ let () =
|
|||
let xts = salt |> decode in
|
||||
let ikm = ikm |> decode in
|
||||
let ctx = ctx |> decode in
|
||||
let okm = Crypto.FDH_RSA.Kdf.kdf ~xts ~ikm ~ctx ~len:out_len in
|
||||
let okm = Fdh_rsa.Kdf.kdf ~xts ~ikm ~ctx ~len:out_len in
|
||||
let okm = okm |> encode in
|
||||
assert (okm = out);
|
||||
|
||||
|
|
@ -99,12 +99,12 @@ let () =
|
|||
"3KHKZJZ30ABB4E56MA2V0EQWGCWH0QQG9P2ZHYHR186C5HZXJMM4N9WXAQTKS94QSV9Y17GGNXN5MB1PZZFG7Q0FY88QPKKRG4MYCPSMTZK5W59R0MJVNJ4P4AQM96TDG5W7RV8GSNR1QQZ1GNHW3CX6D6ZRTMXB2NKB5SSYTDJS79F5ZFBRZ4HVED9JBBPWSR79KVV5QQ4APBGHBCKGMF9NJJS53A1BVYHDEVYAGFYF2SNEP827ZP50FKJ5GKGV8NQ15ESEZ69AT7GJG0T3TZVENY2YN9CVR98W3BKEZ53J7VTANARG8SJS8AMJQ7S23P5HRJ7XE9KTNRNXKH49MXV9JHHYE5535N7AGWEKR47SBCGNF44Z7XJ9RV5BQV12ZRJKN4HBZQHDNCMH3QKX9Z6G64"
|
||||
in
|
||||
let open Crypto in
|
||||
let msg = message_hash |> decode in
|
||||
let pub =
|
||||
rsa_public_key |> decode |> RsaPublicKey.of_octets |> Result.get_ok
|
||||
in
|
||||
let bks = blinding_key_secret |> decode in
|
||||
let s = FDH_RSA.rsa_blind pub ~bks ~msg |> encode in
|
||||
assert (s = blinded_message);
|
||||
let msg = decode message_hash in
|
||||
let bmsg = Fdh_rsa.rsa_blind pub ~bks msg in
|
||||
assert (encode bmsg = blinded_message);
|
||||
|
||||
()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue