pub trait Aead: AeadBoxClone {
    fn encrypt(
        &self,
        plaintext: &[u8],
        additional_data: &[u8]
    ) -> Result<Vec<u8>, TinkError>;
fn decrypt(
        &self,
        ciphertext: &[u8],
        additional_data: &[u8]
    ) -> Result<Vec<u8>, TinkError>; }
Expand description

Aead is the interface for authenticated encryption with additional authenticated data.

Implementations of this trait are secure against adaptive chosen ciphertext attacks. Encryption with additional data ensures authenticity and integrity of that data, but not its secrecy (see RFC 5116).

Required methods

Encrypt plaintext with additional_data as additional authenticated data. The resulting ciphertext allows for checking authenticity and integrity of additional data additional_data, but there are no guarantees wrt. secrecy of that data.

Decrypt ciphertext with additional_data as additional authenticated data. The decryption verifies the authenticity and integrity of the additional data, but there are no guarantees wrt. secrecy of that data.

Implementors