Skip to content

Conversation

@Frauschi
Copy link
Contributor

@Frauschi Frauschi commented Jan 5, 2026

The size of the PreMasterSecret buffer is based on the ENCRYPT_LEN constant, which has been increased to 5kB for PQC support (Dilithium and Falcon, as their signatures are that large).

However, only in the TLS 1.2 case, the PreMasterSecret buffer is used to store signatures. In the TLS 1.3 path, only actual symmetric secrets are stored in that buffer, which are much smaller (the "old" size of the constant without the PQC increase).

As PQC is only allowed in TLS 1.3 and NOT in TLS 1.2, we can revert that size increase, saving around 4,5kB of dynamic memory during the handshake.

The size of the PreMasterSecret buffer is based on the ENCRYPT_LEN
constant, which has been increased to 5kB for PQC support (Dilithium and
Falcon, as their signatures are that large).

However, only in the TLS 1.2 case, the PreMasterSecret buffer is used to
store signatures. In the TLS 1.3 path, only actual symmetric secrets are
stored in that buffer, which are much smaller in size (the "old" size of
the constant without the PQC increase).

As PQC is only allowed in TLS 1.3 and NOT in TLS 1.2, we can revert
that size increase, saving around 4,5kB of dynamic memory during the
handshake.
@wolfSSL-Bot
Copy link

Can one of the admins verify this patch?

@dgarske
Copy link
Contributor

dgarske commented Jan 5, 2026

Okay to test

@dgarske
Copy link
Contributor

dgarske commented Jan 8, 2026

Jenkins retest this please.

1 similar comment
@dgarske
Copy link
Contributor

dgarske commented Jan 8, 2026

Jenkins retest this please.

@dgarske dgarske merged commit 4f1d578 into wolfSSL:master Jan 8, 2026
382 checks passed
@Frauschi Frauschi deleted the pre_master_secret_size branch January 9, 2026 08:10
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