ML-KEM/ML-DSA: harden against fault attacks#9734
Merged
douzzer merged 1 commit intowolfSSL:masterfrom Mar 6, 2026
Merged
Conversation
Contributor
Author
|
Jenkins retest this please Nodes went down. |
JacobBarthelmeh
previously approved these changes
Mar 3, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens post-quantum ML-KEM (Kyber) and ML-DSA (Dilithium) implementations against fault-injection attacks and updates SHA-3 fault-hardening checks, controlled via the --enable-faultharden configure option.
Changes:
- ML-KEM: use a separate
sigmabuffer under fault hardening and validate the copy. - ML-DSA: add pointer-integrity checks to detect faulted
y/ytpointers during signing. - SHA-3: rename/standardize the fault-hardening macro and widen check counters to avoid overflow.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
wolfcrypt/src/wc_mlkem.c |
Adds WC_MLKEM_FAULT_HARDEN path with separate sigma buffer and verification checks. |
wolfcrypt/src/sha3.c |
Renames hardening macro to WC_SHA3_FAULT_HARDEN and widens check variables used for fault detection. |
wolfcrypt/src/dilithium.c |
Adds WC_MLDSA_FAULT_HARDEN pointer-integrity checks during signing to detect faulted pointers. |
configure.ac |
Extends --enable-faultharden to define the new SHA-3/ML-KEM/ML-DSA fault-hardening macros. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
douzzer
approved these changes
Mar 5, 2026
douzzer
requested changes
Mar 5, 2026
Contributor
douzzer
left a comment
There was a problem hiding this comment.
The Copilot recommendations here seem substantive.
ML-DSA: check pointer to the y parameter has not be faulted. ML-KEM: to harden against faultiong, use a different buffer for private seed, sigma, and add a check that the buffer was copied correctly. SHA-3: fix size of check variables.
09d0839 to
65a1a68
Compare
douzzer
approved these changes
Mar 6, 2026
Contributor
|
retest this please |
Contributor
|
retest this please |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
ML-DSA: check pointer to the y parameter has not be faulted.
ML-KEM: to harden against faultiong, use a different buffer for private seed, sigma, and add a check that the buffer was copied correctly.
SHA-3: fix size of check variables.
Fixes zd#21108
Testing
./configure --disable-shared --enable-mlkem --enable-mldsa --enable-faultharden
Checklist