Skip to content

Commit

Permalink
feat: added predefined curves (#8)
Browse files Browse the repository at this point in the history
* added predefined curves

added fully constrained `hash_to_curve` method

fixed bug where `evaluate_linear_expression` was not working

added `msm` method into `BigCurve`

* fmt

* removed unused code

* updated readme

* update readme

* updated dependency
  • Loading branch information
zac-williamson authored Oct 22, 2024
1 parent da70f2b commit 582dc80
Show file tree
Hide file tree
Showing 22 changed files with 2,092 additions and 693 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Noir tests

on:
push:
branches:
- main
branches:
- main
pull_request:

env:
Expand All @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
toolchain: [nightly, 0.34.0]
toolchain: [nightly, 0.35.0]
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -38,7 +38,7 @@ jobs:
- name: Install Nargo
uses: noir-lang/[email protected]
with:
toolchain: 0.34.0
toolchain: 0.35.0

- name: Run formatter
run: nargo fmt --check
5 changes: 3 additions & 2 deletions Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
name = "noir_bigcurve"
type = "lib"
authors = [""]
compiler_version = ">=0.34.0"
compiler_version = ">=0.35.0"

[dependencies]
bignum = {tag = "v0.3.4", git = "https://github.com/noir-lang/noir-bignum"}
bignum = {tag = "v0.3.7", git = "https://github.com/noir-lang/noir-bignum"}
sort = {tag = "v0.1.0", git = "https://github.com/noir-lang/noir_sort"}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ The most efficient method to evaluate curve operations is `BigCurve::evaluate_li

- 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
- [x] Add tests for curves that have a nonzero `a` parameter
- [x] 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)
- [x] 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)

Expand Down
Loading

0 comments on commit 582dc80

Please sign in to comment.