[−][src]Struct aes_siv::SivAead
The SivAead
type wraps the more powerful Siv
interface in a more
commonly used Authenticated Encryption with Associated Data (AEAD) API,
which accepts a key, nonce, and associated data when encrypting/decrypting.
Trait Implementations
impl<M> NewAead for SivAead<Ctr128<Aes128>, M> where
M: Mac<OutputSize = U16>,
[src]
M: Mac<OutputSize = U16>,
type KeySize = U32
The size of the key array required by this algorithm.
fn new(key: GenericArray<u8, Self::KeySize>) -> Self
[src]
impl<M> NewAead for SivAead<Ctr128<Aes256>, M> where
M: Mac<OutputSize = U16>,
[src]
M: Mac<OutputSize = U16>,
type KeySize = U64
The size of the key array required by this algorithm.
fn new(key: GenericArray<u8, Self::KeySize>) -> Self
[src]
impl<C, M> Aead for SivAead<C, M> where
C: NewStreamCipher<NonceSize = U16> + SyncStreamCipher,
M: Mac<OutputSize = U16>,
<C as NewStreamCipher>::KeySize: Add,
KeySize<C>: ArrayLength<u8>,
[src]
C: NewStreamCipher<NonceSize = U16> + SyncStreamCipher,
M: Mac<OutputSize = U16>,
<C as NewStreamCipher>::KeySize: Add,
KeySize<C>: ArrayLength<u8>,
type NonceSize = U16
The length of a nonce.
type TagSize = U16
The maximum length of the nonce.
type CiphertextOverhead = U0
The upper bound amount of additional space required to support a ciphertext vs. a plaintext. Read more
fn encrypt_in_place(
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
[src]
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
fn encrypt_in_place_detached(
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<GenericArray<u8, Self::TagSize>, Error>
[src]
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<GenericArray<u8, Self::TagSize>, Error>
fn decrypt_in_place(
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
[src]
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
fn decrypt_in_place_detached(
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &GenericArray<u8, Self::TagSize>
) -> Result<(), Error>
[src]
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &GenericArray<u8, Self::TagSize>
) -> Result<(), Error>
fn encrypt<'msg, 'aad>(
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
plaintext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
[src]
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
plaintext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
fn decrypt<'msg, 'aad>(
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
ciphertext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
[src]
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
ciphertext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
Auto Trait Implementations
impl<C, M> Unpin for SivAead<C, M> where
M: Unpin,
<<<C as NewStreamCipher>::KeySize as Add<<C as NewStreamCipher>::KeySize>>::Output as ArrayLength<u8>>::ArrayType: Unpin,
M: Unpin,
<<<C as NewStreamCipher>::KeySize as Add<<C as NewStreamCipher>::KeySize>>::Output as ArrayLength<u8>>::ArrayType: Unpin,
impl<C, M> Send for SivAead<C, M> where
M: Send,
M: Send,
impl<C, M> Sync for SivAead<C, M> where
M: Sync,
M: Sync,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<Algo> AeadMut for Algo where
Algo: Aead,
[src]
Algo: Aead,
type NonceSize = <Algo as Aead>::NonceSize
The length of a nonce.
type TagSize = <Algo as Aead>::TagSize
The maximum length of the nonce.
type CiphertextOverhead = <Algo as Aead>::CiphertextOverhead
The upper bound amount of additional space required to support a ciphertext vs. a plaintext. Read more
fn encrypt<'msg, 'aad>(
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
plaintext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
[src]
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
plaintext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
Encrypt the given plaintext slice, and return the resulting ciphertext as a vector of bytes.
fn encrypt_in_place(
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
[src]
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
Encrypt the given buffer containing a plaintext message in-place.
fn encrypt_in_place_detached(
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<GenericArray<u8, <Algo as AeadMut>::TagSize>, Error>
[src]
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<GenericArray<u8, <Algo as AeadMut>::TagSize>, Error>
Encrypt the data in-place, returning the authentication tag
fn decrypt<'msg, 'aad>(
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
ciphertext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
[src]
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
ciphertext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
Decrypt the given ciphertext slice, and return the resulting plaintext as a vector of bytes.
fn decrypt_in_place(
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
[src]
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
Decrypt the message in-place, returning an error in the event the provided authentication tag does not match the given ciphertext.
fn decrypt_in_place_detached(
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &GenericArray<u8, <Algo as AeadMut>::TagSize>
) -> Result<(), Error>
[src]
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &GenericArray<u8, <Algo as AeadMut>::TagSize>
) -> Result<(), Error>
Decrypt the data in-place, returning an error in the event the provided authentication tag does not match the given ciphertext (i.e. ciphertext is modified/unauthentic)
impl<T> Same<T> for T
type Output = T
Should always be Self