Skip to content

Commit d714e55

Browse files
night1riderZackLabPC
authored andcommitted
Addressing PR comments typos and cleanup and support HAVE_AES_ECB, Sha1, and Sha224
1 parent 2e8cf39 commit d714e55

8 files changed

Lines changed: 291 additions & 89 deletions

File tree

wolfcrypt/benchmark/benchmark.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14259,6 +14259,7 @@ void bench_sphincsKeySign(byte level, byte optim)
1425914259

1426014260
double current_time(int reset)
1426114261
{
14262+
(void)reset;
1426214263
return wc_MXC_RTC_Time();
1426314264
}
1426414265

wolfcrypt/src/aes.c

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11508,6 +11508,48 @@ int wc_AesGetKeySize(Aes* aes, word32* keySize)
1150811508
#elif defined(WOLFSSL_RISCV_ASM)
1150911509
/* implemented in wolfcrypt/src/port/riscv/riscv-64-aes.c */
1151011510

11511+
#elif defined(MAX3266X_AES)
11512+
11513+
int wc_AesEcbEncrypt(Aes* aes, byte* out, const byte* in, word32 sz)
11514+
{
11515+
int status;
11516+
word32 keySize;
11517+
11518+
if ((in == NULL) || (out == NULL) || (aes == NULL))
11519+
return BAD_FUNC_ARG;
11520+
11521+
status = wc_AesGetKeySize(aes, &keySize);
11522+
if (status != 0) {
11523+
return status;
11524+
}
11525+
11526+
status = wc_MXC_TPU_AesEncrypt(in, aes->reg, aes->key, MXC_TPU_MODE_ECB,
11527+
sz, out, keySize);
11528+
11529+
return status;
11530+
}
11531+
11532+
#ifdef HAVE_AES_DECRYPT
11533+
int wc_AesEcbDecrypt(Aes* aes, byte* out, const byte* in, word32 sz)
11534+
{
11535+
int status;
11536+
word32 keySize;
11537+
11538+
if ((in == NULL) || (out == NULL) || (aes == NULL))
11539+
return BAD_FUNC_ARG;
11540+
11541+
status = wc_AesGetKeySize(aes, &keySize);
11542+
if (status != 0) {
11543+
return status;
11544+
}
11545+
11546+
status = wc_MXC_TPU_AesDecrypt(in, aes->reg, aes->key, MXC_TPU_MODE_ECB,
11547+
sz, out, keySize);
11548+
11549+
return status;
11550+
}
11551+
#endif /* HAVE_AES_DECRYPT */
11552+
1151111553
#elif defined(WOLFSSL_SCE) && !defined(WOLFSSL_SCE_NO_AES)
1151211554

1151311555
/* Software AES - ECB */

wolfcrypt/src/port/maxim/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ wolfSSL using Analog Devices MAXQ1065, MAX1080, MAX32665 or MAX32666
66
wolfSSL can be configured to use the MAXQ1065 or MAX1080 cryptographic
77
controllers. wolfSSL can also be configure to utilize the TPU
88
(crypto accelerator), MAA (math accelerator), and TRNG available on select
9-
MAX32665 and MAX32666 microcontrollers.
9+
MAX32665 and MAX32666 microcontroller.
1010

1111
Product datasheets, user guides and other resources can be found at
1212
Analog Devices website:
@@ -41,7 +41,7 @@ all other operations will use the default software implementations.
4141
The other prerequisite is that a change needs to be made to the Maxim SDK. This
4242
is to use the MAA Math Accelerator, this change only needs to be made if you are
4343
using `#define WOLFSSL_MAX3266X` or `define WOLFSSL_MAX3266X_OLD` by themselves
44-
or you are specifing `#define MAX3266X_MATH`.
44+
or you are specifying `#define MAX3266X_MATH`.
4545

4646
In the SDK you will need to find the underlying function that
4747
`MXC_TPU_MAA_Compute()` from `tpu.h` compute calls in the newer SDK. In the
@@ -68,7 +68,7 @@ if you want to know more details on the issue.
6868

6969

7070
## Supported Algos
71-
Using these defines will replace software implentations with a call to the
71+
Using these defines will replace software implementations with a call to the
7272
hardware.
7373

7474
`#define MAX3266X_RNG`
@@ -95,7 +95,7 @@ like RSA and ECC key generation):
9595

9696
## Extra Information
9797
For more Verbose info you can use `#define DEBUG_WOLFSSL` in combination with
98-
`#define MAX3266X_VERBOSE` to see if errors are occuring during the hardware
98+
`#define MAX3266X_VERBOSE` to see if errors are occurring during the hardware
9999
setup/
100100

101101
To reproduce benchmark numbers you can use `#define MAX3266X_RTC`.
@@ -104,7 +104,7 @@ Do note that this will only work with `#define WOLFSSL_MAX3266X` and not
104104
and not for any other application. Please implement your own rtc/time code for
105105
anything else.
106106

107-
For more infromation about the TPU, MAA, and TRNG please refer to the
107+
For more information about the TPU, MAA, and TRNG please refer to the
108108
[MAX32665/MAX32666 User Guide: UG6971](https://www.analog.com/media/en/technical-documentation/user-guides/max32665max32666-user-guide.pdf)
109109

110110
# MAXQ1065/MAX1080

0 commit comments

Comments
 (0)