mirror of
https://github.com/data61/MP-SPDZ.git
synced 2026-04-20 03:01:31 -04:00
Encrypted communication for replicated secret sharing.
This commit is contained in:
@@ -1319,6 +1319,7 @@ public:
|
||||
// How to layout usage descriptions with the option flags.
|
||||
enum Layout { ALIGN, INTERLEAVE, STAGGER };
|
||||
|
||||
inline ezOptionParser();
|
||||
inline ~ezOptionParser();
|
||||
|
||||
inline void add(const char * defaults, bool required, int expectArgs, char delim, const char * help, const char * flag1, ezOptionValidator* validator=0);
|
||||
@@ -1368,6 +1369,10 @@ public:
|
||||
std::map< int, int > groupValidators;
|
||||
};
|
||||
/* ################################################################### */
|
||||
ezOptionParser::ezOptionParser() {
|
||||
reset();
|
||||
}
|
||||
/* ################################################################### */
|
||||
ezOptionParser::~ezOptionParser() {
|
||||
reset();
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "octetStream.h"
|
||||
#include <string.h>
|
||||
#include "Networking/sockets.h"
|
||||
#include "Networking/ssl_sockets.h"
|
||||
#include "Tools/sha1.h"
|
||||
#include "Exceptions/Exceptions.h"
|
||||
#include "Networking/data.h"
|
||||
@@ -184,7 +185,8 @@ void octetStream::get(bigint& ans)
|
||||
}
|
||||
|
||||
|
||||
void octetStream::exchange(int send_socket, int receive_socket, octetStream& receive_stream)
|
||||
template<class T>
|
||||
void octetStream::exchange(T send_socket, T receive_socket, octetStream& receive_stream)
|
||||
{
|
||||
send(send_socket, len, LENGTH_SIZE);
|
||||
const size_t buffer_size = 100000;
|
||||
@@ -372,5 +374,5 @@ ostream& operator<<(ostream& s,const octetStream& o)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template void octetStream::exchange(int, int);
|
||||
template void octetStream::exchange(ssl_socket*, ssl_socket*);
|
||||
|
||||
@@ -133,8 +133,10 @@ class octetStream
|
||||
s.len=l;
|
||||
}
|
||||
|
||||
void Send(int socket_num) const;
|
||||
void Receive(int socket_num);
|
||||
template<class T>
|
||||
void Send(T& socket_num) const;
|
||||
template<class T>
|
||||
void Receive(T& socket_num);
|
||||
void ReceiveExpected(int socket_num, size_t expected);
|
||||
|
||||
// In-place authenticated encryption using sodium; key of length crypto_generichash_BYTES
|
||||
@@ -153,8 +155,10 @@ class octetStream
|
||||
void input(istream& s);
|
||||
void output(ostream& s);
|
||||
|
||||
void exchange(int send_socket, int receive_socket) { exchange(send_socket, receive_socket, *this); }
|
||||
void exchange(int send_socket, int receive_socket, octetStream& receive_stream);
|
||||
template<class T>
|
||||
void exchange(T send_socket, T receive_socket) { exchange(send_socket, receive_socket, *this); }
|
||||
template<class T>
|
||||
void exchange(T send_socket, T receive_socket, octetStream& receive_stream);
|
||||
|
||||
friend ostream& operator<<(ostream& s,const octetStream& o);
|
||||
friend class PRNG;
|
||||
@@ -226,14 +230,16 @@ inline size_t octetStream::get_int(int n_bytes)
|
||||
}
|
||||
|
||||
|
||||
inline void octetStream::Send(int socket_num) const
|
||||
template<class T>
|
||||
inline void octetStream::Send(T& socket_num) const
|
||||
{
|
||||
send(socket_num,len,LENGTH_SIZE);
|
||||
send(socket_num,data,len);
|
||||
}
|
||||
|
||||
|
||||
inline void octetStream::Receive(int socket_num)
|
||||
template<class T>
|
||||
inline void octetStream::Receive(T& socket_num)
|
||||
{
|
||||
size_t nlen=0;
|
||||
receive(socket_num,nlen,LENGTH_SIZE);
|
||||
|
||||
Reference in New Issue
Block a user