Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions emp-ot/emp-ot/ferret/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class PrimalLPNParameter { public:
const static PrimalLPNParameter ferret_b13 = PrimalLPNParameter(10485760, 1280, 452000, 13, 470016, 918, 32768, 9);
const static PrimalLPNParameter ferret_b12 = PrimalLPNParameter(10268672, 2507, 238000, 12, 268800, 1050, 17384, 8);
const static PrimalLPNParameter ferret_b11 = PrimalLPNParameter(10180608, 4971, 124000, 11, 178944, 699, 17384, 8);
const static PrimalLPNParameter ferret_b10 = PrimalLPNParameter(1024*2048, 2048, 65536, 10, 86272, 337, 16384, 8);

}//namespace
#endif //EMP_FERRET_CONSTANTS_H__
6 changes: 3 additions & 3 deletions emp-zk/emp-zk/emp-zk-bool/emp-zk-bool.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@

namespace emp {
template<typename IO>
inline void setup_zk_bool(IO** ios, int threads, int party, void * state = nullptr) {
inline void setup_zk_bool(IO** ios, int threads, int party, void * state = nullptr, const PrimalLPNParameter* lpn_param = &ferret_b10) {
CheatRecord::reset();
if(party == ALICE) {
ZKBoolCircExecPrv<IO> * t = new ZKBoolCircExecPrv<IO>();
CircuitExecution::circ_exec = t;
ProtocolExecution::prot_exec = new ZKProver<IO>(ios, threads, t, state);
ProtocolExecution::prot_exec = new ZKProver<IO>(ios, threads, t, state, lpn_param);
} else {
ZKBoolCircExecVer<IO> * t = new ZKBoolCircExecVer<IO>();
CircuitExecution::circ_exec = t;
ProtocolExecution::prot_exec = new ZKVerifier<IO>(ios, threads, t, state);
ProtocolExecution::prot_exec = new ZKVerifier<IO>(ios, threads, t, state, lpn_param);
}
}

Expand Down
13 changes: 9 additions & 4 deletions emp-zk/emp-zk/emp-zk-bool/ostriple.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,19 @@ class OSTriple {
ThreadPool *pool = nullptr;
void * ferret_state = nullptr;

OSTriple (int party, int threads, IO **ios, void * state = nullptr) {
OSTriple (int party, int threads, IO **ios, void * state = nullptr, const PrimalLPNParameter* lpn_param = nullptr) {
this->party = party;
this->threads = threads;
this->ferret_state = state;
// initiate Iterative COT with regular noise and security against malicious adv
if(ferret_state == nullptr)
// ferret = new FerretCOT<IO>(3-party, threads, ios, true);
ferret = new FerretCOT<IO>(3-party, threads, ios, true, true, PrimalLPNParameter(1024*2048, 2048, 65536, 10, 86272, 337, 16384, 8));
if(ferret_state == nullptr) {
if (lpn_param == nullptr) {
ferret = new FerretCOT<IO>(3-party, threads, ios, true, true, ferret_b10);
}
else {
ferret = new FerretCOT<IO>(3-party, threads, ios, true, true, *lpn_param);
}
}
else {
ferret = new FerretCOT<IO>(3-party, threads, ios, true, false);
ferret->disassemble_state(ferret_state, 10400000);
Expand Down
4 changes: 2 additions & 2 deletions emp-zk/emp-zk/emp-zk-bool/zk_prover.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ class ZKProver: public ProtocolExecution {
OSTriple<IO> *ostriple = nullptr;
PolyProof<IO> *polyproof = nullptr;
ZKBoolCircExecPrv<IO> *gen = nullptr;
ZKProver(IO** ios, int threads, ZKBoolCircExecPrv<IO> *t, void * state): ProtocolExecution(ALICE) {
ZKProver(IO** ios, int threads, ZKBoolCircExecPrv<IO> *t, void * state, const PrimalLPNParameter* lpn_param = &ferret_b10): ProtocolExecution(ALICE) {
this->io = ios[0];
this->gen = t;
ostriple = new OSTriple<IO>(ALICE, threads, ios, state);
ostriple = new OSTriple<IO>(ALICE, threads, ios, state, lpn_param);
polyproof = new PolyProof<IO>(ALICE, ios[0], ostriple->ferret);
t->template set_ostriple<IO>(ostriple);
t->polyproof = this->polyproof;
Expand Down
4 changes: 2 additions & 2 deletions emp-zk/emp-zk/emp-zk-bool/zk_verifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ class ZKVerifier: public ProtocolExecution {
OSTriple<IO>* ostriple = nullptr;
PolyProof<IO> *polyproof = nullptr;
ZKBoolCircExecVer<IO> *eva = nullptr;
ZKVerifier(IO **ios, int threads, ZKBoolCircExecVer<IO> *t, void * state): ProtocolExecution(BOB) {
ZKVerifier(IO **ios, int threads, ZKBoolCircExecVer<IO> *t, void * state, const PrimalLPNParameter* lpn_param = &ferret_b10): ProtocolExecution(BOB) {
this->io = ios[0];
ostriple = new OSTriple<IO>(BOB, threads, ios, state);
ostriple = new OSTriple<IO>(BOB, threads, ios, state, lpn_param);
polyproof = new PolyProof<IO>(BOB, ios[0], ostriple->ferret);
polyproof->delta = ostriple->delta;
t->template set_ostriple<IO>(ostriple);
Expand Down
Loading