Encrypt `plaintext` (a raw file body) and return the SEGT envelope.
(key: &WalEncryptionKey, plaintext: &[u8])
| 17 | |
| 18 | /// Encrypt `plaintext` (a raw file body) and return the SEGT envelope. |
| 19 | pub fn encrypt_file(key: &WalEncryptionKey, plaintext: &[u8]) -> Result<Vec<u8>, SegmentError> { |
| 20 | encrypt_segment_envelope(key, &SEGT_MAGIC, plaintext) |
| 21 | .map_err(|e| SegmentError::EncryptionFailed(e.to_string())) |
| 22 | } |
| 23 | |
| 24 | /// Decrypt an encrypted columnar segment file blob (first bytes = `SEGT`). |
| 25 | pub fn decrypt_file(key: &WalEncryptionKey, blob: &[u8]) -> Result<Vec<u8>, SegmentError> { |
no test coverage detected