Struct snow::HandshakeState
[−]
[src]
pub struct HandshakeState { /* fields omitted */ }
A state machine encompassing the handshake phase of a Noise session.
See: http://noiseprotocol.org/noise.html#the-handshakestate-object
Methods
impl HandshakeState
[src]
fn new(rng: Box<Random>,
cipherstate: Box<CipherStateType>,
hasher: Box<Hash>,
s: Toggle<Box<Dh>>,
e: Toggle<Box<Dh>>,
fixed_ephemeral: bool,
rs: Toggle<[u8; 56]>,
re: Toggle<[u8; 56]>,
initiator: bool,
handshake_pattern: HandshakePattern,
prologue: &[u8],
optional_preshared_key: Option<Vec<u8>>,
cipherstates: CipherStates)
-> Result<HandshakeState, NoiseError>
cipherstate: Box<CipherStateType>,
hasher: Box<Hash>,
s: Toggle<Box<Dh>>,
e: Toggle<Box<Dh>>,
fixed_ephemeral: bool,
rs: Toggle<[u8; 56]>,
re: Toggle<[u8; 56]>,
initiator: bool,
handshake_pattern: HandshakePattern,
prologue: &[u8],
optional_preshared_key: Option<Vec<u8>>,
cipherstates: CipherStates)
-> Result<HandshakeState, NoiseError>
fn is_write_encrypted(&self) -> bool
fn write_handshake_message(&mut self,
payload: &[u8],
message: &mut [u8])
-> Result<usize, NoiseError>
payload: &[u8],
message: &mut [u8])
-> Result<usize, NoiseError>
fn read_handshake_message(&mut self,
message: &[u8],
payload: &mut [u8])
-> Result<usize, NoiseError>
message: &[u8],
payload: &mut [u8])
-> Result<usize, NoiseError>
fn finish(self) -> Result<CipherStates, NoiseError>
fn is_initiator(&self) -> bool
fn is_finished(&self) -> bool
Trait Implementations
impl NoiseSessionState for HandshakeState
[src]
fn is_payload_encrypted(&self) -> bool
fn write_message(&mut self,
payload: &[u8],
output: &mut [u8])
-> Result<usize, NoiseError>
payload: &[u8],
output: &mut [u8])
-> Result<usize, NoiseError>
fn read_message(&mut self,
input: &[u8],
payload: &mut [u8])
-> Result<usize, NoiseError>
input: &[u8],
payload: &mut [u8])
-> Result<usize, NoiseError>