SiLabs: AES return code fixup and comment cleanup

This commit is contained in:
Elms
2020-12-10 20:26:59 -08:00
parent 9ba78eb825
commit 40087f1fd0
2 changed files with 5 additions and 4 deletions

View File

@@ -99,7 +99,7 @@ int wc_AesCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 sz)
(uint8_t*)aes->reg, (uint8_t*)aes->reg,
in, in,
out); out);
return (status != SL_STATUS_OK); return (status != SL_STATUS_OK) ? WC_HW_E : 0;
} }
int wc_AesCbcDecrypt(Aes* aes, byte* out, const byte* in, word32 sz) int wc_AesCbcDecrypt(Aes* aes, byte* out, const byte* in, word32 sz)
@@ -112,7 +112,7 @@ int wc_AesCbcDecrypt(Aes* aes, byte* out, const byte* in, word32 sz)
(uint8_t*)aes->reg, (uint8_t*)aes->reg,
in, in,
out); out);
return (status != SL_STATUS_OK); return (status != SL_STATUS_OK) ? WC_HW_E : 0;
} }
#ifdef HAVE_AESGCM #ifdef HAVE_AESGCM

View File

@@ -1463,8 +1463,9 @@ extern void uITRON4_free(void *p) ;
(void *)(pmem_2), \ (void *)(pmem_2), \
(CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES) (CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES)
#else #else
// Work aroud for Micrium OS version 5.8 change in behavior /* Work around for Micrium OS version 5.8 change in behavior
// that returns DEF_NO for 0 size compare * that returns DEF_NO for 0 size compare
*/
#define XMEMCMP(pmem_1, pmem_2, size) \ #define XMEMCMP(pmem_1, pmem_2, size) \
(( (size < 1 ) || \ (( (size < 1 ) || \
((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), \ ((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), \