diff --git a/wolfcrypt/src/port/ti/ti-aes.c b/wolfcrypt/src/port/ti/ti-aes.c index d38e7a3cb..91d11a590 100644 --- a/wolfcrypt/src/port/ti/ti-aes.c +++ b/wolfcrypt/src/port/ti/ti-aes.c @@ -89,8 +89,8 @@ static int AesAlign16(Aes* aes, byte* out, const byte* in, word32 sz, word32 di ROM_AESReset(AES_BASE); ROM_AESConfigSet(AES_BASE, (aes->keylen | dir | (mode==AES_CFG_MODE_CTR_NOCTR ? AES_CFG_MODE_CTR : mode))); - ROM_AESIVSet(AES_BASE, aes->reg); - ROM_AESKey1Set(AES_BASE, aes->key, aes->keylen); + ROM_AESIVSet(AES_BASE, (uint32_t *)aes->reg); + ROM_AESKey1Set(AES_BASE, (uint32_t *)aes->key, aes->keylen); if((dir == AES_CFG_DIR_DECRYPT)&& (mode == AES_CFG_MODE_CBC)) /* if input and output same will overwrite input iv */ XMEMCPY(aes->tmp, in + sz - AES_BLOCK_SIZE, AES_BLOCK_SIZE); @@ -250,6 +250,7 @@ static int AesAuthArgCheck(Aes* aes, byte* out, const byte* in, word32 inSz, const byte* authTag, word32 authTagSz, const byte* authIn, word32 authInSz, word32 *M, word32 *L) { + (void) authInSz ; if((aes == NULL)||(nonce == NULL)||(authTag== NULL)||(authIn == NULL)) return BAD_FUNC_ARG; if((inSz != 0) && ((out == NULL)||(in == NULL))) diff --git a/wolfcrypt/src/port/ti/ti-ccm.c b/wolfcrypt/src/port/ti/ti-ccm.c index 09705cfb8..65a51350e 100644 --- a/wolfcrypt/src/port/ti/ti-ccm.c +++ b/wolfcrypt/src/port/ti/ti-ccm.c @@ -27,7 +27,7 @@ #if defined(WOLFSSL_TI_CRYPT) || defined(WOLFSSL_TI_HASH) - +#include "wolfssl/wolfcrypt/port/ti/ti-ccm.h" #include #include @@ -44,7 +44,7 @@ #define WAIT(stat) { volatile int i ; for(i=0; ireg); - ROM_DESKeySet(DES_BASE, des->key); + ROM_DESIVSet(DES_BASE, (uint32_t*)des->reg); + ROM_DESKeySet(DES_BASE,(uint32_t*)des->key); if(dir == DES_CFG_DIR_DECRYPT) /* if input and output same will overwrite input iv */ XMEMCPY(des->tmp, in + sz - DES_BLOCK_SIZE, DES_BLOCK_SIZE); @@ -159,7 +159,10 @@ WOLFSSL_API int wc_Des_CbcDecrypt(Des* des, byte* out, const byte* in, word32 s WOLFSSL_API int wc_Des_CbcDecryptWithKey(byte* out, const byte* in, word32 sz, const byte* key, const byte* iv) -{ return 0 ;} +{ + (void)out; (void)in; (void)sz; (void)key; (void)iv ; + return -1 ; +} WOLFSSL_API int wc_Des3_CbcEncrypt(Des3* des, byte* out, const byte* in, word32 sz) { @@ -173,7 +176,10 @@ WOLFSSL_API int wc_Des3_CbcDecrypt(Des3* des, byte* out, const byte* in, word32 WOLFSSL_API int wc_Des3_CbcDecryptWithKey(byte* out, const byte* in, word32 sz, const byte* key, const byte* iv) -{ return 0 ; } +{ + (void)out; (void)in; (void)sz; (void)key; (void)iv ; + return -1 ; + } #endif /* WOLFSSL_TI_CRYPT */ diff --git a/wolfcrypt/src/port/ti/ti-hash.c b/wolfcrypt/src/port/ti/ti-hash.c index 59edd3b0a..04e6650b6 100644 --- a/wolfcrypt/src/port/ti/ti-hash.c +++ b/wolfcrypt/src/port/ti/ti-hash.c @@ -44,6 +44,7 @@ #include #include #include +#include #ifndef TI_DUMMY_BUILD #include "inc/hw_memmap.h" @@ -61,7 +62,7 @@ bool wolfSSL_TI_CCMInit(void) { return true ; } #endif static int hashInit(wolfssl_TI_Hash *hash) { - if(!wolfSSL_TI_CCMInit())return ; + if(!wolfSSL_TI_CCMInit())return 1 ; hash->used = 0 ; hash->msg = 0 ; hash->len = 0 ; diff --git a/wolfssl/wolfcrypt/port/ti/ti-ccm.h b/wolfssl/wolfcrypt/port/ti/ti-ccm.h index f0fb24799..8e75e0d3e 100644 --- a/wolfssl/wolfcrypt/port/ti/ti-ccm.h +++ b/wolfssl/wolfcrypt/port/ti/ti-ccm.h @@ -19,6 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#ifndef WOLF_CRYPT_TI_CCM_H +#define WOLF_CRYPT_TI_CCM_H + #ifdef HAVE_CONFIG_H #include #endif @@ -27,14 +30,17 @@ #if defined(WOLFSSL_TI_CRYPT) || defined(WOLFSSL_TI_HASH) -bool wolfSSL_TI_CCMInit(void) ; +int wolfSSL_TI_CCMInit(void) ; #ifndef SINGLE_THREADED -void wolfSSL_TI_lockCCM() ; -void wolfSSL_TI_unlockCCM() ; +void wolfSSL_TI_lockCCM(void) ; +void wolfSSL_TI_unlockCCM(void) ; #else #define wolfSSL_TI_lockCCM() #define wolfSSL_TI_unlockCCM() #endif #endif + +#endif +