Skip to content

Support provider-defined authenticated page body lengths - #1028

Merged
HTHou merged 1 commit into
codex/tsfile-tde-page-aeadfrom
codex/page-ciphertext-lengths
Oct 20, 2026
Merged

HTHou merged 1 commit into
codex/tsfile-tde-page-aeadfrom
codex/page-ciphertext-lengths

Conversation

@HTHou

@HTHou HTHou commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Stacked on #866, targeting codex/tsfile-tde-page-aead rather than develop.

  • Add provider-defined encoded-size calculation and bounded, read-only candidate plaintext-length parsing.
  • Preserve fixed-overhead defaults for existing GCM providers and the existing size-only context overload.
  • Route direct, chunk, and lazy page readers through the encoded-body overload before rebuilding AAD.
  • Treat parsed lengths as untrusted framing until page authentication succeeds, and validate encoded-size consistency.
  • No file-version, encryption-header-version, AAD-version, or existing GCM encoding changes; no CBC algorithm implementation in TsFile.

Validation

39 focused tests passed across PageCryptoContextTest, PageBodyEncoderTest, FileEncryptionHeaderTest, PageAeadReaderLifecycleTest, and EncryptionProviderRegistryTest.
Coverage includes variable-length padded framing, direct/sliced buffers, framing tampering, compression, aligned/non-aligned queries, and existing fixed-expansion lifecycle behavior.

Motivation

Allows external providers to support padded authenticated encodings such as CBC plus HMAC without making storage code infer plaintext length by subtracting a fixed overhead.

@HTHou
HTHou requested a balanced review from Copilot October 20, 2026 02:51

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@HTHou
HTHou merged commit f8313ba into codex/tsfile-tde-page-aead Oct 20, 2026
@HTHou
HTHou deleted the codex/page-ciphertext-lengths branch October 20, 2026 06:43
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.

2 participants