mirror of
https://github.com/threefoldtech/mycelium.git
synced 2026-06-04 14:51:39 +00:00
Update x25519-dalek dependency to v2.0.0
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Generated
+52
-19
@@ -172,7 +172,7 @@ version = "0.10.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"digest",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -315,17 +315,31 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "curve25519-dalek"
|
||||
version = "3.2.1"
|
||||
version = "4.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0"
|
||||
checksum = "622178105f911d937a42cdb140730ba4a3ed2becd8ae6ce39c7d28b5d75d4588"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"digest 0.9.0",
|
||||
"rand_core 0.5.1",
|
||||
"cfg-if",
|
||||
"cpufeatures",
|
||||
"curve25519-dalek-derive",
|
||||
"fiat-crypto",
|
||||
"platforms",
|
||||
"rustc_version",
|
||||
"subtle",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "curve25519-dalek-derive"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dashmap"
|
||||
version = "5.5.0"
|
||||
@@ -339,15 +353,6 @@ dependencies = [
|
||||
"parking_lot_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "digest"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
|
||||
dependencies = [
|
||||
"generic-array",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "digest"
|
||||
version = "0.10.7"
|
||||
@@ -417,6 +422,12 @@ dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fiat-crypto"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d"
|
||||
|
||||
[[package]]
|
||||
name = "fnv"
|
||||
version = "1.0.7"
|
||||
@@ -755,7 +766,7 @@ dependencies = [
|
||||
"blake2",
|
||||
"bytes",
|
||||
"clap",
|
||||
"digest 0.10.7",
|
||||
"digest",
|
||||
"etherparse",
|
||||
"faster-hex",
|
||||
"futures",
|
||||
@@ -997,6 +1008,12 @@ version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
|
||||
|
||||
[[package]]
|
||||
name = "platforms"
|
||||
version = "3.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8"
|
||||
|
||||
[[package]]
|
||||
name = "polyval"
|
||||
version = "0.6.1"
|
||||
@@ -1159,6 +1176,15 @@ version = "0.1.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
|
||||
|
||||
[[package]]
|
||||
name = "rustc_version"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
|
||||
dependencies = [
|
||||
"semver",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustix"
|
||||
version = "0.38.4"
|
||||
@@ -1196,6 +1222,12 @@ version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
||||
|
||||
[[package]]
|
||||
name = "semver"
|
||||
version = "1.0.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.175"
|
||||
@@ -1686,12 +1718,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "x25519-dalek"
|
||||
version = "1.2.0"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2392b6b94a576b4e2bf3c5b2757d63f10ada8020a2e4d08ac849ebcf6ea8e077"
|
||||
checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96"
|
||||
dependencies = [
|
||||
"curve25519-dalek",
|
||||
"rand_core 0.5.1",
|
||||
"rand_core 0.6.4",
|
||||
"serde",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ bytes = "1.4.0"
|
||||
etherparse = "0.13.0"
|
||||
getrandom = "0.2.9"
|
||||
rand_core = { version = "0.5.1", features = ["getrandom"] }
|
||||
x25519-dalek = "1.2.0"
|
||||
x25519-dalek = { version = "2.0.0", features = ["getrandom", "static_secrets"] }
|
||||
serde_json = "1.0.104"
|
||||
blake2 = "0.10.6"
|
||||
digest = "0.10.7"
|
||||
|
||||
+3
-4
@@ -4,12 +4,11 @@ use core::fmt;
|
||||
use std::{io, net::Ipv6Addr, ops::Deref, path::Path};
|
||||
|
||||
use aes_gcm::{
|
||||
aead::{Aead, OsRng as CryptOsRng},
|
||||
aead::{Aead, OsRng},
|
||||
AeadCore, Aes256Gcm, Key, KeyInit,
|
||||
};
|
||||
use blake2::{Blake2b, Digest};
|
||||
use digest::consts::U16;
|
||||
use rand_core::OsRng;
|
||||
use serde::Serialize;
|
||||
use tokio::{
|
||||
fs::File,
|
||||
@@ -40,7 +39,7 @@ type Blake2b128 = Blake2b<U16>;
|
||||
impl SecretKey {
|
||||
/// Generate a new `StaticSecret` using [`OsRng`] as an entropy source.
|
||||
pub fn new() -> Self {
|
||||
SecretKey(x25519_dalek::StaticSecret::new(OsRng))
|
||||
SecretKey(x25519_dalek::StaticSecret::random_from_rng(OsRng))
|
||||
}
|
||||
|
||||
/// Load a `SecretKey` from a file.
|
||||
@@ -101,7 +100,7 @@ impl SharedSecret {
|
||||
/// nonce is appended to the encrypted data.
|
||||
pub fn encrypt(&self, data: &[u8]) -> Vec<u8> {
|
||||
let key: Key<Aes256Gcm> = self.0.into();
|
||||
let nonce = Aes256Gcm::generate_nonce(&mut CryptOsRng);
|
||||
let nonce = Aes256Gcm::generate_nonce(OsRng);
|
||||
|
||||
let cipher = Aes256Gcm::new(&key);
|
||||
let mut encrypted_data = cipher
|
||||
|
||||
Reference in New Issue
Block a user