Now the previously created card
c will be masked to hide its type.
cc is sent to P_1.
VTMF_Card cc; VTMF_CardSecret cs; tmcg->TMCG_CreateCardSecret(cs, vtmf); tmcg->TMCG_MaskCard(c, cc, cs, vtmf); out_stream << cc << std::endl;
P_1 receives the card
cc, re-masks them, and sends the result
back to the player P_0. Further he proves that the masking operation
was performed correctly.
VTMF_Card cc, ccc; VTMF_CardSecret ccs; in_stream >> cc; if (!in_stream.good()) std::cerr << "Read or parse error!" << std::endl; tmcg->TMCG_CreateCardSecret(ccs, vtmf); tmcg->TMCG_MaskCard(cc, ccc, ccs, vtmf); out_stream << ccc << std::endl; tmcg->TMCG_ProveMaskCard(cc, ccc, ccs, vtmf, in_stream, out_stream);
P_0 receives the card, verifies the proof, and sends the card to all other players.
VTMF_Card ccc; in_stream >> ccc; if (!tmcg->TMCG_VerifyMaskCard(cc, ccc, vtmf, in_stream, out_stream)) std::cerr << "Verification failed!" << std::endl; for (size_t i = 1; i < 5; i++) out_stream[i] << ccc << std::endl;
Finally, all other players receive and store the masked card