logo

Struct aes_siv::siv::Siv

source · []
pub struct Siv<C, M> where
    C: BlockCipher<BlockSize = U16> + BlockEncryptMut + KeyInit + KeySizeUser,
    M: Mac<OutputSize = U16>, 
{ /* private fields */ }
Expand description

Synthetic Initialization Vector (SIV) mode, providing misuse-resistant authenticated encryption (MRAE).

Implementations

Encrypt the given plaintext, allocating and returning a Vec<u8> for the ciphertext.

Errors

Returns Error if plaintext.len() is less than M::OutputSize. Returns Error if headers.len() is greater than MAX_HEADERS.

Encrypt the given buffer containing a plaintext message in-place.

Errors

Returns Error if plaintext.len() is less than M::OutputSize. Returns Error if headers.len() is greater than MAX_HEADERS.

Encrypt the given plaintext in-place, returning the SIV tag on success.

Errors

Returns Error if plaintext.len() is less than M::OutputSize. Returns Error if headers.len() is greater than MAX_HEADERS.

Decrypt the given ciphertext, allocating and returning a Vec for the plaintext

Decrypt the message in-place, returning an error in the event the provided authentication tag does not match the given ciphertext.

The buffer will be truncated to the length of the original plaintext message upon success.

Decrypt the given ciphertext in-place, authenticating it against the provided SIV tag.

Errors

Returns Error if the ciphertext is not authentic

Trait Implementations

Executes the destructor for this type. Read more

Create a new AES-SIV instance

Create new value from variable size key.

Generate random key using the provided CryptoRng.

Key size in bytes.

Return key size in bytes.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.