Skip to content

Add dynamic key allocation support for ML-KEM#10179

Open
Frauschi wants to merge 1 commit intowolfSSL:masterfrom
Frauschi:mlkem-alloc-key
Open

Add dynamic key allocation support for ML-KEM#10179
Frauschi wants to merge 1 commit intowolfSSL:masterfrom
Frauschi:mlkem-alloc-key

Conversation

@Frauschi
Copy link
Copy Markdown
Contributor

@Frauschi Frauschi commented Apr 9, 2026

Introduce the WOLFSSL_MLKEM_DYNAMIC_KEYS option to allow dynamic allocation of private and public key buffers in the MlKemKey struct. This change enables right-sizing of buffers based on the actual ML-KEM level and eliminates unnecessary memory usage for encapsulate-only operations.

This greatly reduces the dynamic memory usage during TLS handshakes, which is especially important for resource-constrained systems.

@Frauschi Frauschi self-assigned this Apr 9, 2026
@Frauschi
Copy link
Copy Markdown
Contributor Author

Jenkins retest this please

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #10179

Scan targets checked: wolfcrypt-api_misuse, wolfcrypt-bugs, wolfcrypt-compliance, wolfcrypt-concurrency, wolfcrypt-consttime, wolfcrypt-defaults, wolfcrypt-mutation, wolfcrypt-portability, wolfcrypt-proptest, wolfcrypt-src, wolfcrypt-zeroize

No new issues found in the changed files. ✅

Introduce the WOLFSSL_MLKEM_DYNAMIC_KEYS option to allow dynamic allocation
of private and public key buffers in the MlKemKey struct. This change
enables right-sizing of buffers based on the actual ML-KEM level and eliminates
unnecessary memory usage for encapsulate-only operations.
@Frauschi
Copy link
Copy Markdown
Contributor Author

Jenkins retest this please

@Frauschi Frauschi assigned wolfSSL-Bot and unassigned Frauschi Apr 10, 2026
@Frauschi Frauschi requested review from SparkiDev and dgarske April 10, 2026 19:00
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.

3 participants