Skip to content
This repository was archived by the owner on Mar 11, 2024. It is now read-only.

Commit 1bf15a2

Browse files
e-ivkovmikelodder7
authored andcommitted
upgrades version of ed25519-dalek
Upgrade from 1.0.0-pre.2 to .0.0-pre.3 And corresponding fixes for other lib versions and src files Signed-off-by: Egor Ivkov <[email protected]>
1 parent 072b0f3 commit 1bf15a2

File tree

8 files changed

+88
-99
lines changed

8 files changed

+88
-99
lines changed

Cargo.lock

Lines changed: 68 additions & 71 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libursa/Cargo.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ ecdsa_secp256k1 = ["amcl", "arrayref", "failure", "hex", "rand", "rand_chacha",
8686
ecdsa_secp256k1_native = ["arrayref", "failure", "hex", "log", "rand", "secp256k1", "rand_chacha", "sha2/std", "zeroize"]
8787
ecdsa_secp256k1_asm = ["arrayref", "failure", "hex", "log", "rand", "secp256k1", "rand_chacha", "sha2/asm", "zeroize"]
8888
ed25519 = ["arrayref", "ed25519-dalek/std", "ed25519-dalek/u64_backend", "hex", "rand", "rand_chacha", "sha2/std", "zeroize"]
89-
ed25519_asm = ["arrayref", "ed25519-dalek/nightly", "ed25519-dalek/avx2_backend", "hex", "rand", "rand_chacha", "sha2/asm", "zeroize"]
89+
ed25519_asm = ["arrayref", "ed25519-dalek/nightly", "ed25519-dalek/simd_backend", "hex", "rand", "rand_chacha", "sha2/asm", "zeroize"]
9090
encryption = ["aescbc", "aesgcm", "chacha20poly1305"]
9191
encryption_asm = ["aescbc_native", "aesgcm_native", "chacha20poly1305_native"]
9292
ffi = ["failure", "ffi-support", "logger", "serde", "serde_json", "time"]
@@ -118,25 +118,25 @@ block-padding = { version = "0.1", optional = true }
118118
clear_on_drop = { version = "0.2.3", optional = true }
119119
console_error_panic_hook = { version = "0.1.5", optional = true }
120120
curve25519-dalek = { version = "=1.2.3", default-features = false, optional = true }
121-
ed25519-dalek = { version = "=1.0.0-pre.2", default-features = false, optional = true }
121+
ed25519-dalek = { version = "=1.0.0-pre.3", default-features = false, optional = true }
122122
env_logger = { version = "0.7.0", optional = true }
123123
failure = { version = "0.1.6", optional = true }
124124
ffi-support = { version = "0.4", optional = true }
125-
glass_pumpkin = { version = "0.3", optional = true }
125+
glass_pumpkin = { version = "0.4", optional = true }
126126
hex = { version = "0.4.0", optional = true }
127127
hmac = { version = "0.7", optional = true }
128128
int_traits = { version = "0.1.1", optional = true }
129129
js-sys = { version = "0.3.13", optional = true }
130130
lazy_static = { version = "1.4", optional = true }
131131
libsodium-ffi = { version = "0.2.2", optional = true }
132132
log = { version = "0.4.8", optional = true }
133-
num-bigint = { version = "0.2", features = ["rand"], optional = true }
134-
num-integer = { version = "0.1", optional = true }
135-
num-traits = { version = "0.2", optional = true }
133+
num-bigint = { version = "0.3.0", features = ["rand"], optional = true}
134+
num-integer = { version = "=0.1.42", optional = true }
135+
num-traits = { version = "=0.2.11", optional = true }
136136
openssl = { version = "0.10", optional = true }
137137
# TODO: Find out if the wasm-bindgen feature can be made dependent on our own wasm feature
138-
rand = { version = "=0.6.5", features = ["wasm-bindgen"], optional = true }
139-
rand_chacha = { version = "=0.1.1", optional = true }
138+
rand = { version = "=0.7", features = ["wasm-bindgen"], optional = true }
139+
rand_chacha = { version = "=0.2.0", optional = true }
140140
rustchacha20poly1305 = { version = "0.5.0", package = "chacha20poly1305", optional = true }
141141
rustlibsecp256k1 = { version = "0.3", package = "libsecp256k1", optional = true }
142142
secp256k1 = { version = "0.17", optional = true, features = ["rand", "serde"]}
@@ -147,7 +147,7 @@ sha3 = { version = "0.8", optional = true }
147147
subtle = { version = "2.2.1", optional = true }
148148
time = { version = "0.1", optional = true }
149149
wasm-bindgen = { version = "0.2", optional = true, features = ["serde-serialize"] }
150-
x25519-dalek = { version = "=0.5.2", optional = true, default-features = false }
150+
x25519-dalek = { version = "=0.6.0", optional = true, default-features = false }
151151
zeroize = { version = "1.1", features = ["zeroize_derive"], optional = true }
152152

153153
[dev-dependencies]

libursa/src/bn/rust.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl BigNumber {
7272
) -> UrsaCryptoResult<BigNumber> {
7373
let mut res;
7474
let mut iteration = 0;
75-
let mut rng = OsRng::new()?;
75+
let mut rng = OsRng::default();
7676
let mut start = match start.bn.to_biguint() {
7777
Some(bn) => bn,
7878
None => {
@@ -127,13 +127,13 @@ impl BigNumber {
127127
}
128128

129129
pub fn rand(size: usize) -> UrsaCryptoResult<BigNumber> {
130-
let mut rng = OsRng::new()?;
131-
let res = rng.gen_biguint(size).to_bigint();
130+
let mut rng = OsRng::default();
131+
let res = rng.gen_biguint(size as u64).to_bigint();
132132
Ok(BigNumber { bn: res.unwrap() })
133133
}
134134

135135
pub fn rand_range(&self) -> UrsaCryptoResult<BigNumber> {
136-
let mut rng = OsRng::new()?;
136+
let mut rng = OsRng::default();
137137
let res = rng.gen_bigint_range(&BigInt::zero(), &self.bn);
138138
match res.to_bigint() {
139139
Some(bn) => Ok(BigNumber { bn }),
@@ -356,7 +356,7 @@ impl BigNumber {
356356

357357
match a.bn.to_u64() {
358358
Some(num) => Ok(BigNumber {
359-
bn: self.bn.pow(num),
359+
bn: self.bn.clone().pow(num),
360360
}),
361361
None => Err(UrsaCryptoError::from_msg(
362362
UrsaCryptoErrorKind::InvalidState,

0 commit comments

Comments
 (0)