From ece151f09d3fadaad24911dd1e5958c30a2b0ac7 Mon Sep 17 00:00:00 2001 From: Peter Rindal Date: Mon, 29 Apr 2024 16:00:55 -0700 Subject: [PATCH] ci fixes --- frontend/benchmark.h | 2 +- .../TwoChooseOne/Iknp/IknpOtExtReceiver.cpp | 7 --- libOTe/TwoChooseOne/Iknp/IknpOtExtSender.cpp | 49 +++++++------------ libOTe_Tests/OT_Tests.cpp | 4 ++ libOTe_Tests/cmakeTests/CMakeLists.txt | 8 --- 5 files changed, 23 insertions(+), 47 deletions(-) diff --git a/frontend/benchmark.h b/frontend/benchmark.h index 40a812f1..a0822431 100644 --- a/frontend/benchmark.h +++ b/frontend/benchmark.h @@ -560,7 +560,7 @@ namespace osuCrypto { auto p0 = sender.silentSendInplace(delta, n, prng0, sock[0]); - char c; + char c = 0; coproto::sync_wait(sock[0].send(std::move(c))); coproto::sync_wait(sock[0].recv(c)); diff --git a/libOTe/TwoChooseOne/Iknp/IknpOtExtReceiver.cpp b/libOTe/TwoChooseOne/Iknp/IknpOtExtReceiver.cpp index 92a164d8..5ef58036 100644 --- a/libOTe/TwoChooseOne/Iknp/IknpOtExtReceiver.cpp +++ b/libOTe/TwoChooseOne/Iknp/IknpOtExtReceiver.cpp @@ -111,8 +111,6 @@ namespace osuCrypto uIter = (block*)uBuff.data(); uEnd = uIter + uBuff.size(); - std::cout << LOCATION << std::endl; - // NOTE: We do not transpose a bit-matrix of size numCol * numCol. // Instead we break it down into smaller chunks. We do 128 columns // times 8 * 128 rows at a time, where 8 = superBlkSize. This is done for @@ -169,12 +167,10 @@ namespace osuCrypto uEnd = uIter + uBuff.size(); } } - std::cout << LOCATION << std::endl; // transpose our 128 columns of 1024 bits. We will have 1024 rows, // each 128 bits wide. transpose128(t0.data()); - std::cout << LOCATION << std::endl; auto mEnd = mIter + std::min(128, messages.data() + messages.size() - mIter); @@ -194,7 +190,6 @@ namespace osuCrypto chl.send(cIter, sizeof(block) * superBlkSize); #endif } - std::cout << LOCATION << std::endl; if (mHash) { @@ -219,13 +214,11 @@ namespace osuCrypto } } #else - std::cout << LOCATION << std::endl; mAesFixedKey.hashBlocks(messages.data(), messages.size(), messages.data()); #endif } static_assert(gOtExtBaseOtCount == 128, "expecting 128"); - std::cout << LOCATION << std::endl; } } diff --git a/libOTe/TwoChooseOne/Iknp/IknpOtExtSender.cpp b/libOTe/TwoChooseOne/Iknp/IknpOtExtSender.cpp index 68070c16..d64040f8 100644 --- a/libOTe/TwoChooseOne/Iknp/IknpOtExtSender.cpp +++ b/libOTe/TwoChooseOne/Iknp/IknpOtExtSender.cpp @@ -40,27 +40,25 @@ namespace osuCrypto PRNG& prng, Socket& chl) { - auto numOtExt = u64{}; - auto numSuperBlocks = u64{}; - auto step = u64{}; - auto superBlkIdx = u64{}; - - // a temp that will be used to transpose the sender's matrix - auto t = AlignedUnVector{ 128 }; - auto u = AlignedUnVector(128 * commStepSize); - auto choiceMask = AlignedArray{}; - auto delta = block{}; - auto recvView = span{}; - auto mIter = span>::iterator{}; - auto uIter = (block*)nullptr; - auto tIter = (block*)nullptr; - auto cIter = (block*)nullptr; - auto uEnd = (block*)nullptr; - std::cout << LOCATION << std::endl; + auto numOtExt = u64{}; + auto numSuperBlocks = u64{}; + auto step = u64{}; + auto superBlkIdx = u64{}; + + // a temp that will be used to transpose the sender's matrix + auto t = AlignedUnVector{ 128 }; + auto u = AlignedUnVector(128 * commStepSize); + auto choiceMask = AlignedArray{}; + auto delta = block{}; + auto recvView = span{}; + auto mIter = span>::iterator{}; + auto uIter = (block*)nullptr; + auto tIter = (block*)nullptr; + auto cIter = (block*)nullptr; + auto uEnd = (block*)nullptr; if (hasBaseOts() == false) co_await genBaseOts(prng, chl); - std::cout << LOCATION << std::endl; // round up numOtExt = roundUpTo(messages.size(), 128); @@ -75,7 +73,6 @@ namespace osuCrypto if (mBaseChoiceBits[i]) choiceMask[i] = AllOneBlock; else choiceMask[i] = ZeroBlock; } - std::cout << LOCATION << std::endl; mIter = messages.begin(); uEnd = u.data() + u.size(); @@ -93,9 +90,8 @@ namespace osuCrypto recvView = span((u8*)u.data(), step); uIter = u.data(); - co_await (chl.recv(recvView)); + co_await(chl.recv(recvView)); } - std::cout << LOCATION << std::endl; mGens.ecbEncCounterMode(mPrngIdx, tIter); ++mPrngIdx; @@ -125,14 +121,11 @@ namespace osuCrypto uIter += 8; tIter += 8; } - std::cout << LOCATION << std::endl; // transpose our 128 columns of 1024 bits. We will have 1024 rows, // each 128 bits wide. transpose128(t.data()); - std::cout << LOCATION << std::endl; - auto mEnd = mIter + std::min(128, messages.end() - mIter); tIter = t.data(); @@ -176,7 +169,7 @@ namespace osuCrypto #ifdef IKNP_DEBUG fix this... - BitVector choice(128 * superBlkSize); + BitVector choice(128 * superBlkSize); chl.recv(u.data(), superBlkSize * 128 * sizeof(block)); chl.recv(choice.data(), sizeof(block) * superBlkSize); @@ -194,8 +187,6 @@ namespace osuCrypto #endif } - std::cout << LOCATION << std::endl; - if (mHash) { @@ -226,14 +217,10 @@ namespace osuCrypto } } #else - std::cout << LOCATION << std::endl; - mAesFixedKey.hashBlocks((block*)messages.data(), messages.size() * 2, (block*)messages.data()); } #endif - std::cout << LOCATION << std::endl; - static_assert(gOtExtBaseOtCount == 128, "expecting 128"); } diff --git a/libOTe_Tests/OT_Tests.cpp b/libOTe_Tests/OT_Tests.cpp index 6615ad1e..a07e06cf 100644 --- a/libOTe_Tests/OT_Tests.cpp +++ b/libOTe_Tests/OT_Tests.cpp @@ -825,10 +825,14 @@ namespace tests_libOTe sender.setBaseOts(baseRecv, baseChoice); auto proto1 = sender.send(sendMsg, prng1, sockets[1]); + std::cout << LOCATION << std::endl; eval(proto0, proto1); + std::cout << LOCATION << std::endl; + OT_100Receive_Test(choices, recvMsg, sendMsg); + std::cout << LOCATION << std::endl; for (auto& s : sendMsg) { diff --git a/libOTe_Tests/cmakeTests/CMakeLists.txt b/libOTe_Tests/cmakeTests/CMakeLists.txt index 92fc533c..1ecf2fde 100644 --- a/libOTe_Tests/cmakeTests/CMakeLists.txt +++ b/libOTe_Tests/cmakeTests/CMakeLists.txt @@ -3,18 +3,10 @@ project(cmakeTest) add_executable(main main.cpp) -if(SODIUM) - set(cryptoDep sodium) -else() - set(cryptoDep relic) -endif() - - find_package(libOTe REQUIRED HINTS ${LIBOTE_HINT} COMPONENTS - ${cryptoDep} #sodium #boost #openssl