跳到主要内容

CipherSuiteCommon

结构体 CipherSuiteCommon 

Source
pub struct CipherSuiteCommon {
    pub suite: CipherSuite,
    pub hash_provider: &'static dyn Hash,
    pub confidentiality_limit: u64,
}
展开描述

密码套件的共享状态(及 TLS 1.2 和 TLS 1.3)

字段§

§suite: CipherSuite

此 TLS enumeration naming this cipher 套件)。

§hash_provider: &'static dyn Hash

该密码包使用的哈希函数。

§confidentiality_limit: u64

Number of TCP-TLS messages that can be safely encrypted with 一个 single key of this type

Once 一个 MessageEncrypter produced 用于 this suite has encrypted more than confidentiality_limit messages, an attacker gains an advantage in distinguishing it 从 an ideal pseudorandom permutation (PRP)。

This is 到 be set on the assumption that messages are maximally sized – each is 214 bytes. It does not consider confidentiality limits 用于 QUIC connections - see the quic::PacketKey::confidentiality_limit field 用于 this context.

For AES-GCM implementations, this should be set 到 224 到 limit attack probability 到 one in 260。 ,请参见AEBounds (Table 1) 并 draft-irtf-aead-limits-08:

>>> p = 2 ** -60
>>> L = (2 ** 14 // 16) + 1
>>> qlim = (math.sqrt(p) * (2 ** (129 // 2)) - 1) / (L + 1)
>>> print(int(qlim).bit_length())
24

For chacha20-poly1305 implementations, this should be set to u64::MAX: see https://www.ietf.org/archive/id/draft-irtf-cfrg-aead-limits-08.html#section-5.2.1

实现§

Source§

impl CipherSuiteCommon

Source

pub fn fips(&self) -> bool

Return true if this is 由 FIPS 批准的实现支持。

This means all the constituent parts that do cryptography return true 用于 fips()

自动 Trait 实现§

Blanket 实现§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. 更多信息
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows 从 an owned value. 更多信息
Source§

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

Source§

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

Mutably borrows 从 an owned value. 更多信息
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

原样返回传入的参数。

Source§

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

Source§

fn into(self) -> U

Calls U::从(self)

That is, this conversion is whatever the implementation of From<T> 用于 U 的实现方式。

Source§

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

Source§

type Error = Infallible

转换出错时返回的类型。
Source§

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

执行转换。
Source§

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

Source§

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

转换出错时返回的类型。
Source§

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

执行转换。