52 releases (breaking)

0.44.0 Nov 5, 2023
0.43.1 Aug 24, 2023
0.43.0 Jun 20, 2023
0.42.1 Mar 12, 2023
0.4.0 Mar 29, 2019

#274 in Cryptography

Download history 50546/week @ 2024-03-14 59930/week @ 2024-03-21 57876/week @ 2024-03-28 65842/week @ 2024-04-04 60792/week @ 2024-04-11 54066/week @ 2024-04-18 47464/week @ 2024-04-25 46669/week @ 2024-05-02 46212/week @ 2024-05-09 45556/week @ 2024-05-16 58209/week @ 2024-05-23 55471/week @ 2024-05-30 44163/week @ 2024-06-06 48953/week @ 2024-06-13 48524/week @ 2024-06-20 35717/week @ 2024-06-27

185,848 downloads per month
Used in 243 crates (17 directly)

MIT license

375KB
7K SLoC

Noise protocol framework support for libp2p.

Note: This crate is still experimental and subject to major breaking changes both on the API and the wire protocol.

This crate provides libp2p_core::InboundUpgrade and libp2p_core::OutboundUpgrade implementations for various noise handshake patterns (currently IK, IX, and XX) over a particular choice of Diffie–Hellman key agreement (currently only X25519).

Note: Only the XX handshake pattern is currently guaranteed to provide interoperability with other libp2p implementations.

All upgrades produce as output a pair, consisting of the remote's static public key and a NoiseOutput which represents the established cryptographic session with the remote, implementing futures::io::AsyncRead and futures::io::AsyncWrite.

Usage

Example:

use libp2p_core::{Transport, upgrade, transport::MemoryTransport};
use libp2p_noise as noise;
use libp2p_identity as identity;

let id_keys = identity::Keypair::generate_ed25519();
let noise = noise::Config::new(&id_keys).unwrap();
let builder = MemoryTransport::default().upgrade(upgrade::Version::V1).authenticate(noise);
// let transport = builder.multiplex(...);

Dependencies

~6–17MB
~259K SLoC