We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 74c6769 commit 6c40df1Copy full SHA for 6c40df1
aead/src/lib.rs
@@ -232,6 +232,17 @@ pub trait Aead: AeadCore {
232
Ok(out)
233
}
234
235
+ /// Encrypt with a random nonce generated by the specified RNG, explicitly
236
+ /// prepended to the message.
237
+ fn encrypt_with_nonce_from_rng<'msg, 'aad, R: CryptoRng + ?Sized>(
238
+ &self,
239
+ rng: &mut R,
240
+ plaintext: impl Into<Payload<'msg, 'aad>>,
241
+ ) -> Result<Vec<u8>> {
242
+ let nonce = Self::generate_nonce_with_rng(rng);
243
+ self.encrypt_with_explicit_nonce(&nonce, plaintext)
244
+ }
245
+
246
/// Decrypt an AEAD message which has an explicit nonce prepended to the
247
/// AEAD message.
248
fn decrypt_with_explicit_nonce<'msg, 'aad>(
0 commit comments