Skip to content

Commit a5809ea

Browse files
committed
Update the example random number generator
1 parent 9ea722b commit a5809ea

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,5 @@ required-features = ["hazmat"]
5353
[[example]]
5454
name = "ringct"
5555
crate-type = ["staticlib"]
56+
required-features = ["rand"]
5657
test = true

examples/ringct.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@
1212
mod test {
1313
use curve25519_dalek::{RistrettoPoint, Scalar};
1414
use merlin::Transcript;
15-
use rand_chacha::ChaCha12Rng;
16-
use rand_core::SeedableRng;
15+
use rand_core::OsRng;
1716
use triptych::parallel::*;
1817

1918
#[allow(non_snake_case)]
2019
#[test]
2120
fn ringct() {
22-
// In practice you should use an actual random number generator; this is just for easier testing
23-
let mut rng = ChaCha12Rng::seed_from_u64(8675309);
21+
// It's important to use a cryptographically-secure random number generator!
22+
let mut rng = OsRng;
2423

2524
// Parameters that will define the number of outputs used in the proof: 2^4 == 16
2625
let n = 2;

0 commit comments

Comments
 (0)