Skip to content

Add Altera Agilex 5 SDM crypto offload port - #11042

Open
aidangarske wants to merge 1 commit into
wolfSSL:masterfrom
aidangarske:agilex5-fcs-port
Open

Add Altera Agilex 5 SDM crypto offload port#11042
aidangarske wants to merge 1 commit into
wolfSSL:masterfrom
aidangarske:agilex5-fcs-port

Conversation

@aidangarske

@aidangarske aidangarske commented Aug 4, 2026

Copy link
Copy Markdown
Member

Description

  • Adds libfcs based Agilex 5 SDM crypto callback integration
  • Offloads RNG SHA256 AES ECC and HMAC operations
  • Keeps unsupported and short operations on safe software fallback paths
  • Preserves device resident ECC key isolation for signing and key agreement
  • Adds lifecycle rekey copy cleanup and hardware usage regression coverage
  • Supports Autotools CMake and user settings configurations
  • Validates the BitBake packaged wolfCrypt test on Agilex 5 hardware
  • Requires the matching meta-wolfSSL integration for the documented image flow

partner pr here: wolfSSL/meta-wolfssl#176

Copilot AI review requested due to automatic review settings August 4, 2026 01:01
@aidangarske
aidangarske marked this pull request as ready for review August 4, 2026 01:06
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

retest this please

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 wolfCrypt hardware-acceleration port for the Altera Agilex 5 Secure Device Manager (SDM) via libfcs, wiring it into wolfCrypt’s crypto callback framework with software fallback behavior and CI stubs.

Changes:

  • Introduces the Altera FCS port (session glue + crypto callback dispatcher + RNG/SHA-256/AES/ECC/HMAC verify integration) and associated public header/docs.
  • Integrates the port into Autotools and CMake builds (options, defines, sources, link requirements) and adds a CI workflow using stubbed libfcs/libfdt.
  • Updates crypto callback lifecycle handling (cleanup returns status; cleanup can defer/unwind when callbacks report BUSY_E) and adds regression coverage in wolfcrypt tests.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
wolfssl/wolfcrypt/settings.h Auto-enables crypto-callback capabilities needed by the FCS port (CMD/SETKEY).
wolfssl/wolfcrypt/port/altera/altera_fcs.h Adds the public Altera FCS port header/API surface and compile-time guards.
wolfssl/wolfcrypt/include.am Installs the new Altera FCS port header.
wolfssl/wolfcrypt/cryptocb.h Updates crypto callback cleanup API to return status.
wolfcrypt/test/test.c Adds ALTERA-FCS hardware/no-hardware tests and a BUSY_E unregister regression test.
wolfcrypt/src/wc_port.c Auto-registers/unregisters the FCS callback in wolfCrypt_Init/Cleanup with BUSY handling.
wolfcrypt/src/port/altera/README.md Documents build, behavior, limitations, and validation for the Altera FCS port.
wolfcrypt/src/port/altera/altera_fcs_rng.c Implements SDM TRNG seeding path for wolfCrypt RNG via libfcs.
wolfcrypt/src/port/altera/altera_fcs_hmac.c Adds explicit API for SDM “vault-key” HMAC verification.
wolfcrypt/src/port/altera/altera_fcs_hash.c Implements buffered SHA offload with mandatory copy/free callbacks and software fallback.
wolfcrypt/src/port/altera/altera_fcs_glue.c Implements process-wide session management, locking, key-id allocation, and atfork behavior.
wolfcrypt/src/port/altera/altera_fcs_ecc.c Implements device-resident ECC key creation and ECDSA/ECDH operations with no silent fallback.
wolfcrypt/src/port/altera/altera_fcs_cryptocb.c Implements the crypto-callback dispatcher, registration mask, and deferred unregister logic.
wolfcrypt/src/port/altera/altera_fcs_aes.c Implements AES-CBC/AES-CTR offload with key import/retirement and strict eligibility rules.
wolfcrypt/src/include.am Adds Altera FCS sources to distribution and conditional build sources.
wolfcrypt/src/cryptocb.c Makes crypto callback cleanup return status and honors BUSY_E on unregister command.
tests/include.am Adds stubbed libfcs/libfdt files to the distribution list.
tests/altera-fcs-stub/libfcs.h Provides minimal libfcs API header for host CI builds.
tests/altera-fcs-stub/libfcs_stub.c Stub implementation that reports unavailable hardware (CI fallback validation).
tests/altera-fcs-stub/libfcs_osal_types.h Stub OSAL type definitions needed by the libfcs header.
tests/altera-fcs-stub/fdt_stub.c Link-only stub for libfdt dependency in CI.
configure.ac Adds --enable-alterafcs option and wires feature selection/defines/libs into Autotools.
CMakeLists.txt Adds WOLFSSL_ALTERA_FCS option and finds/lib-links libfcs + libfdt for CMake builds.
cmake/options.h.in Adds CMake-generated preprocessor defines for Altera FCS-related options.
cmake/functions.cmake Adds BUILD_ALTERA_FCS* feature derivation and source-list wiring for CMake builds.
.github/workflows/altera-fcs.yml Adds CI workflow building/testing the port against the stubbed dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread wolfcrypt/src/port/altera/altera_fcs_glue.c
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