Giter Club home page Giter Club logo

shamir's Introduction

Shamir Secret Sharing Algorithm

This is my personal fork of:

An implementation of Shamir's Secret Sharing Algorithm in Go

Copyright (C) 2015 Alexander Scheel, Joel May, Matthew Burket  
See Contributors.md for a complete list of contributors.  
Licensed under the MIT License.  

The repo has been changed in a number of ways:

  • Added a modular math package to wrap big.Int and directly do modular reductions
  • Simplified secret sharing to only handle messages under 256 bits leaving chunking of longer messages out (or up to user)
  • Added funtionality to interpolate via vandermonde matrices
  • Added some functions to help with circuit evaluation over (share addition, and beaver triples for multiplicative gates)

Usage

Secret sharing is done on byte-strings (smaller than 256-bit finite field of prime order) encoded directly. Shares are pairs of (x,y) points which can reconstruct the polynomial with lagrange polynomial interpolation. Basic splitting and reconstruction:

shares := shamir.Shares(threshold int, total int, raw []byte) // creates a set of shares

shamir.Reconstruct(shares []*Share) // combines shares into secret

// This is what the Share struct looks like
type Share struct {
    X *modular.Int
    Y *modular.Int
}

Functions for the easy utilization of additive homomorphic properties has been put into the package, as well as the basic underlying primitives necessary for multiplication gates. Some helpers for interpolating and reconstructing polynomials with inverted vandermonde matrices is also added here -- though in basic reconstruction of P(0) the Horner Method is used (because it's faster).

shamir's People

Stargazers

Leopard avatar

Watchers

 avatar

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.