[][src]Trait crypto_api::cipher::AeadCipher

pub trait AeadCipher: Cipher {
    fn seal(
        &self,
        buf: &mut [u8],
        plaintext_len: usize,
        ad: &[u8],
        key: &[u8],
        nonce: &[u8]
    ) -> Result<usize, Box<dyn Error + 'static>>;
fn seal_to(
        &self,
        buf: &mut [u8],
        plaintext: &[u8],
        ad: &[u8],
        key: &[u8],
        nonce: &[u8]
    ) -> Result<usize, Box<dyn Error + 'static>>;
fn open(
        &self,
        buf: &mut [u8],
        ciphertext_len: usize,
        ad: &[u8],
        key: &[u8],
        nonce: &[u8]
    ) -> Result<usize, Box<dyn Error + 'static>>;
fn open_to(
        &self,
        buf: &mut [u8],
        ciphertext: &[u8],
        ad: &[u8],
        key: &[u8],
        nonce: &[u8]
    ) -> Result<usize, Box<dyn Error + 'static>>; }

An AEAD extension for Cipher

Required methods

fn seal(
    &self,
    buf: &mut [u8],
    plaintext_len: usize,
    ad: &[u8],
    key: &[u8],
    nonce: &[u8]
) -> Result<usize, Box<dyn Error + 'static>>

AEAD-seals plaintext_len bytes in-place in buf together with ad using key and nonce and returns the ciphertext length

fn seal_to(
    &self,
    buf: &mut [u8],
    plaintext: &[u8],
    ad: &[u8],
    key: &[u8],
    nonce: &[u8]
) -> Result<usize, Box<dyn Error + 'static>>

AEAD-seals plaintext into buf together with ad using key and nonce and returns the ciphertext length

fn open(
    &self,
    buf: &mut [u8],
    ciphertext_len: usize,
    ad: &[u8],
    key: &[u8],
    nonce: &[u8]
) -> Result<usize, Box<dyn Error + 'static>>

AEAD-opens ciphertext_len bytes in-place in buf together with ad using key and nonce and returns the plaintext length

fn open_to(
    &self,
    buf: &mut [u8],
    ciphertext: &[u8],
    ad: &[u8],
    key: &[u8],
    nonce: &[u8]
) -> Result<usize, Box<dyn Error + 'static>>

AEAD-opens ciphertext into buf together with ad using key and nonce and returns the plaintext length

Loading content...

Implementors

Loading content...