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

Method finalize

merlin/src/transcript.rs:336–352  ·  view source on GitHub ↗

Use the supplied external `rng` to rekey the transcript, so that the finalized [`TranscriptRng`] is a PRF bound to randomness from the external RNG, as well as all other transcript data.

(mut self, rng: &mut R)

Source from the content-addressed store, hash-verified

334 /// randomness from the external RNG, as well as all other
335 /// transcript data.
336 pub fn finalize<R>(mut self, rng: &mut R) -> TranscriptRng
337 where
338 R: rand_core::RngCore + rand_core::CryptoRng,
339 {
340 let random_bytes = {
341 let mut bytes = [0u8; 32];
342 rng.fill_bytes(&mut bytes);
343 bytes
344 };
345
346 self.strobe.meta_ad(b"rng", false);
347 self.strobe.key(&random_bytes, false);
348
349 TranscriptRng {
350 strobe: self.strobe,
351 }
352 }
353}
354
355/// An RNG providing synthetic randomness to the prover.

Callers 7

synthesize_circuitFunction · 0.45
new_deterministicMethod · 0.45
hashFunction · 0.45
hash_keyFunction · 0.45
hash_to_keyFunction · 0.45

Calls 3

meta_adMethod · 0.80
keyMethod · 0.80
fill_bytesMethod · 0.45