Snow

Crates.io Docs.rs Build Status

totally official snow logo

An implementation of Trevor Perrin's Noise Protocol that is designed to be Hard To Fuck Up™.

🔥 This library is in the state of preview - do everyone a favor and only use this for fun or criticizing the author's code for now.

What's it look like?

See examples/simple.rs for a more complete TCP client/server example.

```rust let mut noise = NoiseBuilder::new("NoiseNNChaChaPolyBLAKE2s".parse()?) .buildinitiator()?;

let mut buf = [0u8; 65535];

// write first handshake message noise.write_message(&[], &mut buf)?;

// receive response message let incoming = receivemessagefromthemysteriousether(); noise.readmessage(&incoming, &mut buf)?;

// complete handshake, and transition the state machine into transport mode let mut noise = noise.intotransportmode()?; ```

See the full documentation at https://docs.rs/snow.

Implemented

Snow is currently feature-frozen on its current rev32 implementation, since revision 33 will be releasing shortly.

Crypto

Cryptographic providers are swappable through NoiseBuilder::with_provider(), but by default it chooses select, artisanal pure-Rust implementations (see Cargo.toml for a quick overview).

Acceleration

If you enable the ring-accelerated feature, Snow will default to choosing ring's much faster crypto implementations when supported.

If you enable the ring-resolver feature, Snow will include a ring_wrapper module as well as a RingAcceleratedResolver available to be used with NoiseBuilder::with_resolver().