Skip to content

Commit

Permalink
Merge pull request #10 from Yoii-Inc/feat/algebra
Browse files Browse the repository at this point in the history
Feat/algebra
  • Loading branch information
sheagrief authored Sep 28, 2023
2 parents f677dcb + 2fb3cbc commit 59f37bf
Show file tree
Hide file tree
Showing 711 changed files with 89,303 additions and 45 deletions.
43 changes: 27 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,39 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
ark-std = { version = "0.3.0", features = ["std"] }
ark-bls12-377 = { version = "0.3.0", features = ["r1cs", "curve"] }
ark-mnt4-753 = "0.3.0"
ark-ff = "0.3.0"
ark-ec = { path = "arkworks/algebra/ec", version = "0.3.0" }
ark-ff = { path = "arkworks/algebra/ff", version = "0.3.0" }
ark-poly = { path = "arkworks/algebra/poly", version = "0.3.0" }
ark-serialize = { path = "arkworks/algebra/serialize", version = "0.3.0" }

ark-crypto-primitives = { path = "arkworks/crypto-primitives", version = "0.3.0", features = ["r1cs"] }

ark-bls12-377 = { path = "arkworks/curves/bls12_377", version = "0.3.0", features = ["r1cs", "curve"] }
ark-ed-on-bls12-377 = { path = "arkworks/curves/ed_on_bls12_377", version = "0.3.0", features = ["r1cs"] }
ark-mnt4-753 = { path = "arkworks/curves/mnt4_753", version = "0.3.0" }

ark-groth16 = { path = "arkworks/groth16", version = "0.3.0" }

ark-marlin = { path = "arkworks/marlin", version = "0.3.0" }

ark-poly-commit = { path = "arkworks/poly-commit", version = "0.3.0" }

ark-r1cs-std = { path = "arkworks/r1cs-std", version = "0.3.0" }

ark-relations = { path = "arkworks/snark/relations", version = "0.3.0" }
ark-snark = { path = "arkworks/snark/snark", version = "0.3.0" }

ark-std = { path = "arkworks/std", version = "0.3.0", features = ["std"] }

rand = "0.8.5"
rand_distr = "0.4.3"
num-bigint = { version = "0.4.3", features = ["rand"] }
num-integer = "0.1"
ark-groth16 = "0.3.0"
ark-snark = "0.3.0"
ark-ec = "0.3.0"
ark-relations = "0.3.0"
ark-r1cs-std = "0.3.0"
ark-crypto-primitives = { version = "0.3.0", features = ["r1cs"] }
ark-ed-on-bls12-377 = { version = "0.3.0", features = ["r1cs"] }
num-traits = "0.2.14"
ark-poly = "0.3.0"
structopt = "0.3"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
ark-serialize = "0.3.0"
hex = "0.4.3"
ark-marlin = "0.3.0"
ark-poly-commit = "0.3.0"
blake2 = "0.9"
blake2 = "0.9"
derivative = { version = "2.0", features = ["use_core"]}
zeroize = { version = "1", default-features = false, features = ["zeroize_derive"] }
14 changes: 14 additions & 0 deletions arkworks/algebra/.github/.markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# See https://github.com/DavidAnson/markdownlint#rules--aliases for list of markdown lint codes
default: true
# MD01 lint blocks having header's incrementing by more than # at a time.
MD001: false
MD007: { indent: 4 }
# MD013 blocks long lines
MD013: false
MD024: { siblings_only: true }
MD025: false
# MD033 lint blocks HTML in MD
MD033: false
# MD036 no-emphasis-as-heading
MD036: false
MD041: false
26 changes: 26 additions & 0 deletions arkworks/algebra/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺
v ✰ Thanks for creating a PR! ✰
v Before hitting that submit button please review the checkboxes.
v If a checkbox is n/a - please still include it but + a little note why
☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -->

## Description

<!-- Add a description of the changes that this PR introduces and the files that
are the most critical to review.
-->

closes: #XXXX

---

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

- [ ] Targeted PR against correct branch (master)
- [ ] Linked to Github issue with discussion and accepted design OR have an explanation in the PR that describes this work.
- [ ] Wrote unit tests
- [ ] Updated relevant documentation in the code
- [ ] Added a relevant changelog entry to the `Pending` section in `CHANGELOG.md`
- [ ] Re-reviewed `Files changed` in the Github PR explorer
17 changes: 17 additions & 0 deletions arkworks/algebra/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: cargo
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
ignore:
- dependency-name: hashbrown
versions:
- 0.11.0
- dependency-name: rand
versions:
- 0.8.0
- dependency-name: rand_xorshift
versions:
- 0.3.0
210 changes: 210 additions & 0 deletions arkworks/algebra/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
name: CI
on:
pull_request:
push:
branches:
- master
env:
RUST_BACKTRACE: 1

jobs:
style:
name: Check Style
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt

- name: cargo fmt --check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

docs:
name: Check Documentation
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt

- name: cargo doc --all --no-deps --document-private-items --all-features
uses: actions-rs/cargo@v1
with:
command: doc
args: --all --no-deps --document-private-items --all-features

test:
name: Test
runs-on: ubuntu-latest
env:
RUSTFLAGS: -Dwarnings
strategy:
matrix:
rust:
- stable
- nightly
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Rust (${{ matrix.rust }})
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true

- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Check examples
uses: actions-rs/cargo@v1
with:
command: check
args: --examples --all

- name: Check examples with all features on stable
uses: actions-rs/cargo@v1
with:
command: check
args: --examples --all-features --all
if: matrix.rust == 'stable'

- name: Check benchmarks on nightly
uses: actions-rs/cargo@v1
with:
command: check
args: --all-features --examples --workspace --benches
if: matrix.rust == 'nightly'

- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: "--workspace \
--all-features \
--exclude ark-poly-benches \
--exclude ark-algebra-test-templates"

- name: Test assembly on nightly
env:
RUSTFLAGS: -C target-cpu=native
uses: actions-rs/cargo@v1
with:
command: test
args: "--workspace \
--package ark-test-curves \
--all-features"
if: matrix.rust == 'nightly'

check_no_std:
name: Check no_std
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Rust (${{ matrix.rust }})
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: thumbv6m-none-eabi
override: true

- name: Install Rust ARM64 (${{ matrix.rust }})
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: aarch64-unknown-none
override: true

- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: check
uses: actions-rs/cargo@v1
with:
command: check
args: --examples --workspace --exclude ark-algebra-test-templates --exclude ark-poly-benches --target thumbv6m-none-eabi

- name: build
uses: actions-rs/cargo@v1
with:
command: build
args: --workspace --exclude ark-algebra-test-templates --exclude ark-poly-benches --target thumbv6m-none-eabi

test_against_curves:
name: Test against curves
runs-on: ubuntu-latest
env:
RUSTFLAGS: -Dwarnings
strategy:
matrix:
curve:
- bls12_377
- bls12_381
- bn254
- pallas
- bw6_761
- mnt4_298
- mnt6_298
- ed_on_bls12_377
steps:
- name: Checkout curves
uses: actions/checkout@v2
with:
repository: arkworks-rs/curves

- name: Checkout algebra
uses: actions/checkout@v2
with:
repository: arkworks-rs/algebra
path: algebra

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Patch cargo.toml
run: |
echo >> Cargo.toml
echo "[patch.crates-io]" >> Cargo.toml
echo "ark-ff = { path = 'algebra/ff' }" >> Cargo.toml
echo "ark-serialize = { path = 'algebra/serialize' }" >> Cargo.toml
echo "ark-ff-macros = { path = 'algebra/ff-macros' }" >> Cargo.toml
echo "ark-ff-asm = { path = 'algebra/ff-asm' }" >> Cargo.toml
echo "ark-ec = { path = 'algebra/ec' }" >> Cargo.toml
echo "ark-algebra-test-templates = { path = 'algebra/test-templates' }" >> Cargo.toml
- name: Test on ${{ matrix.curve }}
run: "cd ${{ matrix.curve }} && cargo test --all-features"
20 changes: 20 additions & 0 deletions arkworks/algebra/.github/workflows/linkify_changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Linkify Changelog

on:
workflow_dispatch

jobs:
linkify:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Add links
run: python3 scripts/linkify_changelog.py CHANGELOG.md
- name: Commit
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Linkify Changelog"
git push
35 changes: 35 additions & 0 deletions arkworks/algebra/.github/workflows/mdlinter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

name: Lint
on:
push:
branches:
- master
paths:
- "**.md"
pull_request:
paths:
- "**.md"

jobs:
build:
name: Markdown linter
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Lint Code Base
uses: docker://github/super-linter:latest
env:
LINTER_RULES_PATH: .github
VALIDATE_ALL_CODEBASE: true
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_MD: true
MARKDOWN_CONFIG_FILE: .markdownlint.yml
VALIDATE_PROTOBUF: false
VALIDATE_JSCPD: false
# use Python Pylint as the only linter to avoid conflicts
VALIDATE_PYTHON_BLACK: false
VALIDATE_PYTHON_FLAKE8: false
VALIDATE_PYTHON_ISORT: false
VALIDATE_PYTHON_MYPY: false
11 changes: 11 additions & 0 deletions arkworks/algebra/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
target
Cargo.lock
.DS_Store
.idea
*.iml
*.ipynb_checkpoints
*.pyc
*.sage.py
params
*.swp
*.swo
Loading

0 comments on commit 59f37bf

Please sign in to comment.