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

Function Open

Tools/Commit.cpp:14–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12}
13
14bool Open(octetStream& message,const octetStream& comm, octetStream& open, int send_player)
15{
16 octetStream h = open.hash();
17 // first 4 bytes are player no.
18 int open_player;
19 try
20 {
21 open_player = open.get<int>();
22 }
23 catch (exception& e)
24 {
25 throw invalid_commitment(send_player, e.what());
26 }
27
28 if (!(h.equals(comm) && open_player == send_player))
29 {
30 throw invalid_commitment(send_player);
31 }
32 message.reset_write_head();
33 message.append(open.consume(0), open.left() - SEED_SIZE);
34 return true;
35}
36
37void Commitment::commit(const octetStream& message)
38{

Callers 5

Create_RandomFunction · 0.70
Commit_And_OpenFunction · 0.50
covert_generationFunction · 0.50
Create_MoreMethod · 0.50
Run_Gen_ProtocolFunction · 0.50

Calls 8

invalid_commitmentClass · 0.85
hashMethod · 0.45
whatMethod · 0.45
equalsMethod · 0.45
reset_write_headMethod · 0.45
appendMethod · 0.45
consumeMethod · 0.45
leftMethod · 0.45

Tested by

no test coverage detected