Skip to content

Commit

Permalink
Merge pull request #147 from mpc-msri/prgfix
Browse files Browse the repository at this point in the history
Fix PRG bugs in FSS
  • Loading branch information
kanav99 authored Aug 2, 2022
2 parents b8ee085 + c90fbaf commit 8b4d2ff
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 425 deletions.
4 changes: 1 addition & 3 deletions FSS/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ add_library(fss STATIC
deps/cryptoTools/cryptoTools/Common/Log.cpp
deps/cryptoTools/cryptoTools/Crypto/AES.cpp
deps/cryptoTools/cryptoTools/Crypto/PRNG.cpp
group_element.cpp
prng.cpp
comms.cpp
dcf.cpp
utils.cpp
Expand All @@ -34,7 +34,6 @@ add_library(fss STATIC
conv.cpp
pubdiv.cpp
spline.cpp
mini_aes.cpp
input_prng.cpp
)

Expand Down Expand Up @@ -85,7 +84,6 @@ install(FILES
"add.h"
"mult.h"
"pubdiv.h"
"mini_aes.h"
"input_prng.h"
"config.h"
DESTINATION include)
Expand Down
5 changes: 2 additions & 3 deletions FSS/src/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ SOFTWARE.
#include "mult.h"
#include "pubdiv.h"
#include "dcf.h"
#include "mini_aes.h"
#include "input_prng.h"
#include <cassert>
#include <iostream>
Expand Down Expand Up @@ -62,7 +61,6 @@ void StartComputation()
std::cerr << "=== COMPUTATION START ===\n\n";
std::cerr << "bitlength = " << bitlength << std::endl;
std::cerr << "local truncation = " << (localTruncation ? "yes" : "no") << std::endl << std::endl;
aes_init();

if (party != DEALER)
peer->sync();
Expand All @@ -87,7 +85,8 @@ void StartComputation()
}

if (party == DEALER) {
auto commonSeed = aes_enc(toBlock(0, time(NULL)), 0);
AES aesSeed(toBlock(0, time(NULL)));
auto commonSeed = aesSeed.ecbEncBlock(ZeroBlock);
server->send_block(commonSeed);
prngShared.SetSeed(commonSeed);
}
Expand Down
5 changes: 2 additions & 3 deletions FSS/src/api_varied.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ SOFTWARE.
#include "mult.h"
#include "dcf.h"
#include "group_element.h"
#include "mini_aes.h"
#include "pubdiv.h"
#include "spline.h"
#include "utils.h"
Expand Down Expand Up @@ -62,7 +61,6 @@ template <typename T> using pair = std::pair<T,T>;
void initialize()
{
std::cerr << "=== COMPUTATION START ===\n\n";
aes_init();

if (party != DEALER) {
if (party == SERVER) {
Expand All @@ -86,7 +84,8 @@ void initialize()
}

if (party == DEALER) {
auto commonSeed = aes_enc(toBlock(0, time(NULL)), 0);
AES aesSeed(toBlock(0, time(NULL)));
auto commonSeed = aesSeed.ecbEncBlock(ZeroBlock);
server->send_block(commonSeed);
prngShared.SetSeed(commonSeed);
}
Expand Down
Loading

0 comments on commit 8b4d2ff

Please sign in to comment.