fix HAVE_SELFTEST build for CAVP selftest

This commit is contained in:
Chris Conlon
2018-05-30 10:53:14 -06:00
parent a2fdc6262d
commit 5d99079603
4 changed files with 24 additions and 4 deletions
+14 -2
View File
@@ -48,14 +48,26 @@ enum Hash_Sum {
};
#endif /* !NO_ASN */
#ifdef HAVE_SELFTEST
enum {
/* CAVP selftest includes these in hmac.h instead of sha3.h,
copied here for that build */
WC_SHA3_224_BLOCK_SIZE = 144,
WC_SHA3_256_BLOCK_SIZE = 136,
WC_SHA3_384_BLOCK_SIZE = 104,
WC_SHA3_512_BLOCK_SIZE = 72,
};
#endif
/* function converts int hash type to enum */
enum wc_HashType wc_HashTypeConvert(int hashType)
{
/* Default to hash type none as error */
enum wc_HashType eHashType = WC_HASH_TYPE_NONE;
#ifdef HAVE_FIPS
/* original FIPSv1 requires a mapping for unique hash type to wc_HashType */
#if defined(HAVE_FIPS) || defined(HAVE_SELFTEST)
/* original FIPSv1 and CAVP selftest require a mapping for unique hash
type to wc_HashType */
switch (hashType) {
#ifndef NO_MD5
case WC_MD5: