#noise #protocol #crypto

snow

A pure-rust implementation of the Noise Protocol Framework

37 releases

✓ Uses Rust 2018 edition

0.6.2 Dec 2, 2019
0.6.1 Aug 31, 2019
0.6.0 Jul 14, 2019
0.5.2 Feb 26, 2019
0.0.1-preview.10 Mar 21, 2017

#17 in Cryptography

Download history 1488/week @ 2019-08-19 2012/week @ 2019-08-26 1759/week @ 2019-09-02 2318/week @ 2019-09-09 3415/week @ 2019-09-16 3378/week @ 2019-09-23 3051/week @ 2019-09-30 3443/week @ 2019-10-07 3691/week @ 2019-10-14 3799/week @ 2019-10-21 2974/week @ 2019-10-28 4190/week @ 2019-11-04 3638/week @ 2019-11-11 3312/week @ 2019-11-18 3019/week @ 2019-11-25

13,910 downloads per month
Used in 18 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
CSPRNG
25519
448
AESGCM
ChaChaPoly
SHA256
SHA512
BLAKE2s
BLAKE2b

Dependencies

~0–2.1MB
~59K SLoC