Previous: Masking and Re-masking of a Card, Up: Operations on Cards



3.3.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]);
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.

     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);