Trait askar_crypto::encrypt::KeyAeadInPlace[][src]

pub trait KeyAeadInPlace {
    fn encrypt_in_place(
        &self,
        buffer: &mut dyn ResizeBuffer,
        nonce: &[u8],
        aad: &[u8]
    ) -> Result<usize, Error>;
fn decrypt_in_place(
        &self,
        buffer: &mut dyn ResizeBuffer,
        nonce: &[u8],
        aad: &[u8]
    ) -> Result<(), Error>;
fn aead_params(&self) -> KeyAeadParams; }
Expand description

Trait for key types which perform AEAD encryption

Required methods

fn encrypt_in_place(
    &self,
    buffer: &mut dyn ResizeBuffer,
    nonce: &[u8],
    aad: &[u8]
) -> Result<usize, Error>
[src]

Expand description

Encrypt a secret value in place, appending the verification tag and returning the length of the ciphertext

fn decrypt_in_place(
    &self,
    buffer: &mut dyn ResizeBuffer,
    nonce: &[u8],
    aad: &[u8]
) -> Result<(), Error>
[src]

Expand description

Decrypt an encrypted (verification tag appended) value in place

fn aead_params(&self) -> KeyAeadParams[src]

Expand description

Get the nonce and tag length for encryption

Loading content...

Implementors

impl KeyAeadInPlace for AnyKey[src]

fn encrypt_in_place(
    &self,
    buffer: &mut dyn ResizeBuffer,
    nonce: &[u8],
    aad: &[u8]
) -> Result<usize, Error>
[src]

fn decrypt_in_place(
    &self,
    buffer: &mut dyn ResizeBuffer,
    nonce: &[u8],
    aad: &[u8]
) -> Result<(), Error>
[src]

fn aead_params(&self) -> KeyAeadParams[src]

impl<T: AesAead> KeyAeadInPlace for AesKey<T>[src]

This is supported on crate feature aes only.

fn encrypt_in_place(
    &self,
    buffer: &mut dyn ResizeBuffer,
    nonce: &[u8],
    aad: &[u8]
) -> Result<usize, Error>
[src]

Encrypt a secret value in place, appending the verification tag

fn decrypt_in_place(
    &self,
    buffer: &mut dyn ResizeBuffer,
    nonce: &[u8],
    aad: &[u8]
) -> Result<(), Error>
[src]

Decrypt an encrypted (verification tag appended) value in place

fn aead_params(&self) -> KeyAeadParams[src]

impl<T: Chacha20Type> KeyAeadInPlace for Chacha20Key<T>[src]

This is supported on crate feature chacha only.

fn encrypt_in_place(
    &self,
    buffer: &mut dyn ResizeBuffer,
    nonce: &[u8],
    aad: &[u8]
) -> Result<usize, Error>
[src]

Encrypt a secret value in place, appending the verification tag

fn decrypt_in_place(
    &self,
    buffer: &mut dyn ResizeBuffer,
    nonce: &[u8],
    aad: &[u8]
) -> Result<(), Error>
[src]

Decrypt an encrypted (verification tag appended) value in place

fn aead_params(&self) -> KeyAeadParams[src]

Loading content...