[BREAKGLASS] Append-only mirror of github.com/signalapp/snow
Go to file
2019-09-20 13:45:33 -07:00
benches Bump criterion version to 0.3 2019-08-30 13:10:37 +09:00
docs outsource documentation to docs.rs 2018-07-19 17:43:38 +09:00
examples remove hacl-star resolver 2019-07-14 22:36:35 +09:00
hfuzz expand fuzzers a little bit more 2019-06-23 16:44:02 +09:00
src add std feature for no_std compatibility 2019-09-20 13:45:33 -07:00
tests remove hacl-star resolver 2019-07-14 22:36:35 +09:00
.gitignore ignore .vscode 2019-01-16 17:13:36 +09:00
.travis.yml remove hacl-star resolver 2019-07-14 22:36:35 +09:00
appveyor.yml remove hacl-star resolver 2019-07-14 22:36:35 +09:00
build.rs fix rust edition idioms in other resolvers 2019-06-22 23:34:19 +09:00
Cargo.toml add std feature for no_std compatibility 2019-09-20 13:45:33 -07:00
LICENSE LICENSE 2016-04-05 02:03:01 -07:00
README.md use ring's CSPRNG when feature enabled 2019-07-15 12:48:10 +09:00
rustfmt.toml add rustfmt.toml that disables it, pending customized config 2018-06-27 14:02:01 +08:00
travis-local.sh add a script to quickly run travis tests locally 2019-09-01 01:42:31 +09:00

Snow

Crates.io Docs.rs Build Status dependency status

totally official snow logo

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

🔥 Warning 🔥 This library has not received any formal audit.

What's it look like?

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

let mut noise = snow::Builder::new("Noise_NN_25519_ChaChaPoly_BLAKE2s".parse()?)
                    .build_initiator()?;
 
let mut buf = [0u8; 65535];
 
// write first handshake message
noise.write_message(&[], &mut buf)?;
 
// receive response message
let incoming = receive_message_from_the_mysterious_ether();
noise.read_message(&incoming, &mut buf)?;
 
// complete handshake, and transition the state machine into transport mode
let mut noise = noise.into_transport_mode()?;

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

Implemented

Snow is currently tracking against Noise spec revision 34.

However, a not all features have been implemented yet (pull requests welcome):

Crypto

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

Providers

ring

ring is a crypto library based off of BoringSSL and is significantly faster than most of the pure-Rust implementations.

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

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

Resolver primitives supported

default ring
CSPRNG
25519
448
AESGCM
ChaChaPoly
SHA256
SHA512
BLAKE2s
BLAKE2b