Fix ML-DSA cache import buffer sizing - #397
Merged
Merged
Conversation
The server ML-DSA cache-import buffer was sized with the private-key DER macro instead of the full-keypair macro (MLDSA_MAX_BOTH_KEY_DER_SIZE), so caching a generated keypair failed at ML-DSA-65/87. CI missed it because the ML-DSA tests only ran ML-DSA-44; the existing tests are now parameterized to run across all enabled levels (44/65/87). Also bump the POSIX example server's big key-cache buffer to hold the largest ML-DSA-87 keypair DER (7520 bytes), matching the other server configs, so the client-only example flow can cache keys at every level.
padelsbach
reviewed
Jun 2, 2026
padelsbach
reviewed
Jun 2, 2026
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #397
Scan targets checked: wolfhsm-crypto-bugs, wolfhsm-src
No new issues found in the changed files. ✅
padelsbach
reviewed
Jun 2, 2026
padelsbach
reviewed
Jun 2, 2026
padelsbach
previously approved these changes
Jun 2, 2026
padelsbach
left a comment
Contributor
There was a problem hiding this comment.
LGTM, just some minor feedback
padelsbach
approved these changes
Jun 3, 2026
Contributor
|
Looks good to me, let's give @bigbrett a chance to review before merging |
bigbrett
approved these changes
Jun 3, 2026
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.
The server ML-DSA cache-import buffer was sized with the private-key DER macro instead of the full-keypair macro (
MLDSA_MAX_BOTH_KEY_DER_SIZE), so caching a generated keypair failed at ML-DSA-65/87. CI missed it because the ML-DSA tests only ran ML-DSA-44; the existing tests are now parameterized to run across all enabled levels (44/65/87).Also bump the POSIX example server's big key-cache buffer to hold the largest ML-DSA-87 keypair DER (7520 bytes), matching the other server configs, so the client-only example flow can cache keys at every level.