Skip to content

Encrypt private ledger data directly into serialised entries - #8499

Draft
Amaury Chamayou (achamayou) with Copilot wants to merge 4 commits into
mainfrom
copilot/encrypt-private-ledger-data
Draft

Amaury Chamayou (achamayou) with Copilot wants to merge 4 commits into
mainfrom
copilot/encrypt-private-ledger-data

Conversation

Copilot AI commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Private-domain serialization allocated temporary GCM and ciphertext buffers, then copied them into the ledger entry. This change encrypts into the final entry while preserving its byte format and public-domain AAD.

  • Direct output: Add caller-owned output spans for AES-GCM, transaction encryption, and GCM header serialization. Keep vector APIs and support vector-only encryptor implementations.
  • Entry assembly: Reserve the complete layout once; write public bytes and encrypt private bytes at their final offsets. Failed encryption cannot return or replicate a partial entry.
  • Compatibility: Cover public-only, private-only, mixed, and empty-private entries, plus snapshots, historical secrets, replay, and AAD authentication.
  • Measurement: The nonempty-private path removes three temporary allocations and copies of 28 header bytes plus the ciphertext. Paired 64-byte AES-GCM medians improved from 945 to 935 ns/op with a fresh context and 312 to 305 ns/op with a reused context; KV timings were within noise. A full pi_basic A/B profile remains outstanding.

Closes #8169

Copilot AI and others added 3 commits October 2, 2026 20:42
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Copilot AI changed the title [WIP] Encrypt private ledger data directly into serialised entries Encrypt private ledger data directly into serialised entries Oct 2, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Encrypt private ledger data directly into serialised entries

2 participants