Encrypt a payload. Returns ciphertext + auth_tag (16 bytes appended). - `lsn`: used to derive a deterministic nonce - `header_bytes`: used as AAD (additional authenticated data) - `plaintext`: the payload to encrypt
(
&self,
lsn: u64,
header_bytes: &[u8; HEADER_SIZE],
plaintext: &[u8],
)
| 176 | /// - `header_bytes`: used as AAD (additional authenticated data) |
| 177 | /// - `plaintext`: the payload to encrypt |
| 178 | pub fn encrypt( |
| 179 | &self, |
| 180 | lsn: u64, |
| 181 | header_bytes: &[u8; HEADER_SIZE], |
| 182 | plaintext: &[u8], |
| 183 | ) -> Result<Vec<u8>> { |
| 184 | self.encrypt_aad(lsn, header_bytes, plaintext) |
| 185 | } |
| 186 | |
| 187 | /// Encrypt with a caller-provided AAD slice (may be longer than HEADER_SIZE, |
| 188 | /// e.g. preamble bytes prepended to the header). |