Previous: , Up: Operations on Cards   [Contents][Index]


3.4.3 Opening a Masked Card

Suppose that P_1 would like to know the type of the masked card ccc. Of course, P_0 could simply reveal it, but that isn’t verifiable. Anyway, if all players cooperate, then P_1 can compute the type in a verifiable way. First, every player (except P_1) will execute the following code.

tmcg->TMCG_ProveCardSecret(ccc, vtmf, in_stream[1], out_stream[1]);

This sends the necessary data to P_1 and proves their correctness. On the other hand, P_1 will execute the following commands exactly in the given order. Finally, he obtain the card type in the variable type. Note that the corresponding function TMCG_VerifyCardSecret is not called for his own index 1.

tmcg->TMCG_SelfCardSecret(ccc, vtmf);
for (size_t i = 0; i < 5; i++)
{
  if (i == 1)
    continue;
  if (!tmcg->TMCG_VerifyCardSecret(ccc, vtmf, in_stream[i], out_stream[i]))
    std::cerr << "Verification failed!" << std::endl;
}
type = tmcg->TMCG_TypeOfCard(ccc, vtmf);

Please notice that first TMCG_SelfCardSecret is called, then TMCG_VerifyCardSecret, and finally TMCG_TypeOfCard.