Skip to content

Commit 1e96682

Browse files
committed
Peer review fixes
1 parent a220564 commit 1e96682

3 files changed

Lines changed: 21 additions & 7 deletions

File tree

include/user_settings.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ extern int tolower(int c);
9292
# define NO_ED448_EXPORT
9393
# define WOLFSSL_SHA3
9494
# define WOLFSSL_SHAKE256
95+
# define WOLFSSL_SHA512
9596
#endif
9697

9798
/* ECC */
@@ -498,11 +499,14 @@ extern int tolower(int c);
498499

499500

500501
#if !defined(ENCRYPT_WITH_AES128) && !defined(ENCRYPT_WITH_AES256) && \
501-
!defined(WOLFBOOT_TPM_PARMENC) && !defined(WOLFCRYPT_SECURE_MODE)
502+
!defined(WOLFBOOT_TPM_PARMENC) && !defined(WOLFCRYPT_SECURE_MODE) && \
503+
!defined(SECURE_PKCS11) && !defined(WOLFCRYPT_TZ_PSA) && \
504+
!defined(WOLFCRYPT_TEST) && !defined(WOLFCRYPT_BENCHMARK)
502505
#define NO_AES
503506
#endif
504507

505-
#if !defined(WOLFBOOT_TPM) && !defined(WOLFCRYPT_SECURE_MODE)
508+
#if !defined(WOLFBOOT_TPM) && !defined(WOLFCRYPT_SECURE_MODE) && \
509+
!defined(WOLFCRYPT_TEST) && !defined(WOLFCRYPT_BENCHMARK)
506510
# define NO_HMAC
507511
#endif
508512

test-app/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,12 @@ ifeq ($(TARGET),va416x0)
397397
ifneq ($(SIGN),NONE)
398398
APP_OBJS+=../src/keystore.o
399399
endif
400-
# Reduce size: newlib-nano (small printf/snprintf, no float) and section GC
400+
# Reduce size: newlib-nano and section GC
401401
LDFLAGS+=--specs=nano.specs --specs=nosys.specs
402+
ifeq ($(WOLFCRYPT_BENCHMARK),1)
403+
# Benchmark needs float printf for results
404+
LDFLAGS+=-u _printf_float
405+
endif
402406
CFLAGS+=-ffunction-sections -fdata-sections
403407
endif
404408

test-app/wolfcrypt_support.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
#if defined(WOLFCRYPT_SECURE_MODE)
4040
/* Use secure mode API for time */
4141
#include "wolfboot/wc_secure.h"
42+
#elif defined(TARGET_va416x0)
43+
/* Use Vorago SDK HAL_time_ms (incremented by SysTick_Handler every 1ms) */
44+
extern volatile uint64_t HAL_time_ms;
4245
#else
4346
/* Simple tick counter fallback */
4447
static volatile unsigned int tick_counter = 0;
@@ -54,10 +57,12 @@ unsigned long my_time(unsigned long* timer)
5457
unsigned long t = wolfBoot_nsc_get_time();
5558
if (timer) *timer = t;
5659
return t;
60+
#elif defined(TARGET_va416x0)
61+
unsigned long t = (unsigned long)(HAL_time_ms / 1000);
62+
if (timer) *timer = t;
63+
return t;
5764
#else
5865
/* Simple incrementing counter */
59-
/* WARNING: This is not real time! Only suitable for basic testing. */
60-
/* For production use, implement actual RTC or define NO_ASN_TIME */
6166
tick_counter++;
6267
if (timer) *timer = tick_counter;
6368
return tick_counter;
@@ -75,10 +80,11 @@ double current_time(int reset)
7580

7681
#if defined(WOLFCRYPT_SECURE_MODE)
7782
return wolfBoot_nsc_current_time(reset);
83+
#elif defined(TARGET_va416x0)
84+
/* Use Vorago SDK SysTick-based millisecond counter */
85+
return (double)HAL_time_ms / 1000.0;
7886
#else
7987
/* Simple counter-based timing */
80-
/* WARNING: This will not give accurate benchmark results! */
81-
/* For accurate benchmarks, implement hardware timer access */
8288
double timeNow = (double)tick_counter;
8389
return timeNow;
8490
#endif

0 commit comments

Comments
 (0)