Struct rustls::crypto::CipherSuiteCommon

source ·
pub struct CipherSuiteCommon {
    pub suite: CipherSuite,
    pub hash_provider: &'static dyn Hash,
    pub confidentiality_limit: u64,
    pub integrity_limit: u64,
}
Expand description

Common state for cipher suites (both for TLS 1.2 and TLS 1.3)

Fields§

§suite: CipherSuite

The TLS enumeration naming this cipher suite.

§hash_provider: &'static dyn Hash

Which hash function the suite uses.

§confidentiality_limit: u64

Number of messages that can be safely encrypted with a single key of this type

Once a MessageEncrypter produced for this suite has encrypted more than confidentiality_limit messages, an attacker gains an advantage in distinguishing it from an ideal pseudorandom permutation (PRP).

This is to be set on the assumption that messages are maximally sized – at least 2 ** 14 bytes for TCP-TLS and 2 ** 16 for QUIC.

§integrity_limit: u64

Number of messages that can be safely decrypted with a single key of this type

Once a MessageDecrypter produced for this suite has failed to decrypt integrity_limit messages, an attacker gains an advantage in forging messages.

This is not relevant for TLS over TCP (which is implemented in this crate) because a single failed decryption is fatal to the connection. However, this quantity is used by QUIC.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.