Crate snow[−][src]
The snow
crate is a straightforward, Hard To Fuck Up™ Noise Protocol implementation.
Read the Noise Protocol Framework Spec for more information.
The typical usage flow is to use NoiseBuilder
to construct a Session
, which is main
state machine you will want to interact with.
Examples
See examples/simple.rs
for a more complete TCP client/server example.
let noise = NoiseBuilder::new("Noise_NN_ChaChaPoly_BLAKE2s".parse().unwrap()) .build_initiator() .unwrap(); let mut buf = [0u8; 65535]; // write first handshake message noise.write_message(&[], &mut buf).unwrap(); // receive response message let incoming = receive_message_from_the_mysterious_ether(); noise.read_message(&incoming, &mut buf).unwrap(); // complete handshake, and transition the state machine into transport mode let noise = noise.into_transport_mode();
Re-exports
pub use resolvers::CryptoResolver; |
pub use resolvers::FallbackResolver; |
pub use resolvers::default::DefaultResolver; |
pub use resolvers::ring::RingResolver; |
pub use resolvers::hacl_star::HaclStarResolver; |
Modules
params |
All structures related to Noise parameter definitions (cryptographic primitive choices, protocol patterns/names) |
resolvers |
The wrappers around the default collection of cryptography and entropy providers. |
types |
The traits for cryptographic implementations that can be used by Noise. |
Structs
NoiseBuilder |
The default pure-rust crypto implementation resolver.
Generates a |
Enums
InitStage |
The various stages of initialization used to help identify
the specific cause of an |
Prerequisite |
A prerequisite that may be missing. |
Session |
A state machine for the entire Noise session. |
SnowError | |
StateProblem |
Specific errors in the state machine. |