Coder Social home page Coder Social logo

noir_bigcurve's Introduction

noir_bigcurve

noir_bigcurve is a @noir-lang library that evaluates operations over elliptic curves instantiated with an arbitrary prime field.

noir_bigcurve uses the noir-bignum library to evalaute arbitrary prime field arithmetic.

This library is a work in progress and likely full of bugs!

Overview

noir_bigcurve make use of noir-bignum to optimally evaluate group operations using a minimal number of modular reductions. Runtime lookup tables are also used to reduce the number of group operations required when evaluating scalar multiplications

Usage

See bigcurve_test.nr for some ways in which the library can be used.

Complete elliptic curve operations can be evalauted using BigCurve::add, BigCurve::sub BigCurve::mul and BigCurve::msm_with_hint.

msm_with_hint requires the generation of an AffineTranscript object in an unconstrained function. See bigcurve_test.nr for how this is done.

The most efficient method to evaluate curve operations is BigCurve::evaluate_linear_expression (TODO: Brillig bug means this method does not currently work!)

Future work

  • When performing MSMs, utilize the Montgomery Ladder to minimize the number of field operations (see batch_mul in barretenberg/src/stdlib/biggroup for example implementation)
  • ScalarField is not properly constrained when constructed from a BigNum object
  • Add tests for curves that have a nonzero a parameter
  • Add hash to curve method
  • Add method to check point is in prime-order subgroup for curves with a cofactor
  • Parametrise and test with a degree-2 extension field instead of BigNum
  • Add curve parameters for commonly used curves (BN254, BLS12-381, MNT4, MNT6, Pasta, Vella, Secp256K1, Secp256R1)
  • Create benchmarks
  • Add support for curve endomorphisms where applicable (if base field and scalar field both contain cube roots of unity, we can reduce the number of point doublings required for an MSM in half)

FAQ

Q: What's up with the Jacobian points and the transcript objects? A: To minimize witness generation time (currently the bottleneck due to Brillig VM) we evaluate ECC operations over Jacobian coordinates in an unconstrained function, in order to efficiently batch-compute the modular inverses required to constrain ECC operations over Affine coordinates (which is more constraint-efficient)

noir_bigcurve's People

Contributors

zac-williamson avatar

Stargazers

Maddiaa 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.