osu-crypto / libOTe

A fast, portable, and easy to use Oblivious Transfer Library
Other
428 stars 107 forks source link

SoftSpokenOT doesn't work when using non-power-of-two as the fieldBits parameter #131

Closed sachaservan closed 7 months ago

sachaservan commented 7 months ago

When running SoftSpokenOT from the frontend with parameter "-f" set to anything other than a power of 2 causes the front-end to immediately exit. This issue can be narrowed down to:

if ((u64)delta_.size() != baseOtCount())
    throw RTE_LOC;

in SmallFieldVole.cpp, where delta_.size() = 128 while baseOTCount() = 129 (with "-f 3"). However, changing this if statement to check the rounded version computed with roundUpTo() causes downstream checks to fails. There is probably a very simple fix but I couldn't figure it out. In particular, I believe that setting the size of baseMsg correctly in ExampleTwoChooseOne.cpp should help? However, this needs to be done conditionally, based on whether SoftSpoken or another 1-out-of-2 OT protocol is being run.

ladnir commented 7 months ago

kk, ill look into it

ladnir commented 7 months ago

fixed in master, more issues with the example code.