Skip to content

Commit

Permalink
ci fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ladnir committed Apr 29, 2024
1 parent 7d9c84b commit ece151f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 47 deletions.
2 changes: 1 addition & 1 deletion frontend/benchmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
7 changes: 0 additions & 7 deletions libOTe/TwoChooseOne/Iknp/IknpOtExtReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<u64>(128, messages.data() + messages.size() - mIter);
Expand All @@ -194,7 +190,6 @@ namespace osuCrypto
chl.send(cIter, sizeof(block) * superBlkSize);
#endif
}
std::cout << LOCATION << std::endl;

if (mHash)
{
Expand All @@ -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;
}

}
Expand Down
49 changes: 18 additions & 31 deletions libOTe/TwoChooseOne/Iknp/IknpOtExtSender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<block>{ 128 };
auto u = AlignedUnVector<block>(128 * commStepSize);
auto choiceMask = AlignedArray<block, 128>{};
auto delta = block{};
auto recvView = span<u8>{};
auto mIter = span<std::array<block, 2>>::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<block>{ 128 };
auto u = AlignedUnVector<block>(128 * commStepSize);
auto choiceMask = AlignedArray<block, 128>{};
auto delta = block{};
auto recvView = span<u8>{};
auto mIter = span<std::array<block, 2>>::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);
Expand All @@ -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();
Expand All @@ -93,9 +90,8 @@ namespace osuCrypto
recvView = span<u8>((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;
Expand Down Expand Up @@ -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<u64>(128, messages.end() - mIter);

tIter = t.data();
Expand Down Expand Up @@ -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);

Expand All @@ -194,8 +187,6 @@ namespace osuCrypto
#endif
}

std::cout << LOCATION << std::endl;

if (mHash)
{

Expand Down Expand Up @@ -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");
}

Expand Down
4 changes: 4 additions & 0 deletions libOTe_Tests/OT_Tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
8 changes: 0 additions & 8 deletions libOTe_Tests/cmakeTests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ece151f

Please sign in to comment.