Skip to content

Commit 50426e6

Browse files
committed
STM32_Bare_Test: add cubecrypto target for CubeMX HW ECDSA sign/verify + CCB + AES (U3)
1 parent 4971d6a commit 50426e6

3 files changed

Lines changed: 424 additions & 4 deletions

File tree

STM32_Bare_Test/Makefile

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ endif
5353
ifeq ($(filter $(CONFIG),c asm bare),)
5454
$(error CONFIG must be one of: c | asm | bare)
5555
endif
56-
ifeq ($(filter $(TARGET),test bench dhuk stsaes ccb ccbhal c5rng c5sign cbonly cubeaes),)
57-
$(error TARGET must be one of: test | bench | dhuk | stsaes | ccb | ccbhal | c5rng | c5sign | cbonly | cubeaes)
56+
ifeq ($(filter $(TARGET),test bench dhuk stsaes ccb ccbhal c5rng c5sign cbonly cubeaes cubecrypto),)
57+
$(error TARGET must be one of: test | bench | dhuk | stsaes | ccb | ccbhal | c5rng | c5sign | cbonly | cubeaes | cubecrypto)
5858
endif
5959
# c5rng: bare register-level STM32C5 HW-RNG conditioning probe (no wolfCrypt).
6060
# c5sign: bare STM32C5 PROTECTED ECDSA-sign probe driving ST's NIST P-256 CAVP
@@ -180,8 +180,8 @@ else
180180
$(HAL_SRC_DIR)/stm32$(HAL_FAMILY_LC)_hal_rng_ex.c \
181181
$(HAL_SRC_DIR)/stm32$(HAL_FAMILY_LC)_hal_pka.c
182182
# CCB targets (U3 only) need the CCB HAL driver module: ccbhal is the raw HAL
183-
# reference; ccb under cubemx routes the wolfSSL port through HAL_CCB.
184-
ifneq ($(filter $(TARGET),ccb ccbhal),)
183+
# reference; ccb / cubecrypto under cubemx route the wolfSSL port through HAL_CCB.
184+
ifneq ($(filter $(TARGET),ccb ccbhal cubecrypto),)
185185
HAL_C_SRC += $(HAL_SRC_DIR)/stm32$(HAL_FAMILY_LC)_hal_ccb.c
186186
endif
187187
# Filter out any files that don't exist (different family packs ship
@@ -411,6 +411,20 @@ ifeq ($(TARGET),cubeaes)
411411
endif
412412
COMMON_DEFS += -DWOLF_CRYPTO_CB -DSTM32_CUBE_AES_ONLY
413413
endif
414+
# CubeMX full HW-crypto callback test -- HW ECDSA sign+verify (normal key -> PKA),
415+
# CCB-protected ECDSA (HAL_CCB), and AES-GCM, all through the crypto callback under
416+
# WOLF_CRYPTO_CB_ONLY_ECC + WOLF_CRYPTO_CB_ONLY_AES. Exercises the CubeMX device's
417+
# new ECDSA verify + normal-key sign handlers. Needs the HAL PKA + CCB drivers.
418+
ifeq ($(TARGET),cubecrypto)
419+
ifneq ($(BUILD),cubemx)
420+
$(error TARGET=cubecrypto requires BUILD=cubemx)
421+
endif
422+
ifeq ($(filter $(BOARD),u3),)
423+
$(error TARGET=cubecrypto requires BOARD=u3 (NUCLEO-U385RG-Q))
424+
endif
425+
COMMON_DEFS += -DWOLFSSL_STM32_PKA -DWOLFSSL_DHUK -DWOLF_CRYPTO_CB \
426+
-DWOLFSSL_STM32_CCB -DSTM32_CUBE_CRYPTO_ONLY
427+
endif
414428

415429
ALL_C_SRC := $(SRC_C) $(WC_SRC)
416430

0 commit comments

Comments
 (0)