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

Function decrypt_file

nodedb/src/engine/timeseries/columnar_segment/encrypt.rs:25–28  ·  view source on GitHub ↗

Decrypt an encrypted columnar segment file blob (first bytes = `SEGT`).

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

Source from the content-addressed store, hash-verified

23
24/// Decrypt an encrypted columnar segment file blob (first bytes = `SEGT`).
25pub fn decrypt_file(key: &WalEncryptionKey, blob: &[u8]) -> Result<Vec<u8>, SegmentError> {
26 decrypt_segment_envelope(key, &SEGT_MAGIC, blob)
27 .map_err(|e| SegmentError::DecryptionFailed(e.to_string()))
28}
29
30/// Sniff the first 4 bytes of a file to detect whether it is encrypted.
31///

Callers 2

read_column_from_bytesFunction · 0.85
decrypt_segment_fileFunction · 0.85

Calls 2

decrypt_segment_envelopeFunction · 0.85
to_stringMethod · 0.80

Tested by

no test coverage detected