Skip to main content

AeadAlgorithm

Trait AeadAlgorithm 

Source
pub trait AeadAlgorithm:
    Sized
    + PartialEq
    + Eq
    + Debug
    + Clone {
    // Required methods
    fn key_length(&self) -> usize;
    fn tag_length(&self) -> usize;
    fn nonce_length(&self) -> usize;

    // Provided method
    fn from_cose_number(number: impl Into<i128>) -> Option<Self> { ... }
}
Expand description

An AEAD algorithm identifier.

Required Methods§

Source

fn key_length(&self) -> usize

Length of a key in bytes.

Source

fn tag_length(&self) -> usize

Length of the cryptographic tag in bytes.

Source

fn nonce_length(&self) -> usize

Length of the nonce (called IV in some algorithms) in bytes.

Provided Methods§

Source

fn from_cose_number(number: impl Into<i128>) -> Option<Self>

Selects an AEAD algorithm from its COSE number.

The algorithm number comes from the “COSE Algorithms” registry maintained by IANA.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§