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

Method init

proof_system/src/sub_protocols/schnorr.rs:46–60  ·  view source on GitHub ↗

`blindings` specifies the randomness to use. If some index is not present, new randomness is generated for it.

(
        &mut self,
        rng: &mut R,
        mut blindings: BTreeMap<usize, G::ScalarField>,
        witnesses: Vec<G::ScalarField>,
    )

Source from the content-addressed store, hash-verified

44
45 /// `blindings` specifies the randomness to use. If some index is not present, new randomness is generated for it.
46 pub fn init<R: RngCore>(
47 &mut self,
48 rng: &mut R,
49 mut blindings: BTreeMap<usize, G::ScalarField>,
50 witnesses: Vec<G::ScalarField>,
51 ) -> Result<(), ProofSystemError> {
52 let blindings = (0..witnesses.len())
53 .map(|i| {
54 blindings
55 .remove(&i)
56 .unwrap_or_else(|| G::ScalarField::rand(rng))
57 })
58 .collect::<Vec<_>>();
59 self.init_with_all_blindings_given(blindings, witnesses)
60 }
61
62 pub fn init_with_all_blindings_given(
63 &mut self,

Callers

nothing calls this directly

Calls 5

randFunction · 0.85
mapMethod · 0.80
lenMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected