Skip to content

Commit bfa14ab

Browse files
authored
Remove ReseedingRng (#1722)
2 parents eaf2bef + 76b5b90 commit bfa14ab

File tree

5 files changed

+76
-301
lines changed

5 files changed

+76
-301
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ You may also find the [Upgrade Guide](https://rust-random.github.io/book/update.
2828
- Pub export `Xoshiro128PlusPlus`, `Xoshiro256PlusPlus` prngs (#1649)
2929
- Pub export `ChaCha8Rng`, `ChaCha12Rng`, `ChaCha20Rng` behind `chacha` feature (#1659)
3030

31+
### Removals
32+
- Removed `ReseedingRng` ([#1722])
33+
3134
[#1695]: https://github.com/rust-random/rand/pull/1695
3235
[#1697]: https://github.com/rust-random/rand/pull/1697
3336
[#1717]: https://github.com/rust-random/rand/pull/1717
37+
[#1722]: https://github.com/rust-random/rand/pull/1722
3438

3539
## [0.9.2] - 2025-07-20
3640
### Deprecated

benches/benches/generators.rs

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@
77
// except according to those terms.
88

99
use chacha20::rand_core::UnwrapErr;
10-
use chacha20::{ChaCha8Rng, ChaCha12Rng, ChaCha20Core, ChaCha20Rng};
10+
use chacha20::{ChaCha8Rng, ChaCha12Rng, ChaCha20Rng};
1111
use core::time::Duration;
1212
use criterion::measurement::WallTime;
1313
use criterion::{BenchmarkGroup, Criterion, black_box, criterion_group, criterion_main};
1414
use rand::prelude::*;
15-
use rand::rngs::ReseedingRng;
1615
use rand::rngs::SysRng;
1716
use rand_pcg::{Pcg32, Pcg64, Pcg64Dxsm, Pcg64Mcg};
1817

1918
criterion_group!(
2019
name = benches;
2120
config = Criterion::default();
22-
targets = random_bytes, random_u32, random_u64, init_gen, init_from_u64, init_from_seed, reseeding_bytes
21+
targets = random_bytes, random_u32, random_u64, init_gen, init_from_u64, init_from_seed
2322
);
2423
criterion_main!(benches);
2524

@@ -189,30 +188,3 @@ pub fn init_from_seed(c: &mut Criterion) {
189188

190189
g.finish()
191190
}
192-
193-
pub fn reseeding_bytes(c: &mut Criterion) {
194-
let mut g = c.benchmark_group("reseeding_bytes");
195-
g.warm_up_time(Duration::from_millis(500));
196-
g.throughput(criterion::Throughput::Bytes(1024 * 1024));
197-
198-
fn bench(g: &mut BenchmarkGroup<WallTime>, thresh: u64) {
199-
let name = format!("chacha20_{thresh}k");
200-
g.bench_function(name.as_str(), |b| {
201-
let mut rng = ReseedingRng::<ChaCha20Core, _>::new(thresh * 1024, SysRng).unwrap();
202-
let mut buf = [0u8; 1024 * 1024];
203-
b.iter(|| {
204-
rng.fill_bytes(&mut buf);
205-
black_box(&buf);
206-
});
207-
});
208-
}
209-
210-
bench(&mut g, 4);
211-
bench(&mut g, 16);
212-
bench(&mut g, 32);
213-
bench(&mut g, 64);
214-
bench(&mut g, 256);
215-
bench(&mut g, 1024);
216-
217-
g.finish()
218-
}

src/rngs/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@
9494
//! [PCG]: https://www.pcg-random.org/
9595
//! [xoshiro]: https://prng.di.unimi.it/
9696
97-
mod reseeding;
98-
pub use reseeding::ReseedingRng;
99-
10097
#[cfg(feature = "small_rng")]
10198
mod small;
10299
#[cfg(feature = "small_rng")]

src/rngs/reseeding.rs

Lines changed: 0 additions & 252 deletions
This file was deleted.

0 commit comments

Comments
 (0)