From f315e3a8126a6fe34eb188e8419032388b5e0e01 Mon Sep 17 00:00:00 2001 From: Peter Rindal Date: Tue, 1 Aug 2023 19:42:11 -0700 Subject: [PATCH] fixed examples with silver disabled --- CMakeLists.txt | 5 ++--- frontend/ExampleSilent.h | 6 +----- frontend/ExampleVole.h | 2 +- libOTe/Tools/EACode/EACode.h | 2 +- libOTe/TwoChooseOne/ConfigureCode.h | 16 ++++++++-------- 5 files changed, 13 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e49f6abc..e6a06caa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,11 +59,10 @@ if(DEFINED LIBOTE_CPP_VER) unset(LIBOTE_CPP_VER CACHE ) endif() if(NOT DEFINED LIBOTE_STD_VER) - set(LIBOTE_STD_VER 14) + set(LIBOTE_STD_VER 17) endif() if(NOT LIBOTE_STD_VER EQUAL 20 AND - NOT LIBOTE_STD_VER EQUAL 17 AND - NOT LIBOTE_STD_VER EQUAL 14) + NOT LIBOTE_STD_VER EQUAL 17) message(FATAL_ERROR "Unknown c++ version. LIBOTE_STD_VER=${LIBOTE_STD_VER}") endif() set(CRYPTO_TOOLS_STD_VER ${LIBOTE_STD_VER}) diff --git a/frontend/ExampleSilent.h b/frontend/ExampleSilent.h index ade930a9..e792ba73 100644 --- a/frontend/ExampleSilent.h +++ b/frontend/ExampleSilent.h @@ -28,11 +28,7 @@ namespace osuCrypto u64 trials = cmd.getOr("trials", 1); auto malicious = cmd.isSet("mal") ? SilentSecType::Malicious : SilentSecType::SemiHonest; -#ifdef ENABLE_BITPOLYMUL - auto multType = cmd.isSet("silver") ? MultType::slv5 : MultType::QuasiCyclic; -#else - auto multType = MultType::slv5; -#endif; + auto multType = (MultType)cmd.getOr("multType", (int)DefaultMultType); std::vector types; if (cmd.isSet("base")) diff --git a/frontend/ExampleVole.h b/frontend/ExampleVole.h index 9569677b..c8891879 100644 --- a/frontend/ExampleVole.h +++ b/frontend/ExampleVole.h @@ -24,7 +24,7 @@ namespace osuCrypto // get a random number generator seeded from the system PRNG prng(sysRandomSeed()); - auto mulType = (MultType)cmd.getOr("multType", (int)MultType::slv5); + auto mulType = (MultType)cmd.getOr("multType", (int)DefaultMultType); bool fakeBase = cmd.isSet("fakeBase"); u64 milli; diff --git a/libOTe/Tools/EACode/EACode.h b/libOTe/Tools/EACode/EACode.h index 8aeff760..bbe76ac4 100644 --- a/libOTe/Tools/EACode/EACode.h +++ b/libOTe/Tools/EACode/EACode.h @@ -18,7 +18,7 @@ namespace osuCrypto #else #define EA_CONSTEXPR #endif - // Teh encoder for the generator matrix G = B * A. + // The encoder for the generator matrix G = B * A. // B is the expander while A is the accumulator. // // B has mMessageSize rows and mCodeSize columns. It is sampled uniformly diff --git a/libOTe/TwoChooseOne/ConfigureCode.h b/libOTe/TwoChooseOne/ConfigureCode.h index 54d4e59b..47cbaa53 100644 --- a/libOTe/TwoChooseOne/ConfigureCode.h +++ b/libOTe/TwoChooseOne/ConfigureCode.h @@ -12,18 +12,18 @@ namespace osuCrypto QuasiCyclic = 1, #ifdef ENABLE_INSECURE_SILVER // https://eprint.iacr.org/2021/1150, see https://eprint.iacr.org/2023/882 for attack. - slv5, - slv11, + slv5 = 2, + slv11 = 3, #endif // https://eprint.iacr.org/2022/1014 - ExAcc7, // fast - ExAcc11,// fast but more conservative - ExAcc21, - ExAcc40, // conservative + ExAcc7 = 4, // fast + ExAcc11 = 5,// fast but more conservative + ExAcc21 = 6, + ExAcc40 = 7, // conservative // https://eprint.iacr.org/2023/882 - ExConv7x24, //fastest - ExConv21x24 // conservative. + ExConv7x24 = 8, //fastest + ExConv21x24 = 9 // conservative. }; inline std::ostream& operator<<(std::ostream& o, MultType m)