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)
| 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. |