#noise #protocol #crypto

snow

A pure-rust implementation of the Noise Protocol Framework

46 releases

✓ Uses Rust 2018 edition

new 0.6.0 Jul 14, 2019
0.5.2 Feb 26, 2019
0.4.0 Sep 9, 2018
0.3.1 Jul 24, 2018
0.0.1-preview.10 Mar 21, 2017

#16 in Cryptography

Download history 1185/week @ 2019-03-31 945/week @ 2019-04-07 1224/week @ 2019-04-14 1179/week @ 2019-04-21 921/week @ 2019-04-28 1404/week @ 2019-05-05 1224/week @ 2019-05-12 1163/week @ 2019-05-19 1108/week @ 2019-05-26 1250/week @ 2019-06-02 1580/week @ 2019-06-09 6447/week @ 2019-06-16 3147/week @ 2019-06-23 2110/week @ 2019-06-30 1908/week @ 2019-07-07

8,172 downloads per month
Used in 14 crates (5 directly)

Unlicense

600KB
2.5K SLoC

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 hacl*
CSPRNG
25519
448
AESGCM
ChaChaPoly
SHA256
SHA512
BLAKE2s
BLAKE2b

Dependencies

~2MB
~54K SLoC