| 107 | |
| 108 | |
| 109 | int Open_Challenge(vector<unsigned int>& e,vector<octetStream>& Open_e, |
| 110 | const vector<octetStream>& Comm_e, |
| 111 | const Player& P,int num_runs) |
| 112 | { |
| 113 | CODE_LOCATION |
| 114 | // Now open the challenge commitments and determine which run was for real |
| 115 | P.Broadcast_Receive(Open_e); |
| 116 | |
| 117 | int challenge=0; |
| 118 | octetStream ee; |
| 119 | for (int i = 0; i < P.num_players(); i++) |
| 120 | { if (i != P.my_num()) |
| 121 | { if (!Open(ee,Comm_e[i],Open_e[i],i)) |
| 122 | { throw invalid_commitment(); } |
| 123 | ee.get(e[i]); |
| 124 | } |
| 125 | challenge+=e[i]; |
| 126 | } |
| 127 | challenge = challenge % num_runs; |
| 128 | |
| 129 | return challenge; |
| 130 | } |
| 131 | |
| 132 | |
| 133 | void Create_Random_Seed(octet* seed, const PlayerBase& P, int len, |
no test coverage detected