Skip to content

Commit

Permalink
feat: add initial implementation
Browse files Browse the repository at this point in the history
Release-as: 0.1.0
  • Loading branch information
TomAFrench committed Nov 21, 2024
1 parent 1522d7b commit e2604e2
Show file tree
Hide file tree
Showing 10 changed files with 1,645 additions and 34 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
- name: Install Nargo
uses: noir-lang/[email protected]
with:
toolchain: 0.34.0
toolchain: 0.36.0

- name: Install bb
run: |
npm install -g bbup
bbup -nv 0.34.0
bbup -nv 0.36.0
- name: Build Noir benchmark programs
run: nargo export
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
name = "noir_library"
type = "lib"
authors = [""]
compiler_version = ">=0.34.0"
compiler_version = ">=0.36.0"

[dependencies]
22 changes: 4 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
# noir-library-starter
# ec

This repository is a template used by the noir-lang org when creating internally maintained libraries.

This provides out of the box:

- A simple CI setup to test and format the library
- A canary flagging up compilation failures on nightly releases.
- A [release-please](https://github.com/googleapis/release-please) setup to ease creating releases for the library.

Feel free to use this template as a starting point to create your own Noir libraries.

---

# LIBRARY_NAME

Add a brief description of the library
A library which exports the ec module which formerly existed within the Noir stdlib.

## Benchmarks

Expand All @@ -27,11 +13,11 @@ In your _Nargo.toml_ file, add the version of this library you would like to ins

```
[dependencies]
LIBRARY = { tag = "v0.1.0", git = "https://github.com/noir-lang/LIBRARY_NAME" }
ec = { tag = "v0.1.0", git = "https://github.com/noir-lang/ec" }
```

## `library`

### Usage

`PLACEHOLDER`
`PLACEHOLDER`
1 change: 1 addition & 0 deletions src/consts/mod.nr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod te;
33 changes: 33 additions & 0 deletions src/consts/te.nr
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,
}
}
Loading

0 comments on commit e2604e2

Please sign in to comment.