MCPcopy Create free account
hub / github.com/data61/MP-SPDZ / Commit_And_Open_

Function Commit_And_Open_

Tools/Subroutines.cpp:174–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172
173
174void Commit_And_Open_(vector<octetStream>& datas, const Player& P, Coordinator& coordinator)
175{
176 CODE_LOCATION
177 vector<octetStream> Comm_data(P.num_players());
178 vector<octetStream> Open_data(P.num_players());
179
180 Commit(Comm_data[P.my_num()],Open_data[P.my_num()],datas[P.my_num()],P.my_num());
181 P.Broadcast_Receive(Comm_data);
182
183 coordinator.wait(P.get_id());
184 P.Broadcast_Receive(Open_data);
185
186 for (int i = 0; i < P.num_players(); i++)
187 { if (i != P.my_num())
188 { if (!Open(datas[i],Comm_data[i],Open_data[i],i))
189 { throw invalid_commitment(); }
190 }
191 }
192}
193
194
195void Commit_To_Seeds(vector<PRNG>& G,

Callers 2

CheckMethod · 0.85
Commit_And_OpenFunction · 0.85

Calls 8

invalid_commitmentClass · 0.85
CommitFunction · 0.70
OpenFunction · 0.70
num_playersMethod · 0.45
my_numMethod · 0.45
Broadcast_ReceiveMethod · 0.45
waitMethod · 0.45
get_idMethod · 0.45

Tested by

no test coverage detected