You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Professor, hello, I have been trying to use the latest version of the SoftSpokenOT code from libOTe/libOTe/TwoChooseOne/SoftSpokenOT. However, I encountered an issue where the sender receives two identical messages, which leads to incorrect results. Here is the testing function I used:
void softSend(u32 numElements, Socket &chl, PRNG& prng, u32 numThreads, AlignedVector<std::array<block, 2>> &sMsgs, bool fakeBase)
{
SoftSpokenShOtSender<> sender;
sender.init(fieldBits, true);
const size_t numBaseOTs = sender.baseOtCount();
PRNG prngOT(prng.get<block>());
AlignedVector<block> baseMsg;
// choice bits for baseOT
BitVector baseChoice;
if (fakeBase) {
baseMsg.resize(numBaseOTs, ZeroBlock);
baseChoice.resize(numBaseOTs, 0);
} else {
// OTE's sender is base OT's receiver
DefaultBaseOT base;
baseMsg.resize(numBaseOTs);
// randomize the base OT's choice bits
baseChoice.resize(numBaseOTs);
baseChoice.randomize(prngOT);
// perform the base ot, call sync_wait to block until they have completed.
coproto::sync_wait(base.receive(baseChoice, baseMsg, prngOT, chl));
}
sender.setBaseOts(baseMsg, baseChoice);
// perform random ots
sMsgs.resize(numElements);
coproto::sync_wait(sender.send(sMsgs, prngOT, chl));
}
void softRecv(u32 numElements, BitVector bitV, Socket &chl, PRNG& prng, u32 numThreads, AlignedVector<block> &rMsgs, bool fakeBase)
{
SoftSpokenShOtReceiver<> receiver;
receiver.init(fieldBits, true);
const size_t numBaseOTs = receiver.baseOtCount();
AlignedVector<std::array<block, 2>> baseMsg(numBaseOTs);
PRNG prngOT(prng.get<block>());
if (fakeBase) {
baseMsg.resize(numBaseOTs);
for(auto & blk : baseMsg) {
blk[0] = ZeroBlock;
blk[1] = ZeroBlock;
}
} else {
// OTE's receiver is base OT's sender
DefaultBaseOT base;
// perform the base ot, call sync_wait to block until they have completed.
coproto::sync_wait(base.send(baseMsg, prngOT, chl));
}
receiver.setBaseOts(baseMsg);
rMsgs.resize(numElements);
coproto::sync_wait(receiver.receive(bitV, rMsgs, prngOT, chl));
}
When I tested with the following code, I found that sMsgs[i][1] is identical to sMsgs[i][0].
Professor, hello, I have been trying to use the latest version of the SoftSpokenOT code from libOTe/libOTe/TwoChooseOne/SoftSpokenOT. However, I encountered an issue where the sender receives two identical messages, which leads to incorrect results. Here is the testing function I used:
When I tested with the following code, I found that sMsgs[i][1] is identical to sMsgs[i][0].
Could you help me understand why this is happening and how to fix it?
Thank you!
The text was updated successfully, but these errors were encountered: