Skip to content

Add AES-GCM segment ciphers, key config, and CipherResolver - #12786

Open
robert3005 wants to merge 2 commits into
rk/encryption-01-footer-schemafrom
rk/encryption-02-ciphers-and-config
Open

robert3005 wants to merge 2 commits into
rk/encryption-01-footer-schemafrom
rk/encryption-02-ciphers-and-config

Conversation

@robert3005

Copy link
Copy Markdown
Contributor

Introduce EncryptionKey, KeyConfig, KeyRetriever, FileEncryption, FileDecryption, EncryptionSpec, AES-GCM segment encryption/decryption with per-file/per-segment AAD, and the deduplicating CipherResolver.

Split from #10968.

Developed with AI assistance.

Signed-off-by: Robert Kruszewski <github@robertk.io>
@vortex-roborev-bot

vortex-roborev-bot Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

roborev: Combined Review (55c0364)

Verdict: No issues found.


Reviewers: codex | Synthesis: codex, 0s | Total: 1m13s

@vortex-roborev-bot vortex-roborev-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Line comments for the roborev review of 209fdde. The roborev PR comment has the full review.

Comment thread vortex-file/src/encryption/mod.rs Outdated
Comment on lines +68 to +70
let mut key = vec![0u8; len];
fill_random(&mut key)?;
let result = Self::try_from_slice(&key);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium: EncryptionKey::generate can panic instead of returning an invalid-length error.

EncryptionKey::generate(usize::MAX)

Length validation happens after allocation and random filling, so this input causes capacity overflow; other large unsupported lengths waste memory and randomness before rejection.

Fix: Validate len against KEY_LENGTHS before allocating or requesting randomness, rejecting unsupported lengths while preserving generation for 16, 24, and 32 bytes.

Signed-off-by: Robert Kruszewski <github@robertk.io>
@codspeed

codspeed Bot commented Dec 5, 2026

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚡ 17 improved benchmarks
❌ 1 regressed benchmark
✅ 1832 untouched benchmarks
🆕 15 new benchmarks
⏩ 479 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ compare[1] 50.7 µs 58 µs -12.58%
⚡ many_indices[(4096, 0.1)] 36.9 µs 29.1 µs +26.77%
⚡ many_indices[(4096, 0.9)] 37 µs 29.2 µs +26.72%
⚡ many_indices[(16384, 0.1)] 38 µs 30.1 µs +26.48%
⚡ many_indices[(16384, 0.9)] 38.1 µs 30.1 µs +26.43%
⚡ append_to_varbin_builder[view/dict/nullable] 4.2 ms 3.4 ms +23.13%
⚡ string_export[offset/view/dict/nullable] 4.2 ms 3.4 ms +23.02%
⚡ append_to_varbin_builder[offset/dict/nullable] 4.3 ms 3.5 ms +22.4%
⚡ string_export[offset/offset/dict/nullable] 4.3 ms 3.5 ms +22.3%
⚡ append_to_varbin_builder[onpair/dict/nullable] 4.4 ms 3.6 ms +21.88%
⚡ string_export[offset/onpair/dict/nullable] 4.4 ms 3.6 ms +21.78%
⚡ append_to_varbin_builder[fsst/dict/nullable] 4.4 ms 3.7 ms +21.42%
⚡ string_export[offset/fsst/dict/nullable] 4.5 ms 3.7 ms +21.31%
⚡ append_to_varbin_builder[zstd/dict/nullable] 4.8 ms 4 ms +19.41%
⚡ string_export[offset/zstd/dict/nullable] 4.8 ms 4.1 ms +19.36%
⚡ fsl_sum_bool[8] 231.5 µs 206.2 µs +12.3%
⚡ full_projection_compressed_offsets 174.7 µs 155.8 µs +12.1%
⚡ listview_sum_bool[8] 265.9 µs 239.3 µs +11.14%
🆕 customer_order_lines_sparse_ties N/A 2.4 ms N/A
🆕 customer_order_string_keys N/A 10.4 ms N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing rk/encryption-02-ciphers-and-config (55c0364) with rk/encryption-01-footer-schema (4f40991)

Open in CodSpeed

Footnotes

  1. 479 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

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

changelog/feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant