Skip to content

Add crypto callback for Frodo-kem - #11238

Open
padelsbach wants to merge 5 commits into
wolfSSL:masterfrom
padelsbach:crypto-cb-frodo
Open

padelsbach wants to merge 5 commits into
wolfSSL:masterfrom
padelsbach:crypto-cb-frodo

Conversation

@padelsbach

Copy link
Copy Markdown
Contributor

Description

Includes CB_ONLY mode which saves approx 22kB when enabled and offloaded.

Also includes a minor fix for WOLF_CRYPTO_CB_FIND.

Testing

New unit tests

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@padelsbach
padelsbach force-pushed the crypto-cb-frodo branch 3 times, most recently from 43ab6f8 to a96b311 Compare August 26, 2026 18:05
@padelsbach padelsbach self-assigned this Aug 27, 2026
@padelsbach
padelsbach force-pushed the crypto-cb-frodo branch 3 times, most recently from b81945c to 327628e Compare September 3, 2026 03:36
@padelsbach padelsbach assigned wolfSSL-Bot and unassigned padelsbach Sep 4, 2026

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #11238

Scan targets checked: wolfcrypt-bugs, wolfcrypt-port-bugs, wolfcrypt-rs-bugs, wolfcrypt-src, wolfssl-bugs, wolfssl-src

Findings: 7
7 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Reported findings require changes before merge.

Comment thread wolfcrypt/src/wc_frodokem.c
Comment thread wolfcrypt/test/test.c Outdated
Comment thread wolfcrypt/test/test.c
Comment thread wolfcrypt/test/test.c
Comment thread wolfcrypt/test/test.c
Comment thread wolfcrypt/test/test.c Outdated
Comment thread wolfcrypt/test/test.c
@padelsbach
padelsbach force-pushed the crypto-cb-frodo branch 3 times, most recently from d465827 to daad8ce Compare September 17, 2026 06:05
@padelsbach

Copy link
Copy Markdown
Contributor Author

jenkins retest this please

@padelsbach
padelsbach force-pushed the crypto-cb-frodo branch 2 times, most recently from 97061da to 8bada36 Compare September 29, 2026 17:08
Copilot AI balanced review requested due to automatic review settings October 1, 2026 16:50

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.

Copilot review overview

🟡 Changes recommended

Finder-based cleanup can dispatch duplicate device frees, and the new configure mapping lacks direct CI coverage.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Adds FrodoKEM crypto-callback offloading and a callback-only mode that removes native lattice operations.

Changes:

  • Routes FrodoKEM key generation, encapsulation, decapsulation, and cleanup through crypto callbacks.
  • Strips portable and assembly implementations in callback-only builds.
  • Adds configuration, CI, and callback-dispatch tests.
File Description
wolfssl/​wolfcrypt/​wc_frodokem.h Adds device context and native-mode marker.
wolfssl/​wolfcrypt/​settings.h Validates callback-only configuration.
wolfcrypt/​test/​test.c Adds callback and finder tests.
wolfcrypt/​src/​wc_frodokem.c Implements callback routing and native stripping.
wolfcrypt/​src/​wc_frodokem_mat.c Excludes native matrix operations.
wolfcrypt/​src/​wc_frodokem_asm.S Excludes x86 assembly.
wolfcrypt/​src/​wc_frodokem_asm.asm Excludes Windows x86 assembly.
wolfcrypt/​src/​port/​arm/​thumb2-frodokem-asm.S Excludes Thumb-2 assembly.
wolfcrypt/​src/​port/​arm/​thumb2-frodokem-asm_c.c Excludes inline Thumb-2 assembly.
wolfcrypt/​src/​port/​arm/​armv8-frodokem-asm.S Excludes AArch64 assembly.
wolfcrypt/​src/​port/​arm/​armv8-frodokem-asm.asm Excludes ARM assembler implementation.
wolfcrypt/​src/​port/​arm/​armv8-frodokem-asm_c.c Excludes inline AArch64 assembly.
wolfcrypt/​src/​port/​arm/​armv8-32-frodokem-asm.S Excludes ARMv8-32 assembly.
wolfcrypt/​src/​port/​arm/​armv8-32-frodokem-asm_c.c Excludes inline ARMv8-32 assembly.
wolfcrypt/​src/​cryptocb.c Enables finder-based PQC KEM dispatch.
tests/​api/​test_frodokem.c Skips native-only tests in callback-only mode.
configure.ac Adds FrodoKEM to cryptocb=only.
.github/​workflows/​cryptocb-only.yml Adds callback-only CI configurations.

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

Comment thread wolfcrypt/src/wc_frodokem.c
Comment thread configure.ac
@philljj philljj assigned padelsbach and unassigned wolfSSL-Bot Oct 1, 2026
@padelsbach

Copy link
Copy Markdown
Contributor Author

jenkins retest this please

@padelsbach

Copy link
Copy Markdown
Contributor Author

jenkins retest this please

@philljj
philljj requested a review from night1rider October 2, 2026 18:49
@padelsbach
padelsbach force-pushed the crypto-cb-frodo branch 2 times, most recently from 3e05ce4 to a2bec77 Compare October 2, 2026 23:14
@padelsbach

Copy link
Copy Markdown
Contributor Author

jenkins retest this please

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.

6 participants