mirror of
https://github.com/data61/MP-SPDZ.git
synced 2026-01-10 05:57:57 -05:00
Random bit generation in Rep4.
This commit is contained in:
33
GC/Rep4Prep.cpp
Normal file
33
GC/Rep4Prep.cpp
Normal file
@@ -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 */
|
||||
28
GC/Rep4Prep.h
Normal file
28
GC/Rep4Prep.h
Normal file
@@ -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_ */
|
||||
@@ -13,13 +13,15 @@
|
||||
namespace GC
|
||||
{
|
||||
|
||||
class Rep4Prep;
|
||||
|
||||
class Rep4Secret : public RepSecretBase<Rep4Secret, 3>
|
||||
{
|
||||
typedef RepSecretBase<Rep4Secret, 3> super;
|
||||
typedef Rep4Secret This;
|
||||
|
||||
public:
|
||||
typedef DummyLivePrep<This> LivePrep;
|
||||
typedef Rep4Prep LivePrep;
|
||||
typedef Rep4<This> Protocol;
|
||||
typedef Rep4MC<This> MC;
|
||||
typedef MC MAC_Check;
|
||||
|
||||
Reference in New Issue
Block a user