MCPcopy Create free account
hub / github.com/brainboxdotcc/DPP / TranscriptTestVector

Method TranscriptTestVector

mlspp/lib/mls_vectors/src/mls_vectors.cpp:952–996  ·  view source on GitHub ↗

TranscriptTestVector

Source from the content-addressed store, hash-verified

950/// TranscriptTestVector
951///
952TranscriptTestVector::TranscriptTestVector(CipherSuite suite)
953 : PseudoRandom(suite, "transcript")
954 , cipher_suite(suite)
955 , interim_transcript_hash_before(prg.secret("interim_transcript_hash_before"))
956{
957 auto transcript = TranscriptHash(suite);
958 transcript.interim = interim_transcript_hash_before;
959
960 auto group_id = prg.secret("group_id");
961 auto epoch = prg.uint64("epoch");
962 auto group_context_obj =
963 GroupContext{ suite,
964 group_id,
965 epoch,
966 prg.secret("tree_hash_before"),
967 prg.secret("confirmed_transcript_hash_before"),
968 {} };
969 auto group_context = tls::marshal(group_context_obj);
970
971 auto init_secret = prg.secret("init_secret");
972 auto ks_epoch = KeyScheduleEpoch(suite, init_secret, group_context);
973
974 auto sig_priv = prg.signature_key("sig_priv");
975 auto leaf_index = LeafIndex{ 0 };
976
977 authenticated_content = AuthenticatedContent::sign(
978 WireFormat::mls_public_message,
979 GroupContent{
980 group_id, epoch, { MemberSender{ leaf_index } }, {}, Commit{} },
981 suite,
982 sig_priv,
983 group_context_obj);
984
985 transcript.update_confirmed(authenticated_content);
986
987 const auto confirmation_tag = ks_epoch.confirmation_tag(transcript.confirmed);
988 authenticated_content.set_confirmation_tag(confirmation_tag);
989
990 transcript.update_interim(authenticated_content);
991
992 // Store the required data
993 confirmation_key = ks_epoch.confirmation_key;
994 confirmed_transcript_hash_after = transcript.confirmed;
995 interim_transcript_hash_after = transcript.interim;
996}
997
998std::optional<std::string>
999TranscriptTestVector::verify() const

Callers

nothing calls this directly

Calls 7

TranscriptHashClass · 0.85
KeyScheduleEpochClass · 0.85
secretMethod · 0.80
uint64Method · 0.80
signature_keyMethod · 0.80
set_confirmation_tagMethod · 0.80
marshalFunction · 0.50

Tested by

no test coverage detected