From 644f7a4cdbe671968ffd5073cf883b67e89e7327 Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Mon, 1 Jun 2015 14:32:36 +0900 Subject: [PATCH] ti-hash.c included in wc_port.c --- wolfcrypt/src/md5.c | 3 +-- wolfcrypt/src/port/ti/ti-hash.c | 8 ++++---- wolfcrypt/src/sha.c | 3 +-- wolfcrypt/src/sha256.c | 6 +----- wolfcrypt/src/wc_port.c | 3 ++- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/wolfcrypt/src/md5.c b/wolfcrypt/src/md5.c index 02a24ec15..fbf732add 100644 --- a/wolfcrypt/src/md5.c +++ b/wolfcrypt/src/md5.c @@ -29,8 +29,7 @@ #if !defined(NO_MD5) #if defined(WOLFSSL_TI_HASH) - #define WOLFSSL_TI_MD5 - #include + /* #include included by wc_port.c */ #else #ifdef WOLFSSL_PIC32MZ_HASH diff --git a/wolfcrypt/src/port/ti/ti-hash.c b/wolfcrypt/src/port/ti/ti-hash.c index f2885298f..4b7f49a20 100644 --- a/wolfcrypt/src/port/ti/ti-hash.c +++ b/wolfcrypt/src/port/ti/ti-hash.c @@ -144,7 +144,7 @@ static int hashHash(const byte* data, word32 len, byte* hash, word32 algo, word3 return ret; } -#if !defined(NO_MD5) && defined(WOLFSSL_TI_MD5) +#if !defined(NO_MD5) WOLFSSL_API void wc_InitMd5(Md5* md5) { if (md5 == NULL) @@ -175,7 +175,7 @@ WOLFSSL_API int wc_Md5Hash(const byte*data, word32 len, byte*hash) #endif /* NO_MD5 */ -#if !defined(NO_SHA) && defined(WOLFSSL_TI_SHA) +#if !defined(NO_SHA) WOLFSSL_API int wc_InitSha(Sha* sha) { if (sha == NULL) @@ -206,7 +206,7 @@ WOLFSSL_API int wc_ShaHash(const byte*data, word32 len, byte*hash) #endif /* NO_SHA */ -#if defined(HAVE_SHA224) && defined(WOLFSSL_TI_SHA224) +#if defined(HAVE_SHA224) WOLFSSL_API int wc_InitSha224(Sha224* sha224) { if (sha224 == NULL) @@ -237,7 +237,7 @@ WOLFSSL_API int wc_Sha224Hash(const byte* data, word32 len, byte*hash) #endif /* HAVE_SHA224 */ -#if !defined(NO_SHA256) && defined(WOLFSSL_TI_SHA256) +#if !defined(NO_SHA256) WOLFSSL_API int wc_InitSha256(Sha256* sha256) { if (sha256 == NULL) diff --git a/wolfcrypt/src/sha.c b/wolfcrypt/src/sha.c index f710603cb..be8cf17af 100644 --- a/wolfcrypt/src/sha.c +++ b/wolfcrypt/src/sha.c @@ -65,8 +65,7 @@ #else /* else build without fips */ #if defined(WOLFSSL_TI_HASH) - #define WOLFSSL_TI_SHA - #include + /* #include included by wc_port.c */ #else #ifdef WOLFSSL_PIC32MZ_HASH diff --git a/wolfcrypt/src/sha256.c b/wolfcrypt/src/sha256.c index bc40798de..f9f02b003 100644 --- a/wolfcrypt/src/sha256.c +++ b/wolfcrypt/src/sha256.c @@ -57,11 +57,7 @@ int wc_Sha256Hash(const byte* data, word32 len, byte* out) #else /* else build without fips */ #if !defined(NO_SHA256) && defined(WOLFSSL_TI_HASH) - #define WOLFSSL_TI_SHA256 - #ifdef HAVE_SHA224 - #define WOLFSSL_TI_SHA224 - #endif - #include + /* #include included by wc_port.c */ #else #if !defined (ALIGN32) diff --git a/wolfcrypt/src/wc_port.c b/wolfcrypt/src/wc_port.c index 953a16be4..419033751 100644 --- a/wolfcrypt/src/wc_port.c +++ b/wolfcrypt/src/wc_port.c @@ -651,5 +651,6 @@ int UnLockMutex(wolfSSL_Mutex *m) #endif /* SINGLE_THREADED */ #if defined(WOLFSSL_TI_CRYPT) || defined(WOLFSSL_TI_HASH) - #include /* initialize and Mutex for TI Crypt Engine */ + #include /* initialize and Mutex for TI Crypt Engine */ + #include /* md5, sha1, sha224, sha256 */ #endif