Skip to content

Commit

Permalink
Overdrive.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkskeller committed Mar 2, 2018
1 parent c6371c2 commit 2008a87
Show file tree
Hide file tree
Showing 267 changed files with 3,440 additions and 495 deletions.
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) 2017 University of Bristol. See License.txt
// (C) 2018 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) 2017 University of Bristol. See License.txt
// (C) 2018 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) 2017 University of Bristol. See License.txt
// (C) 2018 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) 2017 University of Bristol. See License.txt
// (C) 2018 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) 2017 University of Bristol. See License.txt
// (C) 2018 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) 2017 University of Bristol. See License.txt
// (C) 2018 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) 2017 University of Bristol. See License.txt
// (C) 2018 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) 2017 University of Bristol. See License.txt
// (C) 2018 University of Bristol. See License.txt


#ifndef _fake_stuff
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
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.3 (Mar 2, 2018)

- Added offline phases based on homomorphic encryption, used in the [SPDZ-2 paper](https://eprint.iacr.org/2012/642) and the [Overdrive paper](https://eprint.iacr.org/2017/1230).
- On macOS, the minimum requirement is now Sierra.
- Compilation with LLVM/clang is now possible (tested with 3.8).

## 0.0.2 (Sep 13, 2017)

### Support sockets based external client input and output to a SPDZ MPC program.
Expand Down
2 changes: 1 addition & 1 deletion CONFIG
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2017 University of Bristol. See License.txt
# (C) 2018 University of Bristol. See License.txt

ROOT = .

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

/*
* Check-Offline.cpp
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) 2017 University of Bristol. See License.txt
# (C) 2018 University of Bristol. See License.txt

import compilerLib, program, instructions, types, library, floatingpoint
import inspect
Expand Down
2 changes: 1 addition & 1 deletion Compiler/allocator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2017 University of Bristol. See License.txt
# (C) 2018 University of Bristol. See License.txt

import itertools, time
from collections import defaultdict, deque
Expand Down
2 changes: 1 addition & 1 deletion Compiler/comparison.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2017 University of Bristol. See License.txt
# (C) 2018 University of Bristol. See License.txt

"""
Functions for secure comparison of GF(p) types.
Expand Down
2 changes: 1 addition & 1 deletion Compiler/compilerLib.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2017 University of Bristol. See License.txt
# (C) 2018 University of Bristol. See License.txt

from Compiler.program import Program
from Compiler.config import *
Expand Down
2 changes: 1 addition & 1 deletion Compiler/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2017 University of Bristol. See License.txt
# (C) 2018 University of Bristol. See License.txt

from collections import defaultdict

Expand Down
2 changes: 1 addition & 1 deletion Compiler/dijkstra.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2017 University of Bristol. See License.txt
# (C) 2018 University of Bristol. See License.txt

from Compiler.oram import *

Expand Down
2 changes: 1 addition & 1 deletion Compiler/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2017 University of Bristol. See License.txt
# (C) 2018 University of Bristol. See License.txt

class CompilerError(Exception):
"""Base class for compiler exceptions."""
Expand Down
2 changes: 1 addition & 1 deletion Compiler/floatingpoint.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2017 University of Bristol. See License.txt
# (C) 2018 University of Bristol. See License.txt

from math import log, floor, ceil
from Compiler.instructions import *
Expand Down
2 changes: 1 addition & 1 deletion Compiler/graph.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2017 University of Bristol. See License.txt
# (C) 2018 University of Bristol. See License.txt

import heapq
from Compiler.exceptions import *
Expand Down
2 changes: 1 addition & 1 deletion Compiler/gs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2017 University of Bristol. See License.txt
# (C) 2018 University of Bristol. See License.txt

import sys
import math
Expand Down
2 changes: 1 addition & 1 deletion Compiler/instructions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2017 University of Bristol. See License.txt
# (C) 2018 University of Bristol. See License.txt

""" This module is for classes of actual assembly instructions.
Expand Down
2 changes: 1 addition & 1 deletion Compiler/instructions_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2017 University of Bristol. See License.txt
# (C) 2018 University of Bristol. See License.txt

import itertools
from random import randint
Expand Down
2 changes: 1 addition & 1 deletion Compiler/library.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2017 University of Bristol. See License.txt
# (C) 2018 University of Bristol. See License.txt

from Compiler.types import cint,sint,cfix,sfix,sfloat,MPCThread,Array,MemValue,cgf2n,sgf2n,_number,_mem,_register,regint,Matrix,_types, cfloat
from Compiler.instructions import *
Expand Down
2 changes: 1 addition & 1 deletion Compiler/oram.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2017 University of Bristol. See License.txt
# (C) 2018 University of Bristol. See License.txt

import random
import math
Expand Down
2 changes: 1 addition & 1 deletion Compiler/path_oram.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2017 University of Bristol. See License.txt
# (C) 2018 University of Bristol. See License.txt

if '_Array' not in dir():
from oram import *
Expand Down
2 changes: 1 addition & 1 deletion Compiler/permutation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2017 University of Bristol. See License.txt
# (C) 2018 University of Bristol. See License.txt

from random import randint
import math
Expand Down
2 changes: 1 addition & 1 deletion Compiler/program.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2017 University of Bristol. See License.txt
# (C) 2018 University of Bristol. See License.txt

from Compiler.config import *
from Compiler.exceptions import *
Expand Down
2 changes: 1 addition & 1 deletion Compiler/tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2017 University of Bristol. See License.txt
# (C) 2018 University of Bristol. See License.txt

import itertools

Expand Down
2 changes: 1 addition & 1 deletion Compiler/types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2017 University of Bristol. See License.txt
# (C) 2018 University of Bristol. See License.txt

from Compiler.program import Tape
from Compiler.exceptions import *
Expand Down
2 changes: 1 addition & 1 deletion Compiler/util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2017 University of Bristol. See License.txt
# (C) 2018 University of Bristol. See License.txt

import math
import operator
Expand Down
2 changes: 1 addition & 1 deletion Exceptions/Exceptions.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) 2017 University of Bristol. See License.txt
// (C) 2018 University of Bristol. See License.txt

#ifndef _Exceptions
#define _Exceptions
Expand Down
2 changes: 1 addition & 1 deletion ExternalIO/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(C) 2017 University of Bristol. See License.txt.
(C) 2018 University of Bristol. See License.txt.

The ExternalIO directory contains examples of managing I/O between external client processes and SPDZ parties running SPDZ engines. These instructions assume that SPDZ has been built as per the [project readme](../README.md).

Expand Down
2 changes: 1 addition & 1 deletion ExternalIO/bankers-bonus-client.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) 2017 University of Bristol. See License.txt
* (C) 2018 University of Bristol. See License.txt
*
* Demonstrate external client inputing and receiving outputs from a SPDZ process,
* following the protocol described in https://eprint.iacr.org/2015/1006.pdf.
Expand Down
6 changes: 3 additions & 3 deletions ExternalIO/bankers-bonus-commsec-client.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) 2017 University of Bristol. See License.txt
* (C) 2018 University of Bristol. See License.txt
*
* Demonstrate external client inputing and receiving outputs from a SPDZ process,
* following the protocol described in https://eprint.iacr.org/2015/1006.pdf.
Expand Down Expand Up @@ -274,10 +274,10 @@ void generate_symmetric_keys(vector<octet*>& keys, vector<int>& client_public_ke
keys[i] = new octet[crypto_generichash_BYTES];
keyfile.read((char*)server_publickey, crypto_box_PUBLICKEYBYTES);
if (keyfile.eof())
throw end_of_file(client_filename.str(), "server public key for party " + i);
throw end_of_file(client_filename.str(), "server public key for party " + to_string(i));
keyfile.read((char*)(&sts_key->server_publickey[i][0]), crypto_sign_PUBLICKEYBYTES);
if (keyfile.eof())
throw end_of_file(client_filename.str(), "server public signing key for party " + i);
throw end_of_file(client_filename.str(), "server public signing key for party " + to_string(i));

// Derive a shared key from this server's secret key and the client's public key
// shared key = h(q || client_secretkey || server_publickey)
Expand Down
17 changes: 14 additions & 3 deletions FHE/AddableVector.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) 2017 University of Bristol. See License.txt
// (C) 2018 University of Bristol. See License.txt

/*
* AddableVector.h
Expand All @@ -19,9 +19,15 @@ class AddableVector: public vector<T>
public:
AddableVector<T>() {}
AddableVector<T>(size_t n, const T& x = T()) : vector<T>(n, x) {}
AddableVector<T>(const FFT_Data& FTD) { (void)FTD; }
template <class U, class FD, class S>
AddableVector<T>(const Plaintext<U,FD,S>& other) : vector<T>(other.get_poly()) {}
AddableVector<T>(const Plaintext<U,FD,S>& other) :
AddableVector<T>(other.get_poly()) {}

template <class U>
AddableVector<T>(const vector<U>& other)
{
this->assign(other.begin(), other.end());
}

template <class U>
void allocate_slots(const U& init)
Expand Down Expand Up @@ -138,6 +144,11 @@ class AddableVector: public vector<T>
return res;
}

bool is_binary() const
{
throw not_implemented();
}

size_t report_size(ReportType type)
{
size_t res = 4;
Expand Down
2 changes: 1 addition & 1 deletion FHE/Ciphertext.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) 2017 University of Bristol. See License.txt
// (C) 2018 University of Bristol. See License.txt

#include "Ciphertext.h"
#include "Exceptions/Exceptions.h"
Expand Down
4 changes: 2 additions & 2 deletions FHE/Ciphertext.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) 2017 University of Bristol. See License.txt
// (C) 2018 University of Bristol. See License.txt

#ifndef _Ciphertext
#define _Ciphertext
Expand Down Expand Up @@ -66,7 +66,7 @@ class Ciphertext
friend void mul(Ciphertext& ans,const Ciphertext& c0,const Ciphertext& c1,const FHE_PK& pk);
template<class T,class FD,class S> friend void mul(Ciphertext& ans,const Plaintext<T,FD,S>& a,const Ciphertext& c);
template<class T,class FD,class S> friend void mul(Ciphertext& ans,const Ciphertext& c,const Plaintext<T,FD,S>& a)
{ mul(ans,a,c); }
{ ::mul(ans,a,c); }

void mul(const Ciphertext& c, const Rq_Element& a);

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


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

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


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

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

#include "FHE/FFT_Data.h"
#include "FHE/FFT.h"
Expand Down
4 changes: 3 additions & 1 deletion FHE/FFT_Data.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) 2017 University of Bristol. See License.txt
// (C) 2018 University of Bristol. See License.txt

#ifndef _FFT_Data
#define _FFT_Data
Expand Down Expand Up @@ -41,6 +41,8 @@ class FFT_Data

void init(const Ring& Rg,const Zp_Data& PrD);

void init_field() const { gfp::init_field(prData.pr); }

void pack(octetStream& o) const;
void unpack(octetStream& o);

Expand Down
Loading

0 comments on commit 2008a87

Please sign in to comment.