Trait aws_nitro_enclaves_cose::crypto::Encryption

source ·
pub trait Encryption {
    // Required method
    fn encrypt_aead(
        algo: EncryptionAlgorithm,
        key: &[u8],
        iv: Option<&[u8]>,
        aad: &[u8],
        data: &[u8],
        tag: &mut [u8]
    ) -> Result<Vec<u8>, CoseError>;
}
Expand description

A trait exposing various aead encryption algorithms.

Required Methods§

source

fn encrypt_aead( algo: EncryptionAlgorithm, key: &[u8], iv: Option<&[u8]>, aad: &[u8], data: &[u8], tag: &mut [u8] ) -> Result<Vec<u8>, CoseError>

Encryption for AEAD ciphers such as AES GCM.

Additional Authenticated Data (AEAD) can be provided in the aad field, and the authentication tag will be copied into the tag field.

The size of the tag buffer indicates the required size of the tag. While some ciphers support a range of tag sizes, it is recommended to pick the maximum size. For AES GCM, this is 16 bytes, for example.

Object Safety§

This trait is not object safe.

Implementors§