diff --git a/src/headers/tomcrypt.h b/src/headers/tomcrypt.h index 3b4232b..51299af 100644 --- a/src/headers/tomcrypt.h +++ b/src/headers/tomcrypt.h @@ -75,7 +75,6 @@ enum { #include #include #include -#include #ifdef __cplusplus } diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 1401f95..9e9a5bd 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -365,13 +365,19 @@ #endif /* LTC_NO_PKCS */ -/* LTC_HKDF Key Derivation/Expansion stuff */ +/* misc stuff */ +#ifndef LTC_NO_MISC + + +/* Keep LTC_NO_HKDF for compatibility reasons + * superseeded by LTC_NO_MISC*/ #ifndef LTC_NO_HKDF - +/* LTC_HKDF Key Derivation/Expansion stuff */ #define LTC_HKDF - #endif /* LTC_NO_HKDF */ +#endif /* LTC_NO_MISC */ + /* cleanup */ #ifdef LTC_MECC diff --git a/src/headers/tomcrypt_hkdf.h b/src/headers/tomcrypt_hkdf.h deleted file mode 100644 index f6a0228..0000000 --- a/src/headers/tomcrypt_hkdf.h +++ /dev/null @@ -1,28 +0,0 @@ -/* LTC_HKDF Header Info */ - -/* ===> LTC_HKDF -- RFC5869 HMAC-based Key Derivation Function <=== */ -#ifdef LTC_HKDF - -int hkdf_test(void); - -int hkdf_extract(int hash_idx, - const unsigned char *salt, unsigned long saltlen, - const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen); - -int hkdf_expand(int hash_idx, - const unsigned char *info, unsigned long infolen, - const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long outlen); - -int hkdf(int hash_idx, - const unsigned char *salt, unsigned long saltlen, - const unsigned char *info, unsigned long infolen, - const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long outlen); - -#endif /* LTC_HKDF */ - -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 11eb8cd..1d43c91 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -7,6 +7,29 @@ int base64_decode(const unsigned char *in, unsigned long len, unsigned char *out, unsigned long *outlen); #endif +/* ===> LTC_HKDF -- RFC5869 HMAC-based Key Derivation Function <=== */ +#ifdef LTC_HKDF + +int hkdf_test(void); + +int hkdf_extract(int hash_idx, + const unsigned char *salt, unsigned long saltlen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); + +int hkdf_expand(int hash_idx, + const unsigned char *info, unsigned long infolen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long outlen); + +int hkdf(int hash_idx, + const unsigned char *salt, unsigned long saltlen, + const unsigned char *info, unsigned long infolen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long outlen); + +#endif /* LTC_HKDF */ + /* ---- MEM routines ---- */ void zeromem(volatile void *dst, size_t len); void burn_stack(unsigned long len);