Decrypt an encrypted array segment blob (starting at byte 0 = `SEGA`). Returns the inner plaintext segment bytes (starting with `NDAS`).
(key: &WalEncryptionKey, blob: &[u8])
| 39 | /// |
| 40 | /// Returns the inner plaintext segment bytes (starting with `NDAS`). |
| 41 | pub(crate) fn decrypt_segment(key: &WalEncryptionKey, blob: &[u8]) -> Result<Vec<u8>, ArrayError> { |
| 42 | decrypt_segment_envelope(key, &SEGA_MAGIC, blob).map_err(|e| ArrayError::DecryptionFailed { |
| 43 | detail: e.to_string(), |
| 44 | }) |
| 45 | } |
| 46 | |
| 47 | /// Sniff the first 4 bytes to determine if `blob` is a plaintext (`NDAS`) |
| 48 | /// or encrypted (`SEGA`) segment. Returns `true` if encrypted. |