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

Function decrypt_segment

nodedb-columnar/src/encrypt.rs:35–41  ·  view source on GitHub ↗

Decrypt an encrypted columnar segment blob (starting at byte 0 = `SEGC`). Returns the inner plaintext segment bytes (starting with `NDBS`).

(
    key: &WalEncryptionKey,
    blob: &[u8],
)

Source from the content-addressed store, hash-verified

33///
34/// Returns the inner plaintext segment bytes (starting with `NDBS`).
35pub(crate) fn decrypt_segment(
36 key: &WalEncryptionKey,
37 blob: &[u8],
38) -> Result<Vec<u8>, ColumnarError> {
39 decrypt_segment_envelope(key, &SEGC_MAGIC, blob)
40 .map_err(|e| ColumnarError::DecryptionFailed(e.to_string()))
41}

Callers 1

open_with_kekMethod · 0.50

Calls 2

decrypt_segment_envelopeFunction · 0.85
to_stringMethod · 0.80

Tested by

no test coverage detected