add kdf
This commit is contained in:
parent
6670b763f3
commit
a7ceb3be18
6 changed files with 34 additions and 0 deletions
|
|
@ -73,3 +73,24 @@ let () =
|
|||
in
|
||||
|
||||
()
|
||||
|
||||
let () =
|
||||
(* kdf *)
|
||||
let salt = "94KPT83PCNS7J83KC5P78Y8" in
|
||||
let ikm = "94KPT83MD1JJ0WV5CDS6AX10D5Q70XBM41NPAY90DNGQ8SBJD5GPR" in
|
||||
let ctx =
|
||||
"94KPT83141HPYVKMCNW78833D1TPWTSC41GPRWVF41NPWVVQDRG62WS04XMPWSKF4WG6JVH0EHM6A82J8S1G"
|
||||
in
|
||||
let out_len = 64 in
|
||||
let out =
|
||||
"GTMR4QT05Z9WF5HKVG0WK9RPXGHSMHJNW377G9GJXCA8B0FEKPF4D27RJMSJZYWSQNTBJ5EYVV7ZW18B48Z0JVJJ80RHB706Y96Q358"
|
||||
in
|
||||
|
||||
let salt = salt |> decode in
|
||||
let ikm = ikm |> decode in
|
||||
let info = ctx |> decode in
|
||||
let km = Crypto.Kdf.kdf ~salt ~ikm ~info ~len:out_len in
|
||||
let km = km |> encode in
|
||||
assert (km = out);
|
||||
|
||||
()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue