| 144 | } |
| 145 | |
| 146 | void OTExtensionWithMatrix::extend(int nOTs_requested, |
| 147 | const BitVector& newReceiverInput, bool hash) |
| 148 | { |
| 149 | CODE_LOCATION |
| 150 | protocol_agreement(); |
| 151 | |
| 152 | if (use_kos()) |
| 153 | { |
| 154 | extend_correlated(nOTs_requested, newReceiverInput); |
| 155 | if (hash) |
| 156 | hash_outputs(nOTs_requested); |
| 157 | return; |
| 158 | } |
| 159 | |
| 160 | #ifdef USE_KOS |
| 161 | assert(use_kos()); |
| 162 | #else |
| 163 | resize(nOTs_requested); |
| 164 | |
| 165 | if (nOTs_requested == 0) |
| 166 | return; |
| 167 | |
| 168 | if (not channel) |
| 169 | channel = new osuCrypto::Channel(ot_extension_ios, new PlayerCtSocket(*player)); |
| 170 | |
| 171 | if (player->my_num()) |
| 172 | { |
| 173 | soft_sender(nOTs_requested); |
| 174 | soft_receiver(nOTs_requested, newReceiverInput); |
| 175 | } |
| 176 | else |
| 177 | { |
| 178 | soft_receiver(nOTs_requested, newReceiverInput); |
| 179 | soft_sender(nOTs_requested); |
| 180 | } |
| 181 | |
| 182 | channel->send("hello", 6); |
| 183 | char buf[6]; |
| 184 | channel->recv(buf, 6); |
| 185 | assert(string(buf, 5) == string("hello")); |
| 186 | #endif |
| 187 | } |
| 188 | |
| 189 | #ifndef USE_KOS |
| 190 | void OTExtensionWithMatrix::soft_sender(size_t n) |
no test coverage detected