pub struct SseChunkBinding {
pub enc_chunk_size: u32,
pub enc_chunk_count: u32,
pub enc_key_id: u16,
pub enc_salt: [u8; 8],
pub enc_plaintext_len: u64,
pub enc_header_bytes: u32,
}Expand description
v0.9 #106: per-object SSE-S4 chunked (S4E6) geometry, stored in v3 sidecars. The salt + key_id let the GET path derive the per-chunk AES-GCM nonce + AAD without re-fetching the encrypted body’s header bytes. Salt is not secret (it lives in the on-disk S4E6 header in plaintext anyway); duplicating it here saves one HEAD/GET round-trip per Range request.
Fields§
§enc_chunk_size: u32S4E6 plaintext bytes per chunk (matches --sse-chunk-size).
Must be > 0 for an SSE binding to be considered valid.
enc_chunk_count: u32Total number of S4E6 chunks in the body (= ceil(plaintext.len() / enc_chunk_size), always >= 1).
enc_key_id: u16Keyring slot the active key was at PUT time. The GET path uses it to look up the same key for decrypt.
enc_salt: [u8; 8]8-byte per-PUT random salt (S4E6). Fed into the nonce + AAD derivation; lives in the encrypted body’s header in plaintext anyway, so duplicating it in the sidecar leaks nothing.
enc_plaintext_len: u64Pre-encrypt plaintext body length (= post-compress, post-frame body length). Used to validate the chunk-walk math against the encrypted body length the backend reports.
enc_header_bytes: u32Fixed header size of the S4E6 frame (== S4E6_HEADER_BYTES =
24 today). Carried explicitly so a future S4E7-style bump
doesn’t silently break v3 sidecar decode.
Implementations§
Source§impl SseChunkBinding
impl SseChunkBinding
Sourcepub fn enc_chunk_stride(&self) -> u64
pub fn enc_chunk_stride(&self) -> u64
Per-chunk on-disk byte cost: ciphertext (= plaintext bytes, AES-GCM is CTR-mode) + 16-byte auth tag. Final chunk may carry fewer plaintext bytes; this helper returns the non-final chunk cost.
Sourcepub fn enc_chunk_on_disk_size(&self, chunk_idx: u32) -> u64
pub fn enc_chunk_on_disk_size(&self, chunk_idx: u32) -> u64
On-disk byte length of chunk chunk_idx. Non-final chunks
carry enc_chunk_size plaintext bytes (+ 16-byte tag); the
final chunk carries enc_plaintext_len - (chunk_count - 1) * enc_chunk_size plaintext bytes (+ tag).
Sourcepub fn enc_chunk_byte_offset(&self, chunk_idx: u32) -> u64
pub fn enc_chunk_byte_offset(&self, chunk_idx: u32) -> u64
Encrypted-body byte offset of the start of chunk chunk_idx
(= the chunk’s tag byte). Non-final chunks stride at
enc_chunk_stride().
Trait Implementations§
Source§impl Clone for SseChunkBinding
impl Clone for SseChunkBinding
Source§fn clone(&self) -> SseChunkBinding
fn clone(&self) -> SseChunkBinding
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SseChunkBinding
Source§impl Debug for SseChunkBinding
impl Debug for SseChunkBinding
impl Eq for SseChunkBinding
Source§impl PartialEq for SseChunkBinding
impl PartialEq for SseChunkBinding
Source§fn eq(&self, other: &SseChunkBinding) -> bool
fn eq(&self, other: &SseChunkBinding) -> bool
self and other values to be equal, and is used by ==.