Skip to content

Commit

Permalink
fix dalek crypto lib
Browse files Browse the repository at this point in the history
  • Loading branch information
navichok26 committed Feb 20, 2024
1 parent 9d3255f commit 827636e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions src/integrations/dalek.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ impl AdnlPublicKey for PublicKey {
fn edwards_to_montgomery<P: AdnlPublicKey>(public_key: &P) -> PublicKey {
PublicKey::from(
CompressedEdwardsY::from_slice(&public_key.to_bytes())
.unwrap()
.decompress()
.unwrap()
.to_montgomery()
Expand Down
2 changes: 1 addition & 1 deletion src/wrappers/peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl AdnlPeer<TcpStream> {
ls_addr: A,
) -> Result<AdnlPeer<TcpStream>, 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?;
Expand Down

0 comments on commit 827636e

Please sign in to comment.