diff --git a/src/librand/chacha.rs b/src/librand/chacha.rs index df33e6e2ced..83d03bb265e 100644 --- a/src/librand/chacha.rs +++ b/src/librand/chacha.rs @@ -14,9 +14,9 @@ use core::prelude::*; use {Rng, SeedableRng, Rand}; -static KEY_WORDS : uint = 8; // 8 words for the 256-bit key -static STATE_WORDS : uint = 16; -static CHACHA_ROUNDS: uint = 20; // Cryptographically secure from 8 upwards as of this writing +const KEY_WORDS : uint = 8; // 8 words for the 256-bit key +const STATE_WORDS : uint = 16; +const CHACHA_ROUNDS: uint = 20; // Cryptographically secure from 8 upwards as of this writing /// A random number generator that uses the ChaCha20 algorithm [1]. /// diff --git a/src/librand/isaac.rs b/src/librand/isaac.rs index 0a857da92bb..9bfd9177e34 100644 --- a/src/librand/isaac.rs +++ b/src/librand/isaac.rs @@ -16,9 +16,9 @@ use core::slice::raw; use {Rng, SeedableRng, Rand}; -static RAND_SIZE_LEN: u32 = 8; -static RAND_SIZE: u32 = 1 << (RAND_SIZE_LEN as uint); -static RAND_SIZE_UINT: uint = 1 << (RAND_SIZE_LEN as uint); +const RAND_SIZE_LEN: u32 = 8; +const RAND_SIZE: u32 = 1 << (RAND_SIZE_LEN as uint); +const RAND_SIZE_UINT: uint = 1 << (RAND_SIZE_LEN as uint); /// A random number generator that uses the ISAAC algorithm[1]. /// @@ -251,8 +251,8 @@ impl Rand for IsaacRng { } } -static RAND_SIZE_64_LEN: uint = 8; -static RAND_SIZE_64: uint = 1 << RAND_SIZE_64_LEN; +const RAND_SIZE_64_LEN: uint = 8; +const RAND_SIZE_64: uint = 1 << RAND_SIZE_64_LEN; /// A random number generator that uses ISAAC-64[1], the 64-bit /// variant of the ISAAC algorithm. @@ -356,8 +356,8 @@ impl Isaac64Rng { // abbreviations let mut a = self.a; let mut b = self.b + self.c; - static MIDPOINT: uint = RAND_SIZE_64 / 2; - static MP_VEC: [(uint, uint), .. 2] = [(0,MIDPOINT), (MIDPOINT, 0)]; + const MIDPOINT: uint = RAND_SIZE_64 / 2; + const MP_VEC: [(uint, uint), .. 2] = [(0,MIDPOINT), (MIDPOINT, 0)]; macro_rules! ind ( ($x:expr) => { *self.mem.unsafe_get(($x as uint >> 3) & (RAND_SIZE_64 - 1))