Update comment format and other minor changes

This commit is contained in:
Rhys Hansen
2023-03-03 13:57:44 -06:00
committed by GitHub
parent fa41754b83
commit 4d81a06557
3 changed files with 14 additions and 9 deletions

View File

@ -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)
{

View File

@ -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 <config.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#if defined(WOLFSSL_RENESAS_RX64_HASH)
@ -28,7 +31,7 @@
#include <stdio.h>
/* mutex */
wolfSSL_Mutex rx64_hw_mutex;
static wolfSSL_Mutex rx64_hw_mutex;
static int rx64_hw_CryptHwMutexInit_ = 0;
/*

View File

@ -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 */