[][src]Trait tink_core::StreamingAead

pub trait StreamingAead: StreamingAeadBoxClone {
    fn new_encrypting_writer(
        &self,
        w: Box<dyn Write>,
        aad: &[u8]
    ) -> Result<Box<dyn EncryptingWrite>, TinkError>;
fn new_decrypting_reader(
        &self,
        r: Box<dyn Read>,
        aad: &[u8]
    ) -> Result<Box<dyn Read>, TinkError>; }

StreamingAead is an interface for streaming authenticated encryption with associated data.

Streaming encryption is typically used for encrypting large plaintexts such as large files. Tink may eventually contain multiple interfaces for streaming encryption depending on the supported properties. This interface supports a streaming interface for symmetric encryption with authentication. The underlying encryption modes are selected so that partial plaintext can be obtained fast by decrypting and authenticating just a part of the ciphertext.

Instances of StreamingAead must follow the OAE2 definition as proposed in the paper "Online Authenticated-Encryption and its Nonce-Reuse Misuse-Resistance" by Hoang, Reyhanitabar, Rogaway and Vizár

Required methods

fn new_encrypting_writer(
    &self,
    w: Box<dyn Write>,
    aad: &[u8]
) -> Result<Box<dyn EncryptingWrite>, TinkError>

Return a wrapper around an underlying std::io::Write, such that any write-operation via the wrapper results in AEAD-encryption of the written data, using aad as associated authenticated data. The associated data is not included in the ciphertext and has to be passed in as parameter for decryption.

fn new_decrypting_reader(
    &self,
    r: Box<dyn Read>,
    aad: &[u8]
) -> Result<Box<dyn Read>, TinkError>

Return a wrapper around an underlying std::io::Read, such that any read-operation via the wrapper results in AEAD-decryption of the underlying ciphertext, using aad as associated authenticated data.

Loading content...

Implementors

Loading content...