pub(crate) struct HandshakeHash {
provider: &'static dyn Hash,
ctx: Box<dyn Context>,
client_auth: Option<Vec<u8>>,
}
Expand description
This deals with keeping a running hash of the handshake payloads. This is computed by buffering initially. Once we know what hash function we need to use we switch to incremental hashing.
For client auth, we also need to buffer all the messages. This is disabled in cases where client auth is not possible.
Fields§
§provider: &'static dyn Hash
§ctx: Box<dyn Context>
§client_auth: Option<Vec<u8>>
buffer for client-auth.
Implementations§
Source§impl HandshakeHash
impl HandshakeHash
Sourcepub(crate) fn abandon_client_auth(&mut self)
pub(crate) fn abandon_client_auth(&mut self)
We decided not to do client auth after all, so discard the transcript.
Sourcepub(crate) fn add_message(&mut self, m: &Message<'_>) -> &mut Self
pub(crate) fn add_message(&mut self, m: &Message<'_>) -> &mut Self
Hash/buffer a handshake message.
Sourcepub(crate) fn hash_given(&self, extra: &[u8]) -> Output
pub(crate) fn hash_given(&self, extra: &[u8]) -> Output
Get the hash value if we were to hash extra
too,
using hash function hash
.
pub(crate) fn into_hrr_buffer(self) -> HandshakeHashBuffer
Sourcepub(crate) fn rollup_for_hrr(&mut self)
pub(crate) fn rollup_for_hrr(&mut self)
Take the current hash value, and encapsulate it in a ‘handshake_hash’ handshake message. Start this hash again, with that message at the front.
Sourcepub(crate) fn current_hash(&self) -> Output
pub(crate) fn current_hash(&self) -> Output
Get the current hash value.
Sourcepub(crate) fn take_handshake_buf(&mut self) -> Option<Vec<u8>>
pub(crate) fn take_handshake_buf(&mut self) -> Option<Vec<u8>>
Takes this object’s buffer containing all handshake messages so far. This method only works once; it resets the buffer to empty.
Sourcepub(crate) fn algorithm(&self) -> HashAlgorithm
pub(crate) fn algorithm(&self) -> HashAlgorithm
The hashing algorithm