From c86ebd4114d3165d05f9ce28c1d9e8d7a9a4e801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C2=A8Jeff?= <¨burdges@gnunet.org¨> Date: Tue, 11 Jul 2023 11:23:34 +0200 Subject: [PATCH] Improve test --- bandersnatch_vrfs/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bandersnatch_vrfs/src/lib.rs b/bandersnatch_vrfs/src/lib.rs index 383ba54d..792775a7 100644 --- a/bandersnatch_vrfs/src/lib.rs +++ b/bandersnatch_vrfs/src/lib.rs @@ -253,8 +253,12 @@ mod tests { let kzg = ring::KZG::testing_kzg_setup([0; 32], 2u32.pow(10)); let keyset_size = kzg.max_keyset_size(); - // Gen a bunch of random public keys let mut rng = rand_core::OsRng; + let mut l = [0u8; 8]; + rng.fill_bytes(&mut l); + let keyset_size = usize::from_le_bytes(l) % keyset_size; + + // Gen a bunch of random public keys let mut pks: Vec<_> = (0..keyset_size).map(|_| E::rand(&mut rng)).collect(); // Just select one index for the actual key we are for signing let secret_key_idx = keyset_size / 2;