Skip to content

chore: backport #20926 (remove epk sign from message payload) to v4#20960

Closed
AztecBot wants to merge 1 commit intov4from
claudebox/3ef65970c36e1f08-1
Closed

chore: backport #20926 (remove epk sign from message payload) to v4#20960
AztecBot wants to merge 1 commit intov4from
claudebox/3ef65970c36e1f08-1

Conversation

@AztecBot
Copy link
Collaborator

Backport of #20926 to v4.

This removes the ephemeral public key sign byte from the encrypted message payload. Instead, the sender now generates ephemeral key pairs with guaranteed positive y-coordinates, so the sign byte is no longer needed. This frees up one byte of capacity and reduces information leakage in the logs.

The automatic cherry-pick failed due to conflicts in encoding.nr and aes128.nr, caused by differences between next and v4 (different MESSAGE_CIPHERTEXT_LEN values and the absence of AES128_PKCS7_EXPANSION_IN_BYTES on v4). Conflicts were resolved by adapting the changes to v4's constants while preserving the intent of the original PR.

Changes:

  • Added generate_positive_ephemeral_key_pair() to ephemeral.nr
  • Removed EPH_PK_SIGN_BYTE_SIZE_IN_BYTES constant and its usage from encoding.nr
  • Updated aes128.nr to use positive ephemeral keys and remove sign byte from wire format
  • Updated arithmetic generics utils to remove the + 1 for the sign byte

ClaudeBox log

This frees up one byte of capacity, but more importantly it reduces the
leakage in the logs as they'll no longer contain a byte that is either 0
or 1.
@AztecBot AztecBot added the claudebox Owned by claudebox. it can push to this PR. label Feb 27, 2026
@AztecBot AztecBot closed this Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants