Trait rustls::quic::Algorithm

source ·
pub trait Algorithm: Send + Sync {
    // Required methods
    fn packet_key(&self, key: AeadKey, iv: Iv) -> Box<dyn PacketKey>;
    fn header_protection_key(
        &self,
        key: AeadKey,
    ) -> Box<dyn HeaderProtectionKey>;
    fn aead_key_len(&self) -> usize;

    // Provided method
    fn fips(&self) -> bool { ... }
}
Expand description

How a Tls13CipherSuite generates PacketKeys and HeaderProtectionKeys.

Required Methods§

source

fn packet_key(&self, key: AeadKey, iv: Iv) -> Box<dyn PacketKey>

Produce a PacketKey encrypter/decrypter for this suite.

suite is the entire suite this Algorithm appeared in. key and iv is the key material to use.

source

fn header_protection_key(&self, key: AeadKey) -> Box<dyn HeaderProtectionKey>

Produce a HeaderProtectionKey encrypter/decrypter for this suite.

key is the key material, which is aead_key_len() bytes in length.

source

fn aead_key_len(&self) -> usize

The length in bytes of keys for this Algorithm.

This controls the size of AeadKeys presented to packet_key() and header_protection_key().

Provided Methods§

source

fn fips(&self) -> bool

Whether this algorithm is FIPS-approved.

Implementors§