forked from bristolcrypto/SPDZ-2
-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
71 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Rep4Prep.cpp | ||
* | ||
*/ | ||
|
||
#include "Rep4Prep.h" | ||
|
||
#include "Protocols/Rep4.hpp" | ||
#include "Protocols/Rep4Input.hpp" | ||
#include "Protocols/ReplicatedPrep.hpp" | ||
|
||
namespace GC | ||
{ | ||
|
||
Rep4Prep::Rep4Prep(DataPositions& usage, int) : | ||
BufferPrep<Rep4Secret>(usage) | ||
{ | ||
} | ||
|
||
void Rep4Prep::set_protocol(Rep4Secret::Protocol& protocol) | ||
{ | ||
this->P = &protocol.P; | ||
} | ||
|
||
void Rep4Prep::buffer_bits() | ||
{ | ||
assert(P); | ||
Rep4<Rep4Secret> proto(*P); | ||
for (int i = 0; i < OnlineOptions::singleton.batch_size; i++) | ||
this->bits.push_back(proto.get_random() & 1); | ||
} | ||
|
||
} /* namespace GC */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Rep4Prep.h | ||
* | ||
*/ | ||
|
||
#ifndef GC_REP4PREP_H_ | ||
#define GC_REP4PREP_H_ | ||
|
||
#include "Rep4Secret.h" | ||
#include "PersonalPrep.h" | ||
#include "Protocols/ReplicatedPrep.h" | ||
|
||
namespace GC | ||
{ | ||
|
||
class Rep4Prep : public BufferPrep<Rep4Secret> | ||
{ | ||
public: | ||
Rep4Prep(DataPositions& usage, int _ = -1); | ||
|
||
void set_protocol(Rep4Secret::Protocol& protocol); | ||
|
||
void buffer_bits(); | ||
}; | ||
|
||
} /* namespace GC */ | ||
|
||
#endif /* GC_REP4PREP_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
*/ | ||
|
||
#include "Rep4.h" | ||
#include "GC/square64.h" | ||
#include "Processor/TruncPrTuple.h" | ||
|
||
template<class T> | ||
|