Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
jayvdb committed Jul 3, 2024
1 parent 83061f6 commit add0aae
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion rand_isaac/src/isaac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ impl BlockRngCore for IsaacCore {
type Item = u32;
type Results = IsaacArray<Self::Item>;

/// Refills the output buffer, `results`. See also the pseudocode desciption
/// Refills the output buffer, `results`. See also the pseudocode description
/// of the algorithm in the `IsaacRng` documentation.
///
/// Optimisations used (similar to the reference implementation):
Expand Down
2 changes: 1 addition & 1 deletion rand_isaac/src/isaac64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl BlockRngCore for Isaac64Core {
type Item = u64;
type Results = IsaacArray<Self::Item>;

/// Refills the output buffer, `results`. See also the pseudocode desciption
/// Refills the output buffer, `results`. See also the pseudocode description
/// of the algorithm in the `Isaac64Rng` documentation.
///
/// Optimisations used (similar to the reference implementation):
Expand Down
8 changes: 4 additions & 4 deletions rand_jitter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ without `std` support a timer must be supplied via `JitterRng::new_with_timer`.

## Quality testing

`JitterRng::new()` has build-in, but limited, quality testing, however
`JitterRng::new()` has built-in, but limited, quality testing, however
before using `JitterRng` on untested hardware, or after changes that could
effect how the code is optimized (such as a new LLVM version), it is
recommend to run the much more stringent
affect how the code is optimized (such as a new LLVM version), it is
recommended to run the much more stringent
[NIST SP 800-90B Entropy Estimation Suite](https://github.com/usnistgov/SP800-90B_EntropyAssessment).

Use the following code using `timer_stats` to collect the data:
Expand Down Expand Up @@ -94,7 +94,7 @@ validate the estimation.
restart.py -v jitter_rng_var.bin 8 <min-entropy>
```
2. Estimate the expected amount of entropy that is available in the last 4
bits of the timer delta after running noice sources. Note that a value of
bits of the timer delta after running noise sources. Note that a value of
`3.70` is the minimum estimated entropy for true randomness.
```sh
python noniid_main.py -v -u 4 jitter_rng_var.bin 4
Expand Down
4 changes: 2 additions & 2 deletions rand_jitter/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub enum TimerError {
/// Timer is not monotonically increasing.
NotMonotonic = ERROR_BASE + 3,
/// Variations of deltas of time too small.
TinyVariantions = ERROR_BASE + 4,
TinyVariations = ERROR_BASE + 4,
/// Too many stuck results (indicating no added entropy).
TooManyStuck = ERROR_BASE + 5,
#[doc(hidden)]
Expand All @@ -43,7 +43,7 @@ impl TimerError {
TimerError::NoTimer => "no timer available",
TimerError::CoarseTimer => "coarse timer",
TimerError::NotMonotonic => "timer not monotonic",
TimerError::TinyVariantions => "time delta variations too small",
TimerError::TinyVariations => "time delta variations too small",
TimerError::TooManyStuck => "too many stuck results",
TimerError::__Nonexhaustive => unreachable!(),
}
Expand Down
10 changes: 5 additions & 5 deletions rand_jitter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ where
fn gen_entropy(&mut self) -> u64 {
trace!("JitterRng: collecting entropy");

// Prime `ec.prev_time`, and run the noice sources to make sure the
// Prime `ec.prev_time`, and run the noise sources to make sure the
// first loop round collects the expected entropy.
let mut ec = EcState {
prev_time: (self.timer)(),
Expand Down Expand Up @@ -650,7 +650,7 @@ where
// `assert!(delta_sum / TESTLOOPCOUNT >= 1)`
// `assert!(delta_sum >= TESTLOOPCOUNT)`
if delta_sum < TESTLOOPCOUNT {
return Err(TimerError::TinyVariantions);
return Err(TimerError::TinyVariations);
}

// Ensure that we have variations in the time stamp below 100 for at
Expand All @@ -673,7 +673,7 @@ where
// available bits of entropy per round here for two reasons:
// 1. Simple estimates of the available bits (like Shannon entropy) are
// too optimistic.
// 2. Unless we want to waste a lot of time during intialization, there
// 2. Unless we want to waste a lot of time during initialization, there
// only a small number of samples are available.
//
// Therefore we use a very simple and conservative estimate:
Expand Down Expand Up @@ -703,10 +703,10 @@ where
/// `JitterRng` entropy collector.
///
/// Setting `var_rounds` to `true` will execute the memory access and the
/// CPU jitter noice sources a variable amount of times (just like a real
/// CPU jitter noise sources a variable amount of times (just like a real
/// `JitterRng` round).
///
/// Setting `var_rounds` to `false` will execute the noice sources the
/// Setting `var_rounds` to `false` will execute the noise sources the
/// minimal number of times. This can be used to measure the minimum amount
/// of entropy one round of the entropy collector can collect in the worst
/// case.
Expand Down
2 changes: 1 addition & 1 deletion rand_jitter/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use rand_jitter::JitterRng;
fn test_jitter_init() {
use rand_core::RngCore;

// Because this is a debug build, measurements here are not representive
// Because this is a debug build, measurements here are not representative
// of the final release build.
// Don't fail this test if initializing `JitterRng` fails because of a
// bad timer (the timer from the standard library may not have enough
Expand Down
2 changes: 1 addition & 1 deletion rand_xoshiro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
//! (which are discarded when generating floats), making it fail linearity
//! tests. This is unlikely to have any impact in practise.
//! - [`SplitMix64`]: Recommended for initializing generators of the xoshiro
//! familiy from a 64-bit seed. Used for implementing `seed_from_u64`.
//! family from a 64-bit seed. Used for implementing `seed_from_u64`.
//!
//! # 32-bit generators
//! - [`Xoshiro128StarStar`]: Recommended for all purposes. Excellent speed.
Expand Down

0 comments on commit add0aae

Please sign in to comment.