| 342 | } |
| 343 | |
| 344 | void OTExtensionWithMatrix::transpose(int start, int slice) |
| 345 | { |
| 346 | if (slice < 0) |
| 347 | slice = receiverOutputMatrix.squares.size(); |
| 348 | |
| 349 | BitMatrixSlice receiverOutputSlice(receiverOutputMatrix, start, slice); |
| 350 | BitMatrixSlice senderOutputSlices[2] = { |
| 351 | BitMatrixSlice(senderOutputMatrices[0], start, slice), |
| 352 | BitMatrixSlice(senderOutputMatrices[1], start, slice) |
| 353 | }; |
| 354 | |
| 355 | // transpose t0[i] onto receiverOutput and tmp (q[i]) onto senderOutput[i][0] |
| 356 | |
| 357 | //cout << "Starting matrix transpose\n" << flush << endl; |
| 358 | #ifdef OTEXT_TIMER |
| 359 | timeval transt1, transt2; |
| 360 | gettimeofday(&transt1, NULL); |
| 361 | #endif |
| 362 | // transpose in 128-bit chunks |
| 363 | if (ot_role & RECEIVER) |
| 364 | receiverOutputSlice.transpose(); |
| 365 | if (ot_role & SENDER) |
| 366 | senderOutputSlices[0].transpose(); |
| 367 | |
| 368 | #ifdef OTEXT_TIMER |
| 369 | gettimeofday(&transt2, NULL); |
| 370 | double transtime = timeval_diff(&transt1, &transt2); |
| 371 | cout << "\t\tMatrix transpose took time " << transtime/1000000 << endl << flush; |
| 372 | times["Matrix transpose"] += timeval_diff(&transt1, &transt2); |
| 373 | #endif |
| 374 | } |
| 375 | |
| 376 | /* |
| 377 | * Hash outputs to make into random OT |
no test coverage detected