Skip to content

Add crypto callback for SHAKE absorb and squeeze ops - #11548

Merged
philljj merged 2 commits into
wolfSSL:masterfrom
padelsbach:crypto-cb-shake-absorb-squeeze
Oct 2, 2026
Merged

philljj merged 2 commits into
wolfSSL:masterfrom
padelsbach:crypto-cb-shake-absorb-squeeze

Conversation

@padelsbach

@padelsbach padelsbach commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

Add the more granular sponge operations absorb and squeeze to the SHAKE crypto callback mechanism. These are needed to fully offload the arithmetic to the device. Uncovered during development of wolfSSL/wolfHSM#523

Note: does not include CB_ONLY mode, and does not update existing shake callers (ML-KEM, ML_DSA, LMS, XMSS, and SLH-DSA).

Testing

Added unit tests

Checklist

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

@padelsbach
padelsbach force-pushed the crypto-cb-shake-absorb-squeeze branch 2 times, most recently from 32a42f8 to 02d0fa3 Compare September 25, 2026 17:27
@padelsbach
padelsbach force-pushed the crypto-cb-shake-absorb-squeeze branch from 02d0fa3 to 4f757ce Compare September 25, 2026 18:32

@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 #11548

Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfcrypt-port-bugs, wolfssl-src, wolfssl-bugs
Coverage: 5 of 7 in-scope changed file(s) opened by the reviewer; not opened: tests/unit-mcdc/test_cryptocb_whitebox.c, wolfssl/wolfcrypt/cryptocb.h

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

@padelsbach

Copy link
Copy Markdown
Contributor Author

jenkins retest this please

@padelsbach
padelsbach force-pushed the crypto-cb-shake-absorb-squeeze branch from 4f757ce to 90dbaa8 Compare September 28, 2026 16:23
@padelsbach
padelsbach force-pushed the crypto-cb-shake-absorb-squeeze branch from 90dbaa8 to 29b24f8 Compare September 29, 2026 17:05
@padelsbach

Copy link
Copy Markdown
Contributor Author

jenkins retest this please

Copilot AI balanced review requested due to automatic review settings September 30, 2026 15:49
@padelsbach
padelsbach force-pushed the crypto-cb-shake-absorb-squeeze branch from 29b24f8 to 83d853b Compare September 30, 2026 15:49

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

The ASU fallback can lose previously buffered SHAKE input, and the callback interface version was not incremented.

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

Open (2)
What changed in this PR

Adds granular SHAKE absorb/squeeze crypto-callback offloading while preserving software fallback behavior.

Changes:

  • Adds SHAKE operation metadata and dispatch hooks.
  • Extends software-device and Xilinx ASU handling.
  • Adds tests and CI configurations for SHAKE XOF callbacks.
File Description
wolfssl/​wolfcrypt/​cryptocb.h Defines SHAKE callback operations and payload field.
wolfcrypt/​src/​cryptocb.c Populates SHAKE operation metadata.
wolfcrypt/​src/​sha3.c Dispatches absorb and squeeze operations.
wolfcrypt/​src/​port/​xilinx/​versal_gen2_asu/​asu_hash.c Declines unsupported granular operations.
tests/​swdev/​swdev.c Implements software SHAKE callback handling.
wolfcrypt/​test/​test.c Adds callback and fallback tests.
tests/​unit-mcdc/​test_cryptocb_whitebox.c Updates the callback signature test.
.wolfssl_known_macro_extras Registers the new feature macro.
.github/​workflows/​cryptocb-only.yml Adds CI coverage and sharding.
.github/​configs/​os-check-linux.json Adds a SHAKE XOF callback configuration.

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

Comment thread wolfcrypt/src/port/xilinx/versal_gen2_asu/asu_hash.c
Comment thread wolfssl/wolfcrypt/cryptocb.h
@padelsbach
padelsbach force-pushed the crypto-cb-shake-absorb-squeeze branch from cc659b7 to 9b95770 Compare September 30, 2026 17:10
@padelsbach

Copy link
Copy Markdown
Contributor Author

jenkins retest this please

@padelsbach
padelsbach force-pushed the crypto-cb-shake-absorb-squeeze branch from 9b95770 to 9c0fa2b Compare October 1, 2026 16:50
@padelsbach

Copy link
Copy Markdown
Contributor Author

jenkins retest this please

@philljj philljj self-assigned this Oct 2, 2026
@philljj
philljj merged commit d526f9d into wolfSSL:master Oct 2, 2026
454 of 455 checks passed
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.

5 participants