Decrypt a payload. Input is ciphertext + auth_tag (16 bytes at end). - `epoch`: must be the epoch that was used during encryption, read from the on-disk segment preamble — **not** `self.epoch`, which reflects the current in-memory lifetime and may differ after a restart. - `lsn`: must match the LSN used during encryption - `header_bytes`: must match the header used during encryption (AAD) - `ciph
(
&self,
epoch: &[u8; 4],
lsn: u64,
header_bytes: &[u8; HEADER_SIZE],
ciphertext: &[u8],
)
| 215 | /// - `header_bytes`: must match the header used during encryption (AAD) |
| 216 | /// - `ciphertext`: the encrypted payload (includes 16-byte auth tag) |
| 217 | pub fn decrypt( |
| 218 | &self, |
| 219 | epoch: &[u8; 4], |
| 220 | lsn: u64, |
| 221 | header_bytes: &[u8; HEADER_SIZE], |
| 222 | ciphertext: &[u8], |
| 223 | ) -> Result<Vec<u8>> { |
| 224 | self.decrypt_aad(epoch, lsn, header_bytes, ciphertext) |
| 225 | } |
| 226 | |
| 227 | /// Decrypt with a caller-provided AAD slice. |
| 228 | pub fn decrypt_aad( |