Repository navigation
Conversation
|
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #12055
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfcrypt-port-bugs, wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): .github/workflows/mpfs-athena-compile.yml, configure.ac, wolfcrypt/src/port/microchip/README.md
Coverage: 4 of 4 in-scope changed file(s) opened by the reviewer
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Max
82a90b6 to
1e6ea49
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The documented custom-seed configuration lacks a visible function prototype in random.c, causing strict builds to fail, while the custom-seed CI leg omits random.c and misses the failure.
1 open issue
What changed in this PR
This PR expands PolarFire SoC Athena integration for accelerated cryptography, including AES-ECB-backed XTS, and addresses strict-alignment issues affecting bare-metal RISC-V targets.
Changes:
- Expands port declarations, configuration, and documentation for supported offloads.
- Adds alignment-safe GCM multiplication and 8-byte alignment for SHA-256 constant tables.
- Broadens compile-only CI coverage across algorithms and port configurations.
| File | Description |
|---|---|
wolfssl/wolfcrypt/settings.h |
Clarifies hash-context ownership and software-fallback comments. |
wolfssl/wolfcrypt/port/microchip/mpfs_athena.h |
Documents expanded capabilities and adds configuration macros and the entropy API declaration. |
wolfcrypt/src/port/riscv64/riscv-64-sha256-asm.S |
Aligns three constant tables for 64-bit loads. |
wolfcrypt/src/port/microchip/README.md |
Expands setup, offload coverage, XTS benchmarks, and hardware guidance. |
wolfcrypt/src/aes.c |
Adds a byte-oriented GCM multiplication path for strict-alignment builds. |
configure.ac |
Enables ECB automatically for Athena XTS builds and removes mandatory SHA-384/CTR checks. |
.github/workflows/mpfs-athena-compile.yml |
Adds algorithm, RNG, memory, and opt-out compile configurations. |
Review effort: Balanced
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #12055
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfcrypt-port-bugs, wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): .github/workflows/mpfs-athena-compile.yml, configure.ac, wolfcrypt/src/port/microchip/README.md, wolfcrypt/src/port/riscv64/riscv-64-sha256-asm.S
Coverage: 3 of 3 in-scope changed file(s) opened by the reviewer
Findings: 2
2 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
Review tier: Lite
1e6ea49 to
a409d19
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #12055
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfcrypt-port-bugs
Unchanged since last review (not re-run): wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): .github/workflows/mpfs-athena-compile.yml, configure.ac, wolfcrypt/benchmark/benchmark.c, wolfcrypt/src/port/microchip/README.md, wolfcrypt/src/port/riscv64/riscv-64-sha256-asm.S
Coverage: 2 of 2 in-scope changed file(s) opened by the reviewer
Findings: 2
2 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
Review tier: Lite
1707cd4 to
f6fb35a
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
Clearing the static heap hint without unloading the pool leaks mutex resources across benchmark runs, and the NRBG completion guidance can lead callers to wait forever.
No open issues 🎉
2 resolved since last review
Review effort: Balanced
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #12055
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfcrypt-port-bugs, wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): .github/workflows/mpfs-athena-compile.yml, configure.ac, wolfcrypt/benchmark/benchmark.c, wolfcrypt/src/port/microchip/README.md, wolfcrypt/src/port/riscv64/riscv-64-sha256-asm.S
Coverage: 2 of 2 in-scope changed file(s) opened by the reviewer
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite
Fenrir's latest completed scan found no issues; clearing the prior automated change request.
f6fb35a to
e90624e
Compare
e90624e to
034e4f1
Compare



Description
The Athena F5200 port offloaded SHA-384 and AES-256-CTR. This extends it to what the engine and Microchip's CAL support, and fixes four problems outside the new handlers that the bare-metal builds depend on.
_AesXtsHelper()'s bulk call; CBC; CTR; native GCM and GMAC; one-shot CMAC; RFC 3394 and RFC 5649 key wrap.WC_MPFS_ATHENA_AES_MIN_SZkeeps XTS's one-block tweak and tail calls in software. CAL moves GCM data and AAD in whole blocks, so other lengths go through a padded copy.random.c'swc_GenerateSeed()reads the NRBG directly when the port is enabled, so every RNG is seeded from the engine whatever its devId (WC_MPFS_ATHENA_NO_RNGopts out, and aCUSTOM_RAND_GENERATE_SEEDstill takes precedence);WC_MPFS_ATHENA_RNG_DRBGalso generates from the engine's DRBG.ecc.c's curve table, and the RSA CRT private operation. Private operations use the engine's countermeasure paths and purge the PKX afterwards; nonces are drawn before the hardware mutex is taken. RSA public operations are opt-in withWC_MPFS_ATHENA_RSA_PUBLIC, since with a small public exponent the engine is slower than software.WC_MPFS_ATHENA_NO_*opt-out.wc_AesCtrEncrypt(). Each transfer now stops at the wrap andaes->regis advanced in software.aes.c: the 64-bitGMULT()table path reads at odd offsets and had noWOLFSSL_USE_ALIGNguard, unlike the 32-bit path; a strict-alignment 64-bit target now takes the byte loop.riscv-64-sha256-asm.S: the SHA-256 round constant tables were aligned to 4 bytes for the 8-byteldloads that read them. Regenerated with the wolfSSL/scripts generator fix (wolfSSL/scripts#718).benchmark.c:benchmark_free()clears the static-memory hint. With it kept, the nextbenchmark_init()partitioned the same pool again from its start, over the heap structures already there, so running the benchmark more than once, as wolfBoot's test-app does per call size, corrupted the free lists.wc_MpfsAthena_SelfTest(), is opt-in withWC_MPFS_ATHENA_SELFTEST.configure.acno longer requires SHA-384 and AES-CTR. CI compiles every configuration, with and without the self-test, in one job, and checks every CAL symbol against the archive; README.Testing
MPFS250TS Video Kit, E51 bare metal under wolfBoot's test-app (wolfBoot PR 980): the port self-test and the full
wolfcrypt_test()with every family on the engine, including RSA-2048 and all five NIST curves, and the benchmark against software C and the RISC-V assembly. Host:wolfcrypt_test()through the port under ASan and UBSan against a CAL stub that models the engine's transfers, block granularity and operand layout, single and multi-threaded;make checkwith--enable-all; every CI leg.