MCPcopy Create free account
hub / github.com/docknetwork/crypto / test_setup

Function test_setup

coconut/src/setup/mod.rs:17–39  ·  view source on GitHub ↗
(
    rng: &mut R,
    message_count: usize,
)

Source from the content-addressed store, hash-verified

15/// Initializes secret/public key along with params and messages to be used in tests.
16#[allow(clippy::type_complexity)]
17pub 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)
26where
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, &params);
36 let messages = n_rand(rng, message_count).collect();
37
38 (secret, public, params, messages)
39}

Callers

nothing calls this directly

Calls 2

randFunction · 0.85
n_randFunction · 0.85

Tested by

no test coverage detected