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

Function equivalence_simple

merlin/src/transcript.rs:443–457  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

441 /// Test a simple protocol with one message and one challenge
442 #[test]
443 fn equivalence_simple() {
444 let mut real_transcript = Transcript::new(b"test protocol");
445 let mut test_transcript = TestTranscript::new(b"test protocol");
446
447 real_transcript.append_message(b"some label", b"some data");
448 test_transcript.append_message(b"some label", b"some data");
449
450 let mut real_challenge = [0u8; 32];
451 let mut test_challenge = [0u8; 32];
452
453 real_transcript.challenge_bytes(b"challenge", &mut real_challenge);
454 test_transcript.challenge_bytes(b"challenge", &mut test_challenge);
455
456 assert_eq!(real_challenge, test_challenge);
457 }
458
459 /// Test a complex protocol with multiple messages and challenges,
460 /// with messages long enough to wrap around the sponge state, and

Callers

nothing calls this directly

Calls 2

append_messageMethod · 0.45
challenge_bytesMethod · 0.45

Tested by

no test coverage detected