MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / decrypt

Method decrypt

nodedb-wal/src/crypto.rs:217–225  ·  view source on GitHub ↗

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],
    )

Source from the content-addressed store, hash-verified

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(

Callers 6

decrypt_aadMethod · 0.80
empty_payloadFunction · 0.80
aes_decryptFunction · 0.80
decrypt_dekMethod · 0.80
unwrap_keyMethod · 0.80

Calls 1

decrypt_aadMethod · 0.80

Tested by 2

empty_payloadFunction · 0.64