53 releases (breaking)

0.45.0 Aug 9, 2024
0.44.0 Nov 5, 2023
0.43.2 Oct 16, 2023
0.43.0 Jun 20, 2023
0.4.0 Mar 29, 2019

#304 in Cryptography

Download history 56011/week @ 2024-08-19 67315/week @ 2024-08-26 75466/week @ 2024-09-02 66413/week @ 2024-09-09 66498/week @ 2024-09-16 68520/week @ 2024-09-23 71205/week @ 2024-09-30 66724/week @ 2024-10-07 67384/week @ 2024-10-14 70592/week @ 2024-10-21 58193/week @ 2024-10-28 73762/week @ 2024-11-04 60730/week @ 2024-11-11 63808/week @ 2024-11-18 68190/week @ 2024-11-25 65916/week @ 2024-12-02

261,488 downloads per month
Used in 268 crates (17 directly)

MIT license

365KB
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

~7–17MB
~238K SLoC