TranscriptTestVector
| 950 | /// TranscriptTestVector |
| 951 | /// |
| 952 | TranscriptTestVector::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 | |
| 998 | std::optional<std::string> |
| 999 | TranscriptTestVector::verify() const |
nothing calls this directly
no test coverage detected