X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Futil%2Frng.rs;h=63fbc99b52a847ea28e23e3e33dfc14916445058;hb=084ef28708765c0b1ecc041e64a125a7090eeed1;hp=ae50154d95dea23b29d25c36aeff13372b4b101a;hpb=e93c9fbeaf6312fb77bce1ad96a2abb44124f136;p=rust-lightning diff --git a/src/util/rng.rs b/src/util/rng.rs index ae50154d..63fbc99b 100644 --- a/src/util/rng.rs +++ b/src/util/rng.rs @@ -7,12 +7,6 @@ mod real_rng { rng.fill_bytes(data); } - pub fn rand_u832() -> [u8; 32] { - let mut res = [0; 32]; - fill_bytes(&mut res); - res - } - pub fn rand_f32() -> f32 { let mut rng = thread_rng(); rng.next_f32() @@ -37,17 +31,6 @@ mod fuzzy_rng { data[off..].copy_from_slice(&byte_utils::be64_to_array(rng)[0..rem]); } - pub fn rand_u832() -> [u8; 32] { - let rng = unsafe { RNG_ITER += 1; RNG_ITER - 1 }; - let mut res = [0; 32]; - let data = byte_utils::le64_to_array(rng); - res[8*0..8*1].copy_from_slice(&data); - res[8*1..8*2].copy_from_slice(&data); - res[8*2..8*3].copy_from_slice(&data); - res[8*3..8*4].copy_from_slice(&data); - res - } - pub fn rand_f32() -> f32 { let rng = unsafe { RNG_ITER += 1; RNG_ITER - 1 }; f64::from_bits(rng) as f32