Skip to content

Commit

Permalink
Bug in GF(2^n) bit generation with covert security (active security n…
Browse files Browse the repository at this point in the history
…ot implemented).
  • Loading branch information
mkskeller committed Sep 12, 2018
1 parent 72d0c71 commit 216eb0a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions FHEOffline/CutAndChooseMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class CutAndChooseMachine : public MultiplicativeMachine

public:
CutAndChooseMachine(int argc, const char** argv);

int get_covert() const { return sec; }
};

#endif /* FHEOFFLINE_CUTANDCHOOSEMACHINE_H_ */
2 changes: 2 additions & 0 deletions FHEOffline/Producer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,8 @@ gf2nBitProducer::gf2nBitProducer(const Player& P, const FHE_PK& pk, int covert,
Producer<P2Data>(thread_num, write_output),
write_output(write_output), ECB(P, pk, covert, Bits)
{
if (covert == 0)
throw not_implemented();
this->dir = dir;
if (write_output)
open_prep_file<gf2n_short>(outf, data_type(), P.my_num(), thread_num,
Expand Down
2 changes: 1 addition & 1 deletion FHEOffline/SimpleGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ SimpleGenerator<T,FD>::SimpleGenerator(const Names& N, const PartSetup<FD>& setu
thread_num, machine.output);
break;
case DATA_BIT:
producer = new_bit_producer(setup.FieldD, P, setup.pk, 0, true,
producer = new_bit_producer(setup.FieldD, P, setup.pk, machine.get_covert(), true,
thread_num, machine.output);
break;
case DATA_INVERSE:
Expand Down
5 changes: 5 additions & 0 deletions FHEOffline/SimpleMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ class MultiplicativeMachine : public MachineBase
void generate_setup(int slack);
template <class FD>
void fake_keys(int slack);

public:
virtual ~MultiplicativeMachine() {}

virtual int get_covert() const { return 0; }
};

class SimpleMachine : public MultiplicativeMachine
Expand Down

0 comments on commit 216eb0a

Please sign in to comment.