Next: Opening a Masked Card, Previous: Creating an Open Card, Up: Operations on Cards [Contents][Index]
Now the previously created card c
will be masked to hide its type.
Then 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[1] << cc << std::endl; |
P_1 receives the card cc
, re-masks them, and sends the result ccc
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[0] >> cc; if (!in_stream[0].good()) std::cerr << "Read or parse error!" << std::endl; tmcg->TMCG_CreateCardSecret(ccs, vtmf); tmcg->TMCG_MaskCard(cc, ccc, ccs, vtmf); out_stream[0] << ccc << std::endl; tmcg->TMCG_ProveMaskCard(cc, ccc, ccs, vtmf, in_stream[0], out_stream[0]); |
P_0 receives the card, verifies the proof, and sends the card to all other players.
VTMF_Card ccc; in_stream[1] >> ccc; if (!tmcg->TMCG_VerifyMaskCard(cc, ccc, vtmf, in_stream[1], out_stream[1])) 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 ccc
.