generated from noir-lang/noir-library-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add initial implementation (#1)
Release-as: 0.1.0
- Loading branch information
1 parent
1522d7b
commit 113a06b
Showing
10 changed files
with
1,683 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,48 @@ | ||
name: Benchmarks | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
name: Benchmark library | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Nargo | ||
uses: noir-lang/[email protected] | ||
with: | ||
toolchain: 0.34.0 | ||
|
||
- name: Install bb | ||
run: | | ||
npm install -g bbup | ||
bbup -nv 0.34.0 | ||
- name: Build Noir benchmark programs | ||
run: nargo export | ||
|
||
- name: Generate gates report | ||
run: ./scripts/build-gates-report.sh | ||
env: | ||
BACKEND: /home/runner/.bb/bb | ||
|
||
- name: Compare gates reports | ||
id: gates_diff | ||
uses: noir-lang/noir-gates-diff@1931aaaa848a1a009363d6115293f7b7fc72bb87 | ||
with: | ||
report: gates_report.json | ||
summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%) | ||
|
||
- name: Add gates diff to sticky comment | ||
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target' | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
# delete the comment in case changes no longer impact circuit sizes | ||
delete: ${{ !steps.gates_diff.outputs.markdown }} | ||
message: ${{ steps.gates_diff.outputs.markdown }} | ||
# name: Benchmarks | ||
|
||
# on: | ||
# push: | ||
# branches: | ||
# - master | ||
# pull_request: | ||
|
||
# jobs: | ||
# test: | ||
# name: Benchmark library | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Checkout sources | ||
# uses: actions/checkout@v4 | ||
|
||
# - name: Install Nargo | ||
# uses: noir-lang/[email protected] | ||
# with: | ||
# toolchain: 0.36.0 | ||
|
||
# - name: Install bb | ||
# run: | | ||
# npm install -g bbup | ||
# bbup -nv 0.36.0 | ||
|
||
# - name: Build Noir benchmark programs | ||
# run: nargo export | ||
|
||
# - name: Generate gates report | ||
# run: ./scripts/build-gates-report.sh | ||
# env: | ||
# BACKEND: /home/runner/.bb/bb | ||
|
||
# - name: Compare gates reports | ||
# id: gates_diff | ||
# uses: noir-lang/noir-gates-diff@1931aaaa848a1a009363d6115293f7b7fc72bb87 | ||
# with: | ||
# report: gates_report.json | ||
# summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%) | ||
|
||
# - name: Add gates diff to sticky comment | ||
# if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target' | ||
# uses: marocchino/sticky-pull-request-comment@v2 | ||
# with: | ||
# # delete the comment in case changes no longer impact circuit sizes | ||
# delete: ${{ !steps.gates_diff.outputs.markdown }} | ||
# message: ${{ steps.gates_diff.outputs.markdown }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
toolchain: [nightly, 0.34.0] | ||
toolchain: [nightly, 0.36.0] | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
@@ -38,7 +38,7 @@ jobs: | |
- name: Install Nargo | ||
uses: noir-lang/[email protected] | ||
with: | ||
toolchain: 0.34.0 | ||
toolchain: 0.36.0 | ||
|
||
- name: Run formatter | ||
run: nargo fmt --check | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod te; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use std::ec::tecurve::affine::Curve as TECurve; | ||
use std::ec::tecurve::affine::Point as TEPoint; | ||
|
||
pub struct BabyJubjub { | ||
pub curve: TECurve, | ||
pub base8: TEPoint, | ||
pub suborder: Field, | ||
} | ||
|
||
#[field(bn254)] | ||
// Uncommenting this results in deprecated warnings in the stdlib | ||
// #[deprecated] | ||
pub fn baby_jubjub() -> BabyJubjub { | ||
BabyJubjub { | ||
// Baby Jubjub (ERC-2494) parameters in affine representation | ||
curve: TECurve::new( | ||
168700, | ||
168696, | ||
// G | ||
TEPoint::new( | ||
995203441582195749578291179787384436505546430278305826713579947235728471134, | ||
5472060717959818805561601436314318772137091100104008585924551046643952123905, | ||
), | ||
), | ||
// [8]G precalculated | ||
base8: TEPoint::new( | ||
5299619240641551281634865583518297030282874472190772894086521144482721001553, | ||
16950150798460657717958625567821834550301663161624707787222815936182638968203, | ||
), | ||
// The size of the group formed from multiplying the base field by 8. | ||
suborder: 2736030358979909402780800718157159386076813972158567259200215660948447373041, | ||
} | ||
} |
Oops, something went wrong.