pub type DryocAeadEnvelope<Nonce, Mac, Data> = AeadEnvelope<XChaCha20Poly1305Ietf, Nonce, Mac, Data>;Expand description
XChaCha20-Poly1305-IETF AEAD envelope with stored nonce.
Aliased Type§
pub struct DryocAeadEnvelope<Nonce, Mac, Data> { /* private fields */ }Implementations§
Source§impl DryocAeadEnvelope<Nonce, Mac, Vec<u8>>
impl DryocAeadEnvelope<Nonce, Mac, Vec<u8>>
Sourcepub fn seal_to_vec<Message: Bytes + ?Sized, SecretKey: ByteArray<CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES>>(
message: &Message,
associated_data: Option<&[u8]>,
key: &SecretKey,
) -> Result<Self, Error>
pub fn seal_to_vec<Message: Bytes + ?Sized, SecretKey: ByteArray<CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES>>( message: &Message, associated_data: Option<&[u8]>, key: &SecretKey, ) -> Result<Self, Error>
Encrypts a message with a generated nonce and returns a VecEnvelope.
§Errors
Returns an error if the message exceeds the construction’s maximum length.
§Panics
Panics if the operating system’s random number generator fails.