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

Function decrypt_checkpoint

nodedb-vector/src/collection/checkpoint.rs:56–65  ·  view source on GitHub ↗

Decrypt an encrypted checkpoint blob (starting at byte 0, which is `SEGV`).

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

Source from the content-addressed store, hash-verified

54
55/// Decrypt an encrypted checkpoint blob (starting at byte 0, which is `SEGV`).
56fn decrypt_checkpoint(
57 key: &nodedb_wal::crypto::WalEncryptionKey,
58 blob: &[u8],
59) -> Result<Vec<u8>, VectorError> {
60 nodedb_wal::crypto::decrypt_segment_envelope(key, &SEGV_MAGIC, blob).map_err(|e| {
61 VectorError::CheckpointEncryptionError {
62 detail: e.to_string(),
63 }
64 })
65}
66
67#[derive(Serialize, Deserialize, zerompk::ToMessagePack, zerompk::FromMessagePack)]
68pub(crate) struct CollectionSnapshot {

Callers 1

from_checkpointMethod · 0.85

Calls 2

decrypt_segment_envelopeFunction · 0.85
to_stringMethod · 0.80

Tested by

no test coverage detected