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: u64Number 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())
24For 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