| 15 | /// Initializes secret/public key along with params and messages to be used in tests. |
| 16 | #[allow(clippy::type_complexity)] |
| 17 | pub fn test_setup<E, D, R>( |
| 18 | rng: &mut R, |
| 19 | message_count: usize, |
| 20 | ) -> ( |
| 21 | SecretKey<E::ScalarField>, |
| 22 | PublicKey<E>, |
| 23 | SignatureParams<E>, |
| 24 | Vec<E::ScalarField>, |
| 25 | ) |
| 26 | where |
| 27 | E: ark_ec::pairing::Pairing, |
| 28 | D: digest::Digest, |
| 29 | R: ark_std::rand::RngCore, |
| 30 | { |
| 31 | use crate::helpers::n_rand; |
| 32 | |
| 33 | let params = SignatureParams::new::<D>(b"test", message_count as u32); |
| 34 | let secret = SecretKey::rand(rng, message_count as u32); |
| 35 | let public = PublicKey::new(&secret, ¶ms); |
| 36 | let messages = n_rand(rng, message_count).collect(); |
| 37 | |
| 38 | (secret, public, params, messages) |
| 39 | } |