Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion test-app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ TARGET?=none
ARCH?=ARM
MCUXPRESSO_CMSIS?=$(MCUXPRESSO)/CMSIS
ifneq (,$(filter $(TARGET),mcxa mcxw mcxn))
TEST_APP_NO_RNG?=1
ifneq ($(WOLFCRYPT_TZ_PSA),1)
TEST_APP_NO_RNG?=1
endif
endif
ifeq ($(TZEN),1)
# wcs directory contains a user_settings.h, which will conflict with
Expand Down
18 changes: 18 additions & 0 deletions test-app/wcs/user_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,24 @@ static inline int wcs_cmse_get_random(unsigned char* output, int sz)
#define CUSTOM_RAND_GENERATE_BLOCK wcs_cmse_get_random
#endif

#ifdef WOLFCRYPT_TZ_PSA

extern int hal_trng_get_entropy(unsigned char *out, unsigned int len);

static inline int wcs_psa_rand_block(unsigned char *output, int sz)
{
if (sz <= 0 || output == (unsigned char*)0)
return -1;

if (hal_trng_get_entropy(output, (unsigned int)sz) != 0)
return -1;

return 0;
}
Comment thread
AlexLanzano marked this conversation as resolved.
Comment thread
AlexLanzano marked this conversation as resolved.

#define CUSTOM_RAND_GENERATE_BLOCK wcs_psa_rand_block
#endif

/* Disable VLAs */
#define WOLFSSL_SP_NO_DYN_STACK

Expand Down
Loading