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

Method challenge_bytes_with_non_static_label

merlin/src/transcript.rs:188–213  ·  view source on GitHub ↗
(&mut self, label: &[u8], dest: &mut [u8])

Source from the content-addressed store, hash-verified

186 }
187
188 pub fn challenge_bytes_with_non_static_label(&mut self, label: &[u8], dest: &mut [u8]) {
189 let data_len = encode_usize_as_u32(dest.len());
190 self.strobe.meta_ad(label, false);
191 self.strobe.meta_ad(&data_len, true);
192 self.strobe.prf(dest, false);
193
194 #[cfg(feature = "debug-transcript")]
195 {
196 use std::str::from_utf8;
197
198 match from_utf8(label) {
199 Ok(label_str) => {
200 println!(
201 "meta-AD : {} || LE32({})\t# b\"{}\"",
202 hex::encode(label),
203 dest.len(),
204 label_str
205 );
206 }
207 Err(_) => {
208 println!("meta-AD : {} || LE32({})", hex::encode(label), dest.len());
209 }
210 }
211 println!(" PRF: {}", hex::encode(dest));
212 }
213 }
214
215 /// Fork the current [`Transcript`] to construct an RNG whose output is bound
216 /// to the current transcript state as well as prover's secrets.

Calls 4

encode_usize_as_u32Function · 0.85
meta_adMethod · 0.80
prfMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected