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

Function encrypt_payload

nodedb-spatial/src/persist.rs:50–56  ·  view source on GitHub ↗
(
    key: &nodedb_wal::crypto::WalEncryptionKey,
    plaintext: &[u8],
)

Source from the content-addressed store, hash-verified

48// ── SEGV framing helpers ───────────────────────────────────────────────────
49
50fn encrypt_payload(
51 key: &nodedb_wal::crypto::WalEncryptionKey,
52 plaintext: &[u8],
53) -> Result<Vec<u8>, RTreeCheckpointError> {
54 nodedb_wal::crypto::encrypt_segment_envelope(key, &SEGV_MAGIC, plaintext)
55 .map_err(|e| RTreeCheckpointError::EncryptionFailed(e.to_string()))
56}
57
58fn decrypt_payload(
59 key: &nodedb_wal::crypto::WalEncryptionKey,

Callers 2

encrypt_geohash_payloadFunction · 0.85
checkpoint_to_bytesMethod · 0.85

Calls 2

encrypt_segment_envelopeFunction · 0.85
to_stringMethod · 0.80

Tested by

no test coverage detected