| 64 | } |
| 65 | |
| 66 | void 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 | |
| 114 | void OTExtensionWithMatrix::transfer(int nOTs, |
| 115 | const BitVector& receiverInput, int nloops) |
nothing calls this directly
no test coverage detected