--- gvpe/src/hkdf.h 2013/07/17 04:36:03 1.2 +++ gvpe/src/hkdf.h 2016/06/30 11:43:38 1.3 @@ -1,6 +1,6 @@ /* hkdf.h -- RFC 5869 HKDF implementation - Copyright (C) 2013 Marc Lehmann + Copyright (C) 2013,2016 Marc Lehmann This file is part of GVPE. @@ -34,14 +34,18 @@ #include "global.h" +#include "crypto.h" + // see RFC5869 struct hkdf { - HMAC_CTX ctx; + hmac ctx; u8 prk[EVP_MAX_MD_SIZE]; - hkdf (const void *salt = 0, int len = 0, const EVP_MD *xtr_hash = EVP_sha512 ()); - ~hkdf (); + hkdf (const void *salt = 0, int len = 0, const EVP_MD *xtr_hash = EVP_sha512 ()) + { + ctx.init (salt, len, xtr_hash); + } void extract (const void *ikm, int len); void extract_done (const EVP_MD *prf_hash = 0);