i2p_snow

Crates.ioi2p_snow
lib.rsi2p_snow
version0.5.1
sourcesrc
created_at2018-08-23 08:48:16.904108
updated_at2019-02-14 23:31:45.049478
descriptionA pure-rust implementation of the Noise Protocol Framework, with I2P Noise extensions
homepagehttps://github.com/str4d/snow/tree/i2p-0.5.1
repositoryhttps://github.com/str4d/snow/tree/i2p-0.5.1
max_upload_size
id80866
size2,620,451
Jack Grigg (str4d)

documentation

https://snow.rs/doc/i2p_snow

README

Snow (with I2P Noise extensions)

Crates.io Docs.rs

totally official snow logo

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

This codebase contains additional Noise extensions used by I2P for the NTCP2 protocol. Look here for the unmodified crate.

🔥 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 = i2p_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/i2p_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.

HACL*

HACL* is a formally verified cryptographic library, accessed via the rust-hacl-star wrapper crate.

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

Similar to ring, if you enable the hacl-accelerated feature, Snow will default to choosing HACL* implementations when available.

Resolver primitives supported

default ring hacl*
CSPRNG ✔
25519 ✔ ✔ ✔
448
AESGCM ✔ ✔
ChaChaPoly ✔ ✔ ✔
SHA256 ✔ ✔ ✔
SHA512 ✔ ✔ ✔
BLAKE2s ✔
BLAKE2b ✔
Commit count: 0

cargo fmt