protocols/noise: Introduce NoiseAuthenticated::xx constructor with X25519 DH key exchange (#2887)

Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
Thomas Eizinger
2022-09-16 11:41:35 +10:00
committed by GitHub
parent 5906140d38
commit 2c739e9bdb
16 changed files with 52 additions and 68 deletions

View File

@ -57,10 +57,7 @@ pub fn build_transport(
key_pair: identity::Keypair,
psk: Option<PreSharedKey>,
) -> transport::Boxed<(PeerId, StreamMuxerBox)> {
let noise_keys = noise::Keypair::<noise::X25519Spec>::new()
.into_authentic(&key_pair)
.unwrap();
let noise_config = noise::NoiseConfig::xx(noise_keys).into_authenticated();
let noise_config = noise::NoiseAuthenticated::xx(&key_pair).unwrap();
let yamux_config = YamuxConfig::default();
let base_transport = TcpTransport::new(GenTcpConfig::default().nodelay(true));