aboutsummaryrefslogtreecommitdiff
path: root/src/rust/crypto/rand/rng.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/rust/crypto/rand/rng.rs')
-rw-r--r--src/rust/crypto/rand/rng.rs29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/rust/crypto/rand/rng.rs b/src/rust/crypto/rand/rng.rs
index 07a0a7bdc7..64ceb22424 100644
--- a/src/rust/crypto/rand/rng.rs
+++ b/src/rust/crypto/rand/rng.rs
@@ -12,15 +12,15 @@
mod internal {
use std::u64;
+ use rand_core::impls::next_u32_via_fill;
+ use rand_core::impls::next_u64_via_fill;
use rand_core::CryptoRng;
use rand_core::Error;
use rand_core::RngCore;
- use rand_core::impls::next_u32_via_fill;
- use rand_core::impls::next_u64_via_fill;
use external::c_tor_crypto_rand;
- use external::c_tor_crypto_strongest_rand;
use external::c_tor_crypto_seed_rng;
+ use external::c_tor_crypto_strongest_rand;
use tor_log::LogDomain;
use tor_log::LogSeverity;
@@ -45,12 +45,15 @@ mod internal {
#[allow(dead_code)]
pub fn new() -> Self {
if !c_tor_crypto_seed_rng() {
- tor_log_msg!(LogSeverity::Warn, LogDomain::General,
- "TorRng::from_seed()",
- "The RNG could not be seeded!");
+ tor_log_msg!(
+ LogSeverity::Warn,
+ LogDomain::General,
+ "TorRng::from_seed()",
+ "The RNG could not be seeded!"
+ );
}
// XXX also log success at info level —isis
- TorRng{ _unused: [0u8; 0] }
+ TorRng { _unused: [0u8; 0] }
}
}
@@ -92,12 +95,15 @@ mod internal {
#[allow(dead_code)]
pub fn new() -> Self {
if !c_tor_crypto_seed_rng() {
- tor_log_msg!(LogSeverity::Warn, LogDomain::General,
- "TorStrongestRng::from_seed()",
- "The RNG could not be seeded!");
+ tor_log_msg!(
+ LogSeverity::Warn,
+ LogDomain::General,
+ "TorStrongestRng::from_seed()",
+ "The RNG could not be seeded!"
+ );
}
// XXX also log success at info level —isis
- TorStrongestRng{ _unused: [0u8; 0] }
+ TorStrongestRng { _unused: [0u8; 0] }
}
}
@@ -137,4 +143,3 @@ mod internal {
// Finally, expose the public functionality of whichever appropriate internal
// module.
pub use self::internal::*;
-