Struct CipherSuiteCommon
pub struct CipherSuiteCommon {
pub suite: CipherSuite,
pub hash_provider: &'static dyn Hash,
pub confidentiality_limit: u64,
}tls only.Expand description
Common state for cipher suites (both for TLS 1.2 and TLS 1.3)
Fields§
§suite: CipherSuiteThe TLS enumeration naming this cipher suite.
hash_provider: &'static dyn HashWhich hash function the suite uses.
confidentiality_limit: u64Number of TCP-TLS 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 –
each is 214 bytes. It does not consider confidentiality limits for
QUIC connections - see the quic::PacketKey::confidentiality_limit field for
this context.
For AES-GCM implementations, this should be set to 224 to limit attack probability to one in 260. See AEBounds (Table 1) and 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
Implementations§
§impl CipherSuiteCommon
impl CipherSuiteCommon
Auto Trait Implementations§
impl Freeze for CipherSuiteCommon
impl !RefUnwindSafe for CipherSuiteCommon
impl Send for CipherSuiteCommon
impl Sync for CipherSuiteCommon
impl Unpin for CipherSuiteCommon
impl !UnwindSafe for CipherSuiteCommon
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more