Encrypt `plaintext` into the SEGV envelope from [`nodedb_wal::crypto`].
(
key: &nodedb_wal::crypto::WalEncryptionKey,
plaintext: &[u8],
)
| 42 | |
| 43 | /// Encrypt `plaintext` into the SEGV envelope from [`nodedb_wal::crypto`]. |
| 44 | fn encrypt_checkpoint( |
| 45 | key: &nodedb_wal::crypto::WalEncryptionKey, |
| 46 | plaintext: &[u8], |
| 47 | ) -> Result<Vec<u8>, VectorError> { |
| 48 | nodedb_wal::crypto::encrypt_segment_envelope(key, &SEGV_MAGIC, plaintext).map_err(|e| { |
| 49 | VectorError::CheckpointEncryptionError { |
| 50 | detail: e.to_string(), |
| 51 | } |
| 52 | }) |
| 53 | } |
| 54 | |
| 55 | /// Decrypt an encrypted checkpoint blob (starting at byte 0, which is `SEGV`). |
| 56 | fn decrypt_checkpoint( |
no test coverage detected