10 lines
241 B
OCaml
10 lines
241 B
OCaml
|
|
module Kdf = struct
|
||
|
|
module XTR = Hkdf.Make (Digestif.SHA512)
|
||
|
|
module PRF = Hkdf.Make (Digestif.SHA256)
|
||
|
|
|
||
|
|
let kdf ~xts ~ikm ~ctx ~len =
|
||
|
|
let prk = XTR.extract ~salt:xts ikm in
|
||
|
|
let okm = PRF.expand ~prk ~info:ctx len in
|
||
|
|
okm
|
||
|
|
end
|