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

Method protocol_agreement

OT/OTExtensionWithMatrix.cpp:66–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66void OTExtensionWithMatrix::protocol_agreement()
67{
68 if (agreed)
69 return;
70
71 Bundle<octetStream> bundle(*player);
72 if (use_kos())
73 bundle.mine = string("KOS15");
74 else
75 bundle.mine = string("SoftSpokenOT");
76
77 if (OnlineOptions::singleton.has_option("high_softspoken"))
78 softspoken_k = 8;
79
80 if (OnlineOptions::singleton.has_param("softspoken"))
81 softspoken_k = OnlineOptions::singleton.get_param("softspoken");
82
83 int needed = DIV_CEIL(nbaseOTs, softspoken_k) * softspoken_k;
84
85 baseReceiverInput.resize_zero(needed);
86
87 for (int i = nbaseOTs; i < needed; i++)
88 {
89 auto zero = string(SEED_SIZE, '\0');
90 G_receiver.push_back(zero);
91 G_sender.push_back({});
92 for (int j = 0; j < 2; j++)
93 G_sender.back().push_back(zero);
94 }
95
96 bundle.mine.store(softspoken_k);
97
98 player->unchecked_broadcast(bundle);
99
100 try
101 {
102 bundle.compare(*player);
103 agreed = true;
104 }
105 catch (mismatch_among_parties&)
106 {
107 cerr << "Parties compiled with different OT extensions" << endl;
108 cerr << "Set \"USE_KOS\" to the same value on all parties" << endl;
109 cerr << "and make sure that the SoftSpokenOT parameter is the same" << endl;
110 exit(1);
111 }
112}
113
114void OTExtensionWithMatrix::transfer(int nOTs,
115 const BitVector& receiverInput, int nloops)

Callers

nothing calls this directly

Calls 9

DIV_CEILFunction · 0.85
has_optionMethod · 0.80
has_paramMethod · 0.80
get_paramMethod · 0.80
resize_zeroMethod · 0.80
compareMethod · 0.80
push_backMethod · 0.45
storeMethod · 0.45
unchecked_broadcastMethod · 0.45

Tested by

no test coverage detected