… | |
… | |
39 | // see RFC5869 |
39 | // see RFC5869 |
40 | struct hkdf |
40 | struct hkdf |
41 | { |
41 | { |
42 | hmac ctx; |
42 | hmac ctx; |
43 | u8 prk[EVP_MAX_MD_SIZE]; |
43 | u8 prk[EVP_MAX_MD_SIZE]; |
|
|
44 | const void *salt; |
|
|
45 | int salt_len; |
44 | |
46 | |
45 | hkdf (const void *salt = 0, int len = 0, const EVP_MD *xtr_hash = EVP_sha512 ()) |
47 | hkdf (const void *salt = 0, int len = 0, const EVP_MD *xtr_hash = EVP_sha512 ()); |
46 | { |
|
|
47 | ctx.init (salt, len, xtr_hash); |
|
|
48 | } |
|
|
49 | |
48 | |
50 | void extract (const void *ikm, int len); |
49 | void extract (const void *ikm, int len); |
51 | void extract_done (const EVP_MD *prf_hash = 0); |
50 | void extract_done (const EVP_MD *prf_hash = 0); |
52 | |
51 | |
53 | void expand (void *okm, int len, const void *info = 0, int infolen = 0); |
52 | void expand (void *okm, int len, const void *info = 0, int infolen = 0); |