Struct snow::TransportState [−][src]
pub struct TransportState { /* fields omitted */ }
Expand description
A state machine encompassing the transport phase of a Noise session, using the two
CipherState
s (for sending and receiving) that were spawned from the SymmetricState
’s
Split()
method, called after a handshake has been finished.
Also see: the relevant Noise spec section.
Implementations
impl TransportState
[src]
impl TransportState
[src]pub fn get_remote_static(&self) -> Option<&[u8]>
[src]
pub fn get_remote_static(&self) -> Option<&[u8]>
[src]Get the remote party’s static public key, if available.
Note: will return None
if either the chosen Noise pattern
doesn’t necessitate a remote static key, or if the remote
static key is not yet known (as can be the case in the XX
pattern, for example).
pub fn write_message(
&mut self,
payload: &[u8],
message: &mut [u8]
) -> Result<usize, Error>
[src]
pub fn write_message(
&mut self,
payload: &[u8],
message: &mut [u8]
) -> Result<usize, Error>
[src]Construct a message from payload
(and pending handshake tokens if in handshake state),
and writes it to the output
buffer.
Returns the size of the written payload.
Errors
Will result in Error::Input
if the size of the output exceeds the max message
length in the Noise Protocol (65535 bytes).
pub fn rekey_outgoing(&mut self)
[src]
pub fn rekey_outgoing(&mut self)
[src]Generates a new key for the egress symmetric cipher according to Section 4.2 of the Noise Specification. Synchronizing timing of rekey between initiator and responder is the responsibility of the application, as described in Section 11.3 of the Noise Specification.
pub fn rekey_incoming(&mut self)
[src]
pub fn rekey_incoming(&mut self)
[src]Generates a new key for the ingress symmetric cipher according to Section 4.2 of the Noise Specification. Synchronizing timing of rekey between initiator and responder is the responsibility of the application, as described in Section 11.3 of the Noise Specification.
pub fn rekey_manually(
&mut self,
initiator: Option<&[u8]>,
responder: Option<&[u8]>
)
[src]
pub fn rekey_manually(
&mut self,
initiator: Option<&[u8]>,
responder: Option<&[u8]>
)
[src]Set a new key for the one or both of the initiator-egress and responder-egress symmetric ciphers.
pub fn rekey_initiator_manually(&mut self, key: &[u8])
[src]
pub fn rekey_initiator_manually(&mut self, key: &[u8])
[src]Set a new key for the initiator-egress symmetric cipher.
pub fn rekey_responder_manually(&mut self, key: &[u8])
[src]
pub fn rekey_responder_manually(&mut self, key: &[u8])
[src]Set a new key for the responder-egress symmetric cipher.
pub fn set_receiving_nonce(&mut self, nonce: u64)
[src]
pub fn set_receiving_nonce(&mut self, nonce: u64)
[src]Sets the receiving CipherState’s nonce. Useful for using noise on lossy transports.
pub fn receiving_nonce(&self) -> u64
[src]
pub fn receiving_nonce(&self) -> u64
[src]Get the forthcoming inbound nonce value.
Errors
Will result in Error::State
if not in transport mode.
pub fn sending_nonce(&self) -> u64
[src]
pub fn sending_nonce(&self) -> u64
[src]Get the forthcoming outbound nonce value.
Errors
Will result in Error::State
if not in transport mode.
pub fn is_initiator(&self) -> bool
[src]
pub fn is_initiator(&self) -> bool
[src]Check if this session was started with the “initiator” role.
Trait Implementations
impl Debug for TransportState
[src]
impl Debug for TransportState
[src]impl TryFrom<HandshakeState> for TransportState
[src]
impl TryFrom<HandshakeState> for TransportState
[src]Auto Trait Implementations
impl !RefUnwindSafe for TransportState
impl Send for TransportState
impl Sync for TransportState
impl Unpin for TransportState
impl !UnwindSafe for TransportState
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,