|
|
@@ -143,7 +143,7 @@ impl BridgeLine {
|
|
|
// Construct a Bucket Reachability credential for this
|
|
|
// bucket and today's date
|
|
|
let today_attr: Scalar = today.into();
|
|
|
- let mut rng = rand::thread_rng();
|
|
|
+ let mut rng = rand::rngs::OsRng;
|
|
|
let Btable: &RistrettoBasepointTable = &CMZ_B_TABLE;
|
|
|
let b = Scalar::random(&mut rng);
|
|
|
let P = &b * Btable;
|
|
|
@@ -202,7 +202,7 @@ impl BridgeLine {
|
|
|
/// Create a random BridgeLine for testing
|
|
|
#[cfg(test)]
|
|
|
pub fn random() -> Self {
|
|
|
- let mut rng = rand::thread_rng();
|
|
|
+ let mut rng = rand::rngs::OsRng;
|
|
|
let mut res: Self = Default::default();
|
|
|
// Pick a random 4-byte address
|
|
|
let mut addr: [u8; 4] = [0; 4];
|
|
|
@@ -321,7 +321,7 @@ impl BridgeTable {
|
|
|
#[cfg(feature = "bridgeauth")]
|
|
|
pub fn new_bucket(&mut self, index: u32, bucket: &[BridgeLine; MAX_BRIDGES_PER_BUCKET]) {
|
|
|
// Pick a random key to encrypt this bucket
|
|
|
- let mut rng = rand::thread_rng();
|
|
|
+ let mut rng = rand::rngs::OsRng;
|
|
|
let mut key: [u8; 16] = [0; 16];
|
|
|
rng.fill_bytes(&mut key);
|
|
|
self.keys.insert(index, key);
|
|
|
@@ -349,7 +349,7 @@ impl BridgeTable {
|
|
|
/// are reachable.
|
|
|
#[cfg(feature = "bridgeauth")]
|
|
|
pub fn encrypt_table(&mut self, today: u32, reachability_priv: &IssuerPrivKey) {
|
|
|
- let mut rng = rand::thread_rng();
|
|
|
+ let mut rng = rand::rngs::OsRng;
|
|
|
self.encbuckets.clear();
|
|
|
for (uid, key) in self.keys.iter() {
|
|
|
let bucket = self.buckets.get(uid).unwrap();
|