diff --git a/Cargo.toml b/Cargo.toml index 05ce27f..bbfda46 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,8 +15,8 @@ ctr = "0.9.1" aes = "0.8.1" log = "0.4.14" rand_core = "0.6.3" -x25519-dalek = { version = "2.0.0-pre.1", optional = true } -curve25519-dalek = { version = "4.0.0-pre.2", optional = true } +x25519-dalek = { version = "2.0.1", features = ["static_secrets"], optional = true } +curve25519-dalek = { version = "4.1.2", optional = true } tokio = { version = "1.36", features = ["net", "io-util"]} thiserror = "1" rand = "0.8.5" diff --git a/src/integrations/dalek.rs b/src/integrations/dalek.rs index ba37030..b2870ce 100644 --- a/src/integrations/dalek.rs +++ b/src/integrations/dalek.rs @@ -19,6 +19,7 @@ impl AdnlPublicKey for PublicKey { fn edwards_to_montgomery(public_key: &P) -> PublicKey { PublicKey::from( CompressedEdwardsY::from_slice(&public_key.to_bytes()) + .unwrap() .decompress() .unwrap() .to_montgomery() diff --git a/src/wrappers/peer.rs b/src/wrappers/peer.rs index 59a3d25..a0fa5d2 100644 --- a/src/wrappers/peer.rs +++ b/src/wrappers/peer.rs @@ -18,7 +18,7 @@ impl AdnlPeer { ls_addr: A, ) -> Result, AdnlError> { // generate private key - let local_secret = StaticSecret::new(rand::rngs::OsRng); + let local_secret = StaticSecret::random_from_rng(rand::rngs::OsRng); // use TcpStream as transport for our ADNL connection let transport = TcpStream::connect(ls_addr).await?;