diff --git a/frontend/ExampleTwoChooseOne.cpp b/frontend/ExampleTwoChooseOne.cpp index 4dc5527..edce51c 100644 --- a/frontend/ExampleTwoChooseOne.cpp +++ b/frontend/ExampleTwoChooseOne.cpp @@ -32,34 +32,29 @@ namespace osuCrypto #ifdef ENABLE_SOFTSPOKEN_OT // soft spoken takes an extra parameter as input what determines // the computation/communication trade-off. - template + template using is_SoftSpoken = typename std::conditional< - //std::is_same::value || - //std::is_same::value || - //std::is_same::value || - //std::is_same::value || - //std::is_same::value || - //std::is_same::value || - //std::is_same::value || - //std::is_same::value - false - , - std::true_type, std::false_type>::type; + std::is_same>::value || + std::is_same>::value || + std::is_same::value || + std::is_same::value, + std::true_type, + std::false_type>::type; #else - template + template using is_SoftSpoken = std::false_type; #endif template typename std::enable_if::value, T>::type - construct(CLP& cmd) + construct(const CLP& cmd) { return T(cmd.getOr("f", 2)); } template typename std::enable_if::value, T>::type - construct(CLP& cmd) + construct(const CLP& cmd) { return T{}; } @@ -79,10 +74,8 @@ namespace osuCrypto PRNG prng(sysRandomSeed()); - - OtExtSender sender; - OtExtRecver receiver; - + OtExtSender sender = construct(cmd); + OtExtRecver receiver = construct(cmd); #ifdef LIBOTE_HAS_BASE_OT // Now compute the base OTs, we need to set them on the first pair of extenders. diff --git a/libOTe/TwoChooseOne/SoftSpokenOT/SoftSpokenMalOtExt.h b/libOTe/TwoChooseOne/SoftSpokenOT/SoftSpokenMalOtExt.h index 3e7502a..d7aaee3 100644 --- a/libOTe/TwoChooseOne/SoftSpokenOT/SoftSpokenMalOtExt.h +++ b/libOTe/TwoChooseOne/SoftSpokenOT/SoftSpokenMalOtExt.h @@ -153,6 +153,12 @@ namespace osuCrypto SoftSpokenMalOtSender() { init(); } + + SoftSpokenMalOtSender(u64 fieldBits) + { + init(fieldBits); + } + SoftSpokenMalOtSender(SoftSpokenMalOtSender&& o) = default; SoftSpokenMalOtSender& operator=(SoftSpokenMalOtSender&& o) = default; @@ -285,6 +291,13 @@ namespace osuCrypto { init(); } + + SoftSpokenMalOtReceiver(u64 fieldBits) + { + init(fieldBits); + } + + SoftSpokenMalOtReceiver(SoftSpokenMalOtReceiver&& o) :mBase(std::move(o.mBase)) ,mExtraV(std::move(o.mExtraV)) diff --git a/libOTe/TwoChooseOne/SoftSpokenOT/SoftSpokenShOtExt.h b/libOTe/TwoChooseOne/SoftSpokenOT/SoftSpokenShOtExt.h index 1e66876..58adb3d 100644 --- a/libOTe/TwoChooseOne/SoftSpokenOT/SoftSpokenShOtExt.h +++ b/libOTe/TwoChooseOne/SoftSpokenOT/SoftSpokenShOtExt.h @@ -101,6 +101,11 @@ namespace osuCrypto init(); } + SoftSpokenShOtSender(u64 fieldBits) + { + init(fieldBits); + } + SoftSpokenShOtSender(SoftSpokenShOtSender&& o) : mSubVole(std::move(o.mSubVole)) , mBlockIdx(std::exchange(o.mBlockIdx, 0)) @@ -281,6 +286,12 @@ namespace osuCrypto { init(); } + + SoftSpokenShOtReceiver(u64 fieldBits) + { + init(fieldBits); + } + SoftSpokenShOtReceiver(const SoftSpokenShOtReceiver&) = delete; SoftSpokenShOtReceiver(SoftSpokenShOtReceiver&& o) : mSubVole(std::move(o.mSubVole))