Skip to content

Implement wolfcrypt + wolfHAL example - #615

Open
AlexLanzano wants to merge 1 commit into
wolfSSL:masterfrom
AlexLanzano:wolfHAL-integration
Open

Implement wolfcrypt + wolfHAL example#615
AlexLanzano wants to merge 1 commit into
wolfSSL:masterfrom
AlexLanzano:wolfHAL-integration

Conversation

@AlexLanzano

@AlexLanzano AlexLanzano commented Aug 14, 2026

Copy link
Copy Markdown
Member
  • Bare-metal STM32WB55 Nucleo app: wolfcrypt_test() and benchmark_test()
  • AES-ECB/CBC/GCM/CCM and RNG offloaded to hardware through the wolfSSL wolfHAL port
  • boards/stm32wb55xx_nucleo/ brings up clock, GPIO, UART1, SysTick, AES1 and RNG
  • wolfHAL pinned as a submodule at wolfHAL/wolfHAL
  • README covering wolfHAL, supported boards, and how to build
  • Implemented CI build test

This PR relies on the wolfHAL integration for wolfssl to be merged first wolfSSL/wolfssl#11033
CI test will fail

Output for STM32WB55 Nucleo board using wolfHAL

------------------------------------------------------------------------------
 wolfSSL version 5.9.2
  CryptoCB with DevID:5748
------------------------------------------------------------------------------
macro    test passed!
error    test passed!
MEMORY   test passed!
SHA-256  test passed!
RANDOM   test passed!
Hash     test passed!
GMAC     test passed!
AES      test passed!
AES256   test passed!
AES-CBC  test passed!
AES-GCM  test passed!
AES-CCM  test passed!
logging  test passed!
mutex    test passed!
memcb    test passed!
crypto callback test passed!
Test complete
wolfCrypt Benchmark (block bytes 1024, min 1.0 sec each)
RNG SHA-256 DRBG        SW     2 MiB took 1.005 seconds,    2.162 MiB/s
AES-128-CBC-enc         SW   325 KiB took 1.055 seconds,  308.057 KiB/s
AES-128-CBC-dec         SW   325 KiB took 1.064 seconds,  305.451 KiB/s
AES-256-CBC-enc         SW   250 KiB took 1.019 seconds,  245.339 KiB/s
AES-256-CBC-dec         SW   250 KiB took 1.028 seconds,  243.191 KiB/s
AES-128-CBC-enc         HW     5 MiB took 1.004 seconds,    4.790 MiB/s
AES-128-CBC-dec         HW     4 MiB took 1.002 seconds,    3.752 MiB/s
AES-256-CBC-enc         HW     4 MiB took 1.000 seconds,    4.175 MiB/s
AES-256-CBC-dec         HW     3 MiB took 1.000 seconds,    3.394 MiB/s
AES-128-GCM-enc         SW   150 KiB took 1.053 seconds,  142.450 KiB/s
AES-128-GCM-dec         SW   150 KiB took 1.079 seconds,  139.018 KiB/s
AES-256-GCM-enc         SW   150 KiB took 1.179 seconds,  127.226 KiB/s
AES-256-GCM-dec         SW   125 KiB took 1.005 seconds,  124.378 KiB/s
AES-128-GCM-enc-no_AAD  SW   150 KiB took 1.044 seconds,  143.678 KiB/s
AES-128-GCM-dec-no_AAD  SW   150 KiB took 1.070 seconds,  140.187 KiB/s
AES-256-GCM-enc-no_AAD  SW   150 KiB took 1.170 seconds,  128.205 KiB/s
AES-256-GCM-dec-no_AAD  SW   150 KiB took 1.196 seconds,  125.418 KiB/s
AES-128-GCM-enc         HW     3 MiB took 1.004 seconds,    2.651 MiB/s
AES-128-GCM-dec         HW     3 MiB took 1.005 seconds,    2.721 MiB/s
AES-256-GCM-enc         HW     2 MiB took 1.004 seconds,    2.456 MiB/s
AES-256-GCM-dec         HW     3 MiB took 1.009 seconds,    2.541 MiB/s
AES-128-GCM-enc-no_AAD  HW     3 MiB took 1.006 seconds,    2.718 MiB/s
AES-128-GCM-dec-no_AAD  HW     3 MiB took 1.005 seconds,    2.696 MiB/s
AES-256-GCM-enc-no_AAD  HW     3 MiB took 1.005 seconds,    2.502 MiB/s
AES-256-GCM-dec-no_AAD  HW     2 MiB took 1.006 seconds,    2.475 MiB/s
GMAC Default            SW   275 KiB took 1.043 seconds,  263.663 KiB/s
GMAC Default            SW     3 MiB took 1.002 seconds,    3.021 MiB/s
AES-128-ECB-enc         SW   352 KiB took 1.031 seconds,  341.416 KiB/s
AES-128-ECB-dec         SW   363 KiB took 1.026 seconds,  353.801 KiB/s
AES-256-ECB-enc         SW   275 KiB took 1.035 seconds,  265.700 KiB/s
AES-256-ECB-dec         SW   275 KiB took 1.007 seconds,  273.088 KiB/s
AES-128-ECB-enc         HW     5 MiB took 1.002 seconds,    4.878 MiB/s
AES-128-ECB-dec         HW     4 MiB took 1.001 seconds,    3.831 MiB/s
AES-256-ECB-enc         HW     4 MiB took 1.001 seconds,    4.293 MiB/s
AES-256-ECB-dec         HW     3 MiB took 1.000 seconds,    3.448 MiB/s
AES-CCM-enc             SW   175 KiB took 1.129 seconds,  155.004 KiB/s
AES-CCM-dec             SW   175 KiB took 1.129 seconds,  155.004 KiB/s
AES-CCM-enc-no_AAD      SW   175 KiB took 1.130 seconds,  154.867 KiB/s
AES-CCM-dec-no_AAD      SW   175 KiB took 1.130 seconds,  154.867 KiB/s
AES-CCM-enc             HW     2 MiB took 1.004 seconds,    2.213 MiB/s
AES-CCM-dec             HW     2 MiB took 1.010 seconds,    2.151 MiB/s
AES-CCM-enc-no_AAD      HW     2 MiB took 1.007 seconds,    2.206 MiB/s
AES-CCM-dec-no_AAD      HW     2 MiB took 1.010 seconds,    2.151 MiB/s
SHA-256                 SW     1 MiB took 1.023 seconds,    1.026 MiB/s
SHA-256                 HW     1 MiB took 1.014 seconds,    1.011 MiB/s
RNG      256 SHA256 Init/Free  40712 ops took 1.000 sec, avg 0.025 ms, 40712.000 ops/sec
Benchmark complete

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new bare-metal wolfCrypt + wolfHAL example targeting the STM32WB55 Nucleo, and wires it into CI/manifest so it is cross-built against wolfSSL master.

Changes:

  • Introduces wolfHAL/ example app + STM32WB55 board bring-up (clock, UART, SysTick, AES1, RNG) and wolfCrypt configuration for hardware offload via wolfHAL.
  • Adds a dedicated build system (board-owned toolchain/linker/driver list; objects in build/) and documentation for building/flashing and adding boards.
  • Adds CI workflow + composite action to cross-build the board(s), and registers the example in the repo’s manifest + nightly.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
wolfHAL/user_settings.h wolfCrypt configuration for the example (wolfHAL + RNG + AES offload, embedded-only feature set).
wolfHAL/syscalls.c Bare-metal libc stubs and UART-backed stdout support.
wolfHAL/README.md Build/flash instructions, supported boards, and guidance for adding new boards.
wolfHAL/Makefile Example build system compiling wolfCrypt from source + board sources + wolfHAL drivers.
wolfHAL/main.c Example entrypoint running wolfcrypt_test() then benchmark_test() with SysTick timing hook.
wolfHAL/boards/stm32wb55xx_nucleo/linker.ld Board linker script defining memory layout, heap/stack bounds, and sections.
wolfHAL/boards/stm32wb55xx_nucleo/ivt.c Startup/vector table and reset initialization code for the board.
wolfHAL/boards/stm32wb55xx_nucleo/board.mk Board toolchain selection, CFLAGS/LDFLAGS, and driver source list.
wolfHAL/boards/stm32wb55xx_nucleo/board.h Board device configuration/macros consumed by wolfHAL drivers and wolfSSL wolfHAL port dispatch.
wolfHAL/boards/stm32wb55xx_nucleo/board.c Board bring-up/deinit: clock tree, GPIO, UART, SysTick timer, RNG, AES.
wolfHAL/.gitignore Ignore example build outputs (updated as part of PR).
.gitmodules Adds wolfHAL as a pinned submodule at wolfHAL/wolfHAL.
.github/workflows/wolfhal.yml CI workflow to cross-build wolfHAL boards against wolfSSL master.
.github/workflows/nightly.yml Registers wolfHAL workflow in nightly.
.github/scripts/manifest.py Registers wolfhal job/path for manifest job tracking.
.github/examples-manifest.yml Adds wolfhal example entry (tier: cross, build-only).
.github/actions/wolfhal-build/action.yml Composite action to build a board and assert wolfHAL port is linked/dispatching.
Suppressed comments (1)

wolfHAL/boards/stm32wb55xx_nucleo/ivt.c:22

  • ISR declarations use empty parameter lists, which will warn/error with -Wstrict-prototypes. Also, SysTick_Handler is declared noreturn via alias, but the real SysTick_Handler implementation returns (board.c), which can also trigger attribute mismatch diagnostics under -Werror.
void Reset_Handler() __attribute__((weak));
void NMI_Handler() __attribute__((weak, noreturn, alias("Default_Handler")));
void HardFault_Handler() __attribute__((weak, noreturn, alias("Default_Handler")));
void MemManage_Handler() __attribute__((weak, noreturn, alias("Default_Handler")));
void BusFault_Handler() __attribute__((weak, noreturn, alias("Default_Handler")));

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread wolfHAL/boards/stm32wb55xx_nucleo/ivt.c
Comment thread wolfHAL/boards/stm32wb55xx_nucleo/ivt.c
Comment thread wolfHAL/main.c
Comment thread wolfHAL/main.c
Comment thread wolfHAL/syscalls.c
Comment thread wolfHAL/.gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants