Skip to content

Commit

Permalink
Release to add compiler instructions for external client I/O.
Browse files Browse the repository at this point in the history
  • Loading branch information
risingnote committed Sep 14, 2017
1 parent 3ee4e9e commit 987a782
Show file tree
Hide file tree
Showing 172 changed files with 4,322 additions and 856 deletions.
39 changes: 38 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,42 @@ Player-Data/*
Prep-Data/*
logs/*
Language-Definition/main.pdf
keys/*

# Personal CONFIG file #
##############################
CONFIG.mine
config_mine.py

# Temporary files #
###################
*.bak
*.orig
*.rej
*.tmp
callgrind.out.*

# Vim
.*.swp
tags

# Eclipse #
###########
.project
.cproject
.settings

# VS Code IDE #
###############
.vscode/**

# Temporary files #
###################
*.bak
*.orig
*.rej
*.tmp
callgrind.out.*

# Compiled source #
###################
Expand All @@ -25,6 +57,8 @@ Programs/Public-Input/*
*.bc
*.sch
*.a
*.static
*.d

# Packages #
############
Expand Down Expand Up @@ -59,6 +93,8 @@ Programs/Public-Input/*
*.log
*.sql
*.sqlite
*.data
Persistence/*

# OS generated files #
######################
Expand All @@ -69,4 +105,5 @@ Programs/Public-Input/*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
Thumbs.db
**/*.x.dSYM/**
2 changes: 1 addition & 1 deletion Auth/MAC_Check.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) 2016 University of Bristol. See License.txt
// (C) 2017 University of Bristol. See License.txt


#include "Auth/MAC_Check.h"
Expand Down
2 changes: 1 addition & 1 deletion Auth/MAC_Check.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) 2016 University of Bristol. See License.txt
// (C) 2017 University of Bristol. See License.txt

#ifndef _MAC_Check
#define _MAC_Check
Expand Down
2 changes: 1 addition & 1 deletion Auth/Subroutines.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) 2016 University of Bristol. See License.txt
// (C) 2017 University of Bristol. See License.txt


#include "Auth/Subroutines.h"
Expand Down
2 changes: 1 addition & 1 deletion Auth/Subroutines.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) 2016 University of Bristol. See License.txt
// (C) 2017 University of Bristol. See License.txt

#ifndef _Subroutines
#define _Subroutines
Expand Down
2 changes: 1 addition & 1 deletion Auth/Summer.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) 2016 University of Bristol. See License.txt
// (C) 2017 University of Bristol. See License.txt

/*
* Summer.cpp
Expand Down
2 changes: 1 addition & 1 deletion Auth/Summer.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) 2016 University of Bristol. See License.txt
// (C) 2017 University of Bristol. See License.txt

/*
* Summer.h
Expand Down
2 changes: 1 addition & 1 deletion Auth/fake-stuff.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) 2016 University of Bristol. See License.txt
// (C) 2017 University of Bristol. See License.txt


#include "Math/gf2n.h"
Expand Down
2 changes: 1 addition & 1 deletion Auth/fake-stuff.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) 2016 University of Bristol. See License.txt
// (C) 2017 University of Bristol. See License.txt


#ifndef _fake_stuff
Expand Down
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
The changelog explains changes pulled through from the private development repository. Bug fixes and small enchancements are committed between releases and not documented here.

## 0.0.2 (Sep 13, 2017)

### Support sockets based external client input and output to a SPDZ MPC program.

See the [ExternalIO directory](./ExternalIO/README.md) for more details and examples.

Note that [libsodium](https://download.libsodium.org/doc/) is now a dependency on the SPDZ build.

Added compiler instructions:

* LISTEN
* ACCEPTCLIENTCONNECTION
* CONNECTIPV4
* WRITESOCKETSHARE
* WRITESOCKETINT

Removed instructions:

* OPENSOCKET
* CLOSESOCKET

Modified instructions:

* READSOCKETC
* READSOCKETS
* READSOCKETINT
* WRITESOCKETC
* WRITESOCKETS

Support secure external client input and output with new instructions:

* READCLIENTPUBLICKEY
* INITSECURESOCKET
* RESPSECURESOCKET

### Read/Write secret shares to disk to support persistence in a SPDZ MPC program.

Added compiler instructions:

* READFILESHARE
* WRITEFILESHARE

### Other instructions

Added compiler instructions:

* DIGESTC - Clear truncated hash computation
* PRINTINT - Print register value

## 0.0.1 (Sep 2, 2016)

### Initial Release

* See `README.md` and `tutorial.md`.
6 changes: 3 additions & 3 deletions CONFIG
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2016 University of Bristol. See License.txt
# (C) 2017 University of Bristol. See License.txt

ROOT = .

Expand Down Expand Up @@ -28,7 +28,7 @@ endif
# Default is 3, which suffices for 128-bit p
# MOD = -DMAX_MOD_SZ=3

LDLIBS = -lmpirxx -lmpir $(MY_LDLIBS) -lm -lpthread
LDLIBS = -lmpirxx -lmpir -lsodium $(MY_LDLIBS) -lm -lpthread

ifeq ($(USE_NTL),1)
LDLIBS := -lntl $(LDLIBS)
Expand All @@ -40,7 +40,7 @@ LDLIBS += -lrt
endif

CXX = g++
CFLAGS = $(MY_CFLAGS) -g -Wextra -Wall $(OPTIM) -I$(ROOT) -pthread $(PROF) $(DEBUG) $(MOD) $(MEMPROTECT) $(GF2N_LONG) $(PREP_DIR) -maes -mpclmul -msse4.1 $(ARCH)
CFLAGS = $(MY_CFLAGS) -g -Wextra -Wall $(OPTIM) -I$(ROOT) -pthread $(PROF) $(DEBUG) $(MOD) $(MEMPROTECT) $(GF2N_LONG) $(PREP_DIR) -maes -mpclmul -msse4.1 $(ARCH) --std=c++11 -Werror
CPPFLAGS = $(CFLAGS)
LD = g++

66 changes: 39 additions & 27 deletions Check-Offline.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) 2016 University of Bristol. See License.txt
// (C) 2017 University of Bristol. See License.txt

/*
* Check-Offline.cpp
Expand Down Expand Up @@ -62,21 +62,27 @@ void check_bits(const T& key,int N,vector<Data_Files*>& dataF,DataFieldType fiel
vector<Share<T> > Sa(N),Sb(N),Sc(N);
int n = 0;

while (!dataF[0]->eof<T>(DATA_BIT))
{
for (int i = 0; i < N; i++)
dataF[i]->get_one(field_type, DATA_BIT, Sa[i]);
check_share(Sa, a, mac, N, key);

if (!(a.is_zero() || a.is_one()))
try {
while (!dataF[0]->eof<T>(DATA_BIT))
{
cout << n << ": " << a << " neither 0 or 1" << endl;
throw bad_value();
for (int i = 0; i < N; i++)
dataF[i]->get_one(field_type, DATA_BIT, Sa[i]);
check_share(Sa, a, mac, N, key);

if (!(a.is_zero() || a.is_one()))
{
cout << n << ": " << a << " neither 0 or 1" << endl;
throw bad_value();
}
n++;
}
n++;
}

cout << n << " bits of type " << T::type_string() << endl;
cout << n << " bits of type " << T::type_string() << endl;
}
catch (exception& e)
{
cout << "Error with bits of type " << T::type_string() << endl;
}
}

template<class T>
Expand All @@ -85,20 +91,26 @@ void check_inputs(const T& key,int N,vector<Data_Files*>& dataF)
T a, mac, x;
vector< Share<T> > Sa(N);

for (int player = 0; player < N; player++)
{
int n = 0;
while (!dataF[0]->input_eof<T>(player))
{
for (int i = 0; i < N; i++)
dataF[i]->get_input(Sa[i], x, player);
check_share(Sa, a, mac, N, key);
if (!a.equal(x))
throw bad_value();
n++;
}
cout << n << " input masks for player " << player << " of type " << T::type_string() << endl;
}
try {
for (int player = 0; player < N; player++)
{
int n = 0;
while (!dataF[0]->input_eof<T>(player))
{
for (int i = 0; i < N; i++)
dataF[i]->get_input(Sa[i], x, player);
check_share(Sa, a, mac, N, key);
if (!a.equal(x))
throw bad_value();
n++;
}
cout << n << " input masks for player " << player << " of type " << T::type_string() << endl;
}
}
catch (exception& e)
{
cout << "Error with inputs of type " << T::type_string() << endl;
}
}

int main(int argc, const char** argv)
Expand Down
2 changes: 1 addition & 1 deletion Compiler/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2016 University of Bristol. See License.txt
# (C) 2017 University of Bristol. See License.txt

import compilerLib, program, instructions, types, library, floatingpoint
import inspect
Expand Down
Loading

0 comments on commit 987a782

Please sign in to comment.