Skip to content

Commit badc078

Browse files
committed
bump rand_core to 0.10.0-rc.2
1 parent 8b478bd commit badc078

File tree

11 files changed

+273
-156
lines changed

11 files changed

+273
-156
lines changed

Cargo.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ rust-version = "1.85"
1212
[dependencies]
1313
crypto-bigint = { version = "0.7.0-pre.5", default-features = false, features = ["rand_core"] }
1414
libm = { version = "0.2.13", default-features = false, features = ["arch"] }
15-
rand_core = { version = "0.9.2", default-features = false }
15+
rand_core = { version = "0.10.0-rc.2", default-features = false }
1616
rayon = { version = "1", optional = true, default-features = false }
1717

1818
# Optional dependencies used in tests and benchmarks
@@ -21,10 +21,10 @@ rug = { version = "1.26", optional = true, default-features = false, features =
2121
glass_pumpkin = { version = "1", optional = true }
2222

2323
[dev-dependencies]
24-
rand_core = { version = "0.9.2", default-features = false, features = ["os_rng"] }
24+
rand = { version = "0.10.0-rc.1", features = ["chacha"] }
25+
rand_core = { version = "0.10.0-rc.2", default-features = false }
2526
# need `crypto-bigint` with `alloc` to test `BoxedUint`
2627
crypto-bigint = { version = "0.7.0-pre.5", default-features = false, features = ["alloc"] }
27-
rand_chacha = "0.9"
2828
criterion = { version = "0.5", features = ["html_reports"] }
2929
num-modular = { version = "0.5", features = ["num-bigint"] }
3030
num-bigint = "0.4"
@@ -62,3 +62,7 @@ harness = false
6262
[[bench]]
6363
name = "cctv"
6464
harness = false
65+
66+
[patch.crates-io]
67+
crypto-bigint = { git = "https://github.com/RustCrypto/crypto-bigint", branch = "rand_core/v0.10.0-rc-2" }
68+
rand_core = { git = "https://github.com/baloo/rand-core.git", branch = "baloo/seedablerng/fork" }

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,19 @@ Find a 196 bit prime returned in a 256-bit long `crypto_bigint::U256`:
2828

2929
```rust
3030
use crypto_bigint::U256;
31-
use rand_core::{OsRng, TryRngCore};
3231
use crypto_primes::{Flavor, is_prime, random_prime};
3332

34-
let prime = random_prime::<U256, _>(&mut OsRng.unwrap_mut(), Flavor::Any, 196);
33+
let prime = random_prime::<U256, _>(&mut rand::rng(), Flavor::Any, 196);
3534
assert!(is_prime(Flavor::Any, &prime));
3635
```
3736

3837
Find a 64 bit safe prime returned in a `crypto_bigint::U1024`:
3938

4039
```rust
4140
use crypto_bigint::U1024;
42-
use rand_core::{OsRng, TryRngCore};
4341
use crypto_primes::{Flavor, is_prime, random_prime};
4442

45-
let prime = random_prime::<U1024, _>(&mut OsRng.unwrap_mut(), Flavor::Safe, 64);
43+
let prime = random_prime::<U1024, _>(&mut rand::rng(), Flavor::Safe, 64);
4644
assert!(is_prime(Flavor::Safe, &prime));
4745
```
4846

@@ -56,12 +54,11 @@ use crypto_primes::{
5654
is_prime, random_prime, sieve_and_find,
5755
};
5856
use crypto_bigint::U256;
59-
use rand_core::{OsRng, TryRngCore};
6057

6158
let flavor = Flavor::Any;
6259
let factory = SmallFactorsSieveFactory::<U256>::new(flavor, 256, SetBits::TwoMsb).unwrap();
6360
let prime = sieve_and_find(
64-
&mut OsRng.unwrap_mut(),
61+
&mut rand::rng(),
6562
factory,
6663
|_rng, candidate| is_prime(flavor, candidate)
6764
).unwrap().unwrap();

0 commit comments

Comments
 (0)