Skip to content

Commit b4a19b5

Browse files
committed
Address pr comments
1 parent 5e0cb5e commit b4a19b5

11 files changed

Lines changed: 29 additions & 39 deletions

File tree

.wolfssl_known_macro_extras

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -857,16 +857,14 @@ WOLFSSL_NO_TICKET_EXPIRE
857857
WOLFSSL_NO_TRUSTED_CERTS_VERIFY
858858
WOLFSSL_NO_WORD64_OPS
859859
WOLFSSL_NO_XOR_OPS
860-
WOLFSSL_NXP_LPC55S69_WITH_HWACCEL
861-
WOLFSSL_NXP_LPC55S69_NO_HWACCEL
860+
WOLFSSL_NXP_LPC55S6X
862861
WOLFSSL_NXP_CASPER
863862
WOLFSSL_NXP_CASPER_ECC_MULMOD
864863
WOLFSSL_NXP_CASPER_ECC_MUL2ADD
865864
WOLFSSL_NXP_CASPER_RSA_PUB_EXPTMOD
866865
WOLFSSL_NXP_HASHCRYPT
867866
WOLFSSL_NXP_HASHCRYPT_AES
868867
WOLFSSL_NXP_HASHCRYPT_SHA
869-
WOLFSSL_NXP_HASHCRYPT_SHA256
870868
WOLFSSL_NXP_RNG_1
871869
WOLFSSL_NRF51_AES
872870
WOLFSSL_OLDTLS_AEAD_CIPHERSUITES

wolfcrypt/src/aes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits
141141
#endif
142142

143143
#ifdef WOLFSSL_NXP_HASHCRYPT_AES
144-
#include <wolfssl/wolfcrypt/port/nxp/hashcrypt_port.h>
144+
#include <wolfssl/wolfcrypt/port/nxp/hashcrypt_port.h>
145145
#endif
146146

147147
#ifdef WOLFSSL_SECO_CAAM

wolfcrypt/src/include.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ EXTRA_DIST += wolfcrypt/src/port/ti/ti-aes.c \
7171
wolfcrypt/src/port/nxp/dcp_port.c \
7272
wolfcrypt/src/port/nxp/se050_port.c \
7373
wolfcrypt/src/port/nxp/README.md \
74+
wolfcrypt/src/port/nxp/casper_port.c \
75+
wolfcrypt/src/port/nxp/hashcrypt_port.c \
7476
wolfcrypt/src/port/atmel/README.md \
7577
wolfcrypt/src/port/xilinx/xil-sha3.c \
7678
wolfcrypt/src/port/xilinx/xil-aesgcm.c \

wolfcrypt/src/port/nxp/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,18 @@ will use a fully software implementation.
3030
interrupted with another hash request or an AES request. The hash must be
3131
completed before another operation is requested.
3232

33-
### wolfSSL LPC55S69 Hardware Acceleration Enable/Disable
33+
### wolfSSL LPC55S69 Hardware Acceleration Enable
3434

35-
To enable LPC55S69 hardware acceleration, define the following symbol:
35+
To enable only the TRNG, define the following symbol:
3636

37-
**`WOLFSSL_NXP_LPC55S69_WITH_HWACCEL`**
37+
**`WOLFSSL_NXP_RNG_1`**
3838

39-
To disable LPC55S69 hardware acceleration, define the following symbol:
39+
To enable all LPC55S69 hardware acceleration, including the TRNG,
40+
define the following symbol:
4041

41-
**`WOLFSSL_NXP_LPC55S69_NO_HWACCEL`**
42+
**`WOLFSSL_NXP_LPC55S6X`**
4243

43-
NOTE: In either case, the TRNG is always enabled for use.
44+
NOTE: Both can be defined with no problem.
4445

4546
## NXP SE050
4647

wolfcrypt/src/port/nxp/casper_port.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@
1919
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
2020
*/
2121

22-
#ifdef HAVE_CONFIG_H
23-
#include <config.h>
24-
#endif
25-
26-
#include <wolfssl/wolfcrypt/settings.h>
22+
#include <wolfssl/wolfcrypt/libwolfssl_sources.h>
2723

2824
#ifdef WOLFSSL_NXP_CASPER
2925

wolfcrypt/src/port/nxp/hashcrypt_port.c

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,7 @@
1919
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
2020
*/
2121

22-
23-
#ifdef HAVE_CONFIG_H
24-
#include <config.h>
25-
#endif
26-
27-
#include <wolfssl/wolfcrypt/settings.h>
22+
#include <wolfssl/wolfcrypt/libwolfssl_sources.h>
2823

2924
#ifdef WOLFSSL_NXP_HASHCRYPT
3025

@@ -38,27 +33,27 @@
3833
#include <wolfssl/wolfcrypt/error-crypt.h>
3934
#include "fsl_hashcrypt.h"
4035

41-
#if (!defined(NO_SHA) && defined(WOLFSSL_NXP_HASHCRYPT_SHA)) || \
42-
(!defined(NO_SHA256) && defined(WOLFSSL_NXP_HASHCRYPT_SHA256))
43-
static hashcrypt_hash_ctx_t hash_ctx;
44-
static int finish_called;
36+
#if (!defined(NO_SHA) || !defined(NO_SHA256)) && \
37+
defined(WOLFSSL_NXP_HASHCRYPT_SHA)
38+
static hashcrypt_hash_ctx_t hash_ctx;
39+
static int finish_called;
4540
#endif
4641

4742
#if !defined(NO_AES) && defined(WOLFSSL_NXP_HASHCRYPT_AES)
48-
hashcrypt_handle_t aes_handle;
43+
hashcrypt_handle_t aes_handle;
4944
#endif
5045

5146
int wc_hashcrypt_init(void)
5247
{
53-
#if (!defined(NO_SHA) && defined(WOLFSSL_NXP_HASHCRYPT_SHA)) || \
54-
(!defined(NO_SHA256) && defined(WOLFSSL_NXP_HASHCRYPT_SHA256)) || \
48+
#if ((!defined(NO_SHA) || !defined(NO_SHA256)) && \
49+
defined(WOLFSSL_NXP_HASHCRYPT_SHA)) || \
5550
(!defined(NO_AES) && defined(WOLFSSL_NXP_HASHCRYPT_AES))
5651
HASHCRYPT_Init(HASHCRYPT);
5752
#endif
5853
return 0;
5954
}
6055

61-
#if !defined(NO_SHA256) && defined(WOLFSSL_NXP_HASHCRYPT_SHA256)
56+
#if !defined(NO_SHA256) && defined(WOLFSSL_NXP_HASHCRYPT_SHA)
6257
int wc_InitSha256_ex(wc_Sha256* sha256, void* heap, int devId)
6358
{
6459
(void)heap;
@@ -121,7 +116,7 @@ int wc_Sha256Final(wc_Sha256* sha256, byte* hash)
121116

122117
return 0;
123118
}
124-
#endif /* !defined(NO_SHA256) && defined(WOLFSSL_NXP_HASHCRYPT_SHA256) */
119+
#endif /* !defined(NO_SHA256) && defined(WOLFSSL_NXP_HASHCRYPT_SHA) */
125120

126121

127122
#if !defined(NO_SHA) && defined(WOLFSSL_NXP_HASHCRYPT_SHA)

wolfcrypt/src/random.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5152,7 +5152,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
51525152
#elif defined(WOLFSSL_NXP_RNG_1)
51535153
#include "fsl_rng.h"
51545154

5155-
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz){
5155+
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) {
51565156
(void)os;
51575157

51585158
if (output == NULL) {

wolfcrypt/src/sha256.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ on the specific device platform.
222222
!defined(WOLFSSL_RENESAS_TSIP_CRYPTONLY)) || \
223223
defined(NO_WOLFSSL_RENESAS_TSIP_CRYPT_HASH)) && \
224224
!defined(PSOC6_HASH_SHA2) && !defined(WOLFSSL_IMXRT_DCP) && !defined(WOLFSSL_SILABS_SE_ACCEL) && \
225-
!defined(WOLFSSL_NXP_HASHCRYPT_SHA256) && \
225+
!defined(WOLFSSL_NXP_HASHCRYPT_SHA) && \
226226
!defined(WOLFSSL_KCAPI_HASH) && !defined(WOLFSSL_SE050_HASH) && \
227227
((!defined(WOLFSSL_RENESAS_SCEPROTECT) && \
228228
!defined(WOLFSSL_RENESAS_RSIP)) \
@@ -1069,7 +1069,7 @@ static int InitSha256(wc_Sha256* sha256)
10691069
#include <wolfssl/wolfcrypt/port/nxp/dcp_port.h>
10701070
/* implemented in wolfcrypt/src/port/nxp/dcp_port.c */
10711071

1072-
#elif defined(WOLFSSL_NXP_HASHCRYPT_SHA256)
1072+
#elif defined(WOLFSSL_NXP_HASHCRYPT_SHA)
10731073
/* implemented in wolfcrypt/src/port/nxp/hashcrypt_port.c */
10741074

10751075
#elif defined(WOLFSSL_SILABS_SE_ACCEL)

wolfssl/wolfcrypt/include.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ noinst_HEADERS+= \
9595
wolfssl/wolfcrypt/port/nrf51.h \
9696
wolfssl/wolfcrypt/port/nxp/ksdk_port.h \
9797
wolfssl/wolfcrypt/port/nxp/dcp_port.h \
98+
wolfssl/wolfcrypt/port/nxp/casper_port.h \
99+
wolfssl/wolfcrypt/port/nxp/hashcrypt_port.h \
98100
wolfssl/wolfcrypt/port/xilinx/xil-sha3.h \
99101
wolfssl/wolfcrypt/port/xilinx/xil-versal-glue.h \
100102
wolfssl/wolfcrypt/port/xilinx/xil-versal-trng.h \

wolfssl/wolfcrypt/port/nxp/hashcrypt_port.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
#ifndef _HASHCRYPT_PORT_H_
2222
#define _HASHCRYPT_PORT_H_
2323

24-
#include <wolfssl/wolfcrypt/settings.h>
25-
2624
int wc_hashcrypt_init(void);
2725

2826
#endif /* _HASHCRYPT_PORT_H_ */

0 commit comments

Comments
 (0)