Git Product home page Git Product logo

sumcheck's Introduction

Sum-check ๐Ÿ”

A toy implementation of the sum-check protocol for zero-knowledge proofs of polynomial sums over binary hypercubes. We follow the description in Thaler's Proofs, Arguments, and Zero-Knowledge (section 4.1).

Important disclaimer: this project is completely unsuitable for use in real-world cryptographic applications. Its purposes are purely illustrative.

Usage

The interface is very crude at the moment: in order to execute the protocol, you may modify the hard-coded polynomial, modulus and primitive root (the $p$ in $\mathbb{F}_p$ and a generator of $\mathbb{F}_p^\ast$) in main.rs, compile and execute. If the flag verbose is set to true (its default value), the prover and verifier will print some information messages during execution. These three parameters are marked with the comment // MODIFY.

The polynomial is given as in this example from the ark_poly crate.

In order to simulate the exact execution in the example from page 36 in the aforementioned book, leave the original polynomial from main.rs unchanged and uncomment the only block comment in the file parties.rs, which is also marked with the line comment // MODIFY. This prescribes which values the verifier should send to the prover (these are chosen randomly during a regular execution).

Tests

A few tests are included for various functions. The last of them, test_protocol tests the entire protocol for the polynomial in the example from page 36 cited above (in order to simulate that exact execution, follow the instructions at the end of section [Usage]).

The tests can be run with cargo test (or cargo test -- --nocapture if you don't want the output to be suppresed).

Dependencies

  • ark-ff for finite field arithmetic
  • ark-poly for multivariate polynomials (an ad-hoc implementation of univariate polynomials is included in polynomials.rs)
  • rand and rand_chacha for (cryptografically secure) choice of random field elements by the verifier.

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.