Giter VIP home page Giter VIP logo

secure-computation-library's Introduction

SCL โ€” Secure Computation Library

SCL is a utilities library for prototyping Secure Multiparty Computation (MPC for short) protocols. The focus of SCL is usability, not necessarily speed. What this means is that SCL strives to provide an intuitive, easy to use and understand, and well documented interface that helps the programmer prototype an MPC protocol faster (and nicer) than if they had to write everything themselves.

SCL provides high level interfaces and functionality for working with

  • Secret sharing, additive and Shamir.
  • Finite fields.
  • Primitives, such as hash functions and PRGs.

SCL in addition provides methods for running protocols on both a real network, where each party is connected via TCP, as well as a simulated network.

Disclaimer

SCL is distributed under the GNU Affero General Public License, for details, refer to LICENSE or https://www.gnu.org/licenses/.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Building SCL

SCL uses gmp for working with Elliptic Curves, and catch2 for testing and lcov for test coverage.

The CMake file recongnizes two different build types: Debug and Release, the latter being the default. In either case, building is straight forward and can be done with the commands

cmake . -B build -DCMAKE_BUILD_TYPE=<Debug|Release>
cmake --build build

In case the Release build is used, SCL can be installed by running

sudo cmake --install build

after the build command. By default, headers are install in usr/local/include and the shared library in /usr/local/lib. This location can be controlled by setting the CMAKE_INSTALL_PREFIX accordingly.

Support for Elliptic Curves can be disabled (and thus remove the need to have gmp installed) by passing -DWITH_EC=OFF to cmake.

Using SCL

To use SCL, link libscl.so when building your program and include the include/ directory to your builds includes. The test folder is a good place to see examples of how the different functionality works.

Documentation

SCL uses Doxygen for documentation, which can be generated by running make documentation from within the build folder. The generated documentation is placed in the doc folder.

Citing

I'd greatly appreciate any work that uses SCL include the below bibtex entry

@misc{secure-computation-library,
    author = {Anders Dalskov},        
    title = {{SCL (Secure Computation Library)---utility library for prototyping MPC applications}},
    howpublished = {\url{https://github.com/anderspkd/secure-computation-library}},
}

secure-computation-library's People

Contributors

anderspkd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

secure-computation-library's Issues

Replace simulation manager interface with a builder

The sim::Manager interface is a bit bothersome to handle from a user's point of view.
A much better design would be to construct a Manager using a builder. This has a number of benefits:

  • No need to pass around an std::unique_ptr for the manager.
  • Easier to customize the simulation. E.g., no need to subclass some particular subclass of sim::Manager and then pass an std::ostream object to the constructor in order to output results to a file. Something like builder.setOutput(some_stream) should do the trick.
  • Allows making the object that the builder builds (the manager) be responsible for also running the simulation.

Builder proposal:

class SimulationBuilder {
public:
  static SimulationBuilder create();
  SimulationBuilder& outputTo(const std::string& filename);
  SimulationBuilder& outputToStdout();
  template <typename FUNC>
  SimulationBuilder& protocolCreator(FUNC&& creator);
  SimulationBuilder& networkConfig(...);
  
  Simulator build();
};

auto builder = SimulationBuilder::create();
// bla bla

auto simulator = builder.build();

// runs the simulation
simulator.run();

Inconsistent semantics for channel related events

Currently there are two channel related events: sim::EventType::SEND and sim::EventType::RECV. The former is created when data is sent, while the latter is created when data is read from a channel.

Therefore, sim::EvenType::SEND models the data that goes onto a network, but sim::EventType::RECV only models the data from the network that is useful to a protocol. This creates a skewed interpretation of results, and may make a network seem less saturated than it actually is (e.g., consider a protocol where everyone sends a message to everyone else, but only reads the message sent by e.g., party 0.)

Changes
Rename sim::EventType::RECV to sim::EventType::READ and update documentation to make it clear what it models.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.