Skip to content

simonkamp/unconditional-mpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unconditional-mpc

unconditional-mpc is an MPC framework.

It contains a compiler, written in Python, for translating programs in a simple imperative language into a list of instructions.

It contains a runtime, written in Golang, which allows several parties to run the protocol specified by such a list of instructions.

Installation

First install Python and Go, and clone repository.

To run the compiler, the package 'ply' must be installed. First install pip, if not done already. Then run the following:

python -m pip install ply

Running compiler

To compile a program, the general command is:

python compile_script.py input_path -o output_path

To test that this works, try running the following:

python compile_script.py example_programs/input.txt -o instructions.txt

This should result in the following appearing in instructions.txt:

INPUT 1 a
INPUT 2 b
PLUS a b sum
OUTPUT sum output

Using the runtime

For each party that provides an input to the protocol, the input must be stored in a file of the format:

a = 42

The runtime can be executed from the src directory using the command:

go run main.go program_path input_path_prefix config_path

Where program_path is the path to the instructions generated by the compiler, input_path_prefix is a prefix of the path to the file storing a node's input using the convention that each node's input file has the index of the node appended to it.

config_path is an optional path to a file specifying the parameters of the secret sharing scheme, i.e. the number of participants, the threshold and the prime defining the field. They are specified in the format:

p 4001
n 11
t 5

Not providing any arguments to the runtime will run a test specified in main.go equivalent of providing the arguments:

go run main.go player/tests/compiled/prog player/tests/compiled/input player/tests/compiled/config

Language guide

For a specification of the source language used for writing programs to the compiler, please see the project report pdf.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published