Skip to content

Fix ML-DSA cache import buffer sizing - #397

Merged
bigbrett merged 2 commits into
wolfSSL:mainfrom
Frauschi:mldsa_fix
Jun 3, 2026
Merged

Fix ML-DSA cache import buffer sizing#397
bigbrett merged 2 commits into
wolfSSL:mainfrom
Frauschi:mldsa_fix

Conversation

@Frauschi

@Frauschi Frauschi commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

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.

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.
@Frauschi Frauschi assigned Frauschi and wolfSSL-Bot and unassigned Frauschi Jun 2, 2026
@Frauschi
Frauschi requested review from bigbrett and padelsbach June 2, 2026 09:21
Comment thread test/wh_test_crypto.c Outdated
Comment thread test/wh_test_crypto.c Outdated

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

Scan targets checked: wolfhsm-crypto-bugs, wolfhsm-src

No new issues found in the changed files. ✅

Comment thread test/wh_test_crypto.c Outdated
Comment thread examples/posix/wh_posix_server/wolfhsm_cfg.h
padelsbach
padelsbach previously approved these changes Jun 2, 2026

@padelsbach padelsbach 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.

LGTM, just some minor feedback

@padelsbach

Copy link
Copy Markdown
Contributor

Looks good to me, let's give @bigbrett a chance to review before merging

@bigbrett
bigbrett merged commit e57cd58 into wolfSSL:main Jun 3, 2026
108 checks passed
@Frauschi
Frauschi deleted the mldsa_fix branch June 3, 2026 14:59
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