Skip to content

Commit 82a121e

Browse files
committed
fix build after rebase;
1 parent 86ee527 commit 82a121e

File tree

7 files changed

+9
-4
lines changed

7 files changed

+9
-4
lines changed

ergotree-interpreter/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ num-traits = "0.2.14"
2727
proptest-derive = {version = "0.3.0", optional = true }
2828
base16 = "0.2.1"
2929
num-bigint = "0.4.0"
30+
rand = "0.8.3"
3031

3132
[dependencies.proptest]
3233
# wasm support, via https://altsysrq.github.io/proptest-book/proptest/wasm.html

ergotree-interpreter/src/sigma_protocol/crypto_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use rand::RngCore;
1+
use elliptic_curve::rand_core::RngCore;
22

33
/// Generate cryptographically secure random bytes
44
pub fn secure_random_bytes(how_many: usize) -> Vec<u8> {

ergotree-ir/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ arbitrary = ["proptest", "proptest-derive"]
5050

5151
[dev-dependencies]
5252
sigma-test-util = { version = "0.2.0", path = "../sigma-test-util" }
53+
rand = "0.8.3"

ergotree-ir/src/sigma_protocol/dlog_group.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ use crate::serialization::{
2323
};
2424
use elliptic_curve::group::ff::PrimeField;
2525
use elliptic_curve::group::prime::PrimeCurveAffine;
26+
use elliptic_curve::rand_core::RngCore;
2627
use k256::elliptic_curve::sec1::ToEncodedPoint;
2728
use k256::{ProjectivePoint, PublicKey, Scalar};
2829
use num_bigint::Sign;
@@ -113,9 +114,8 @@ pub fn exponentiate(base: &EcPoint, exponent: &Scalar) -> EcPoint {
113114

114115
/// Creates a random scalar, a big-endian integer in the range [0, n), where n is group order
115116
/// Use cryptographically secure PRNG (like rand::thread_rng())
116-
pub fn random_scalar_in_group_range() -> Scalar {
117-
use k256::elliptic_curve::rand_core::OsRng;
118-
Scalar::generate_vartime(&mut OsRng)
117+
pub fn random_scalar_in_group_range(rng: impl RngCore) -> Scalar {
118+
Scalar::generate_vartime(rng)
119119
}
120120

121121
/// Attempts to create BigInt256 from Scalar

ergotree-ir/src/sigma_protocol/sigma_boolean.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ mod arbitrary {
361361
}
362362
}
363363

364+
#[allow(clippy::panic)]
364365
#[cfg(test)]
365366
mod tests {
366367
use super::*;

ergotree-ir/src/sigma_protocol/sigma_boolean/cand.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ mod arbitrary {
8080
}
8181
}
8282

83+
#[allow(clippy::panic)]
8384
#[allow(clippy::unwrap_used)]
8485
#[cfg(test)]
8586
mod tests {

ergotree-ir/src/sigma_protocol/sigma_boolean/cor.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ mod arbitrary {
8282
}
8383

8484
#[allow(clippy::unwrap_used)]
85+
#[allow(clippy::panic)]
8586
#[cfg(test)]
8687
mod tests {
8788
use super::*;

0 commit comments

Comments
 (0)