diff --git a/wolfcrypt/src/port/Renesas/renesas_rx64_hw_sha.c b/wolfcrypt/src/port/Renesas/renesas_rx64_hw_sha.c index bf785a7ae..170ebb5e4 100644 --- a/wolfcrypt/src/port/Renesas/renesas_rx64_hw_sha.c +++ b/wolfcrypt/src/port/Renesas/renesas_rx64_hw_sha.c @@ -115,16 +115,18 @@ int RX64_ShaCalc(byte* data, word32 len, byte* out, word32 sha_type) rx64_hw_lock(); do { - // The hardware functions can only accept UINT16_MAX bytes at a time. - // To work around this break the buffer up into chunks and pass the - // R_SHA_FINISH flag with the last chunk. + /* + The hardware functions can only accept UINT16_MAX bytes at a time. + To work around this break the buffer up into chunks and pass the + R_SHA_FINISH flag with the last chunk. + */ if (len - index <= UINT16_MAX) { flag = flag | R_SHA_FINISH; chunk_length = len - index; } else { chunk_length = UINT16_MAX; } - // Based on the hash type call the correct hardware function. + /* Based on the hash type call the correct hardware function. */ if (sha_type == RX64_SHA1) { ret = R_Sha1_HashDigest(&data[index], out, chunk_length, flag, &work_sha.sha1); @@ -136,7 +138,7 @@ int RX64_ShaCalc(byte* data, word32 len, byte* out, word32 sha_type) &work_sha.sha256); } if (ret != R_PROCESS_COMPLETE) { - // On failure break, unlock hardware, return error. + /* On failure break, unlock hardware, return error. */ break; } index += chunk_length; @@ -284,7 +286,7 @@ static int RX64_HashFinal(wolfssl_RX64_HW_Hash* hash, byte* out) } else { - // Utilize RX64 SHA HW Acceleration for normal SHA operations. + /* Utilize RX64 SHA HW Acceleration for normal SHA operations. */ ret = RX64_ShaCalc(hash->msg, hash->len, out, hash->sha_type); if (ret != R_PROCESS_COMPLETE) { diff --git a/wolfcrypt/src/port/Renesas/renesas_rx64_hw_util.c b/wolfcrypt/src/port/Renesas/renesas_rx64_hw_util.c index 5d7e0678f..2d995d99f 100644 --- a/wolfcrypt/src/port/Renesas/renesas_rx64_hw_util.c +++ b/wolfcrypt/src/port/Renesas/renesas_rx64_hw_util.c @@ -20,6 +20,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + #ifdef HAVE_CONFIG_H + #include +#endif #include #if defined(WOLFSSL_RENESAS_RX64_HASH) @@ -28,7 +31,7 @@ #include /* mutex */ -wolfSSL_Mutex rx64_hw_mutex; +static wolfSSL_Mutex rx64_hw_mutex; static int rx64_hw_CryptHwMutexInit_ = 0; /* diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index d3367d394..c6a5b3fc0 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -244,8 +244,8 @@ /* Uncomment next line if using RENESAS RA6M4 */ /* #define WOLFSSL_RENESAS_RA6M4 */ -// Uncomment next line if using RENESAS RX64 hardware acceleration -// #define WOLFSSL_RENESAS_RX64_HASH +/* Uncomment next line if using RENESAS RX64 hardware acceleration */ +/* #define WOLFSSL_RENESAS_RX64_HASH */ /* Uncomment next line if using Solaris OS*/ /* #define WOLFSSL_SOLARIS */