Skip to content

Commit 786ef7f

Browse files
authored
Add CHANGELOG and several housekeeping files (#53)
1 parent 1223fe4 commit 786ef7f

File tree

19 files changed

+222
-77
lines changed

19 files changed

+222
-77
lines changed

.github/.markdownlint.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# See https://github.com/DavidAnson/markdownlint#rules--aliases for list of markdown lint codes
2+
default: true
3+
# MD01 lint blocks having header's incrementing by more than # at a time.
4+
MD001: false
5+
MD007: { indent: 4 }
6+
# MD013 blocks long lines
7+
MD013: false
8+
MD024: { siblings_only: true }
9+
MD025: false
10+
# MD033 lint blocks HTML in MD
11+
MD033: false
12+
# MD036 no-emphasis-as-heading
13+
MD036: false
14+
MD041: false

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺
2+
v ✰ Thanks for creating a PR! ✰
3+
v Before hitting that submit button please review the checkboxes.
4+
v If a checkbox is n/a - please still include it but + a little note why
5+
☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -->
6+
7+
## Description
8+
9+
<!-- Add a description of the changes that this PR introduces and the files that
10+
are the most critical to review.
11+
-->
12+
13+
closes: #XXXX
14+
15+
---
16+
17+
Before we can merge this PR, please make sure that all the following items have been
18+
checked off. If any of the checklist items are not applicable, please leave them but
19+
write a little note why.
20+
21+
- [ ] Targeted PR against correct branch (main)
22+
- [ ] Linked to Github issue with discussion and accepted design OR have an explanation in the PR that describes this work.
23+
- [ ] Wrote unit tests
24+
- [ ] Updated relevant documentation in the code
25+
- [ ] Added a relevant changelog entry to the `Pending` section in `CHANGELOG.md`
26+
- [ ] Re-reviewed `Files changed` in the Github PR explorer
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Linkify Changelog
2+
3+
on:
4+
workflow_dispatch
5+
6+
jobs:
7+
linkify:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
- name: Add links
13+
run: python3 scripts/linkify_changelog.py CHANGELOG.md
14+
- name: Commit
15+
run: |
16+
git config user.name github-actions
17+
git config user.email [email protected]
18+
git add .
19+
git commit -m "Linkify Changelog"
20+
git push

.github/workflows/mdlinter.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Lint
2+
on:
3+
push:
4+
branches:
5+
- master
6+
paths:
7+
- "**.md"
8+
pull_request:
9+
paths:
10+
- "**.md"
11+
12+
jobs:
13+
build:
14+
name: Markdown linter
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
- name: Lint Code Base
20+
uses: docker://github/super-linter:latest
21+
env:
22+
LINTER_RULES_PATH: .github
23+
VALIDATE_ALL_CODEBASE: true
24+
DEFAULT_BRANCH: master
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
VALIDATE_MD: true
27+
MARKDOWN_CONFIG_FILE: .markdownlint.yml
28+
VALIDATE_PROTOBUF: false
29+
VALIDATE_JSCPD: false
30+
# use Python Pylint as the only linter to avoid conflicts
31+
VALIDATE_PYTHON_BLACK: false
32+
VALIDATE_PYTHON_FLAKE8: false
33+
VALIDATE_PYTHON_ISORT: false
34+
VALIDATE_PYTHON_MYPY: false

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## Pending
2+
3+
### Breaking changes
4+
5+
- [\#30](https://github.com/arkworks-rs/crypto-primitives/pull/30) Refactor the Merkle tree to separate the leaf hash and two-to-one hash.
6+
7+
### Features
8+
9+
- [\#38](https://github.com/arkworks-rs/crypto-primitives/pull/38) Add a signature verification trait `SigVerifyGadget`.
10+
- [\#44](https://github.com/arkworks-rs/crypto-primitives/pull/44) Add basic ElGamal encryption gadgets.
11+
- [\#48](https://github.com/arkworks-rs/crypto-primitives/pull/48) Add `CanonicalSerialize` and `CanonicalDeserialize` to `Path` and `CRH` outputs.
12+
13+
### Improvements
14+
15+
### Bug fixes
16+
17+
## v0.2.0
18+
19+
### Breaking changes
20+
21+
### Features
22+
23+
- [\#2](https://github.com/arkworks-rs/crypto-primitives/pull/2) Add the `SNARK` gadget traits.
24+
- [\#3](https://github.com/arkworks-rs/crypto-primitives/pull/3) Add unchecked allocation for `ProofVar` and `VerifyingKeyVar`.
25+
- [\#4](https://github.com/arkworks-rs/crypto-primitives/pull/4) Add `verifier_size` to `SNARKGadget`.
26+
- [\#6](https://github.com/arkworks-rs/crypto-primitives/pull/6) Add `IntoIterator` for SNARK input gadgets.
27+
- [\#28](https://github.com/arkworks-rs/crypto-primitives/pull/28) Adds Poseidon CRH w/ constraints.
28+
29+
### Improvements
30+
31+
### Bug fixes
32+
33+
## v0.1.0 (Initial release of arkworks/crypto-primitives)

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,20 @@ This library is released under the MIT License and the Apache v2 License (see [L
1616
## Build guide
1717

1818
The library compiles on the `stable` toolchain of the Rust compiler. To install the latest version of Rust, first install `rustup` by following the instructions [here](https://rustup.rs/), or via your platform's package manager. Once `rustup` is installed, install the Rust toolchain by invoking:
19+
1920
```bash
2021
rustup install stable
2122
```
2223

2324
After that, use `cargo`, the standard Rust build tool, to build the library:
25+
2426
```bash
2527
git clone https://github.com/arkworks-rs/crypto-primitives.git
2628
cargo build --release
2729
```
2830

2931
This library comes with unit tests for each of the provided crates. Run the tests with:
32+
3033
```bash
3134
cargo test
3235
```
@@ -35,8 +38,8 @@ cargo test
3538

3639
This library is licensed under either of the following licenses, at your discretion.
3740

38-
* Apache License Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
39-
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
41+
* Apache License Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or [apache.org license link](http://www.apache.org/licenses/LICENSE-2.0))
42+
* MIT license ([LICENSE-MIT](LICENSE-MIT) or [opensource.org license link](http://opensource.org/licenses/MIT))
4043

4144
Unless you explicitly state otherwise, any contribution submitted for inclusion in this library by you shall be dual licensed as above (as defined in the Apache v2 License), without any additional terms or conditions.
4245

cp-benches/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ edition = "2018"
1313
################################# Dependencies ################################
1414

1515
[dev-dependencies]
16-
ark-ed-on-bls12-377 = { git = "https://github.com/arkworks-rs/curves/", default-features = false }
16+
ark-crypto-primitives = { path = "../" }
17+
ark-ed-on-bls12-377 = { version = "^0.2.0", default-features = false }
18+
ark-std = { version = "^0.2.0", default-features = false }
19+
1720
blake2 = { version = "0.9", default-features = false }
1821
criterion = "0.3.1"
19-
crypto-primitives = { path = "../crypto-primitives" }
2022

2123
################################# Benchmarks ##################################
2224

cp-benches/benches/crypto_primitives/comm.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#[macro_use]
22
extern crate criterion;
33

4-
use algebra::{ed_on_bls12_377::EdwardsProjective as Edwards, UniformRand};
4+
use ark_crypto_primitives::commitment::{pedersen::*, CommitmentScheme};
5+
use ark_ed_on_bls12_377::EdwardsProjective as Edwards;
6+
use ark_std::UniformRand;
57
use criterion::Criterion;
6-
use crypto_primitives::commitment::{pedersen::*, CommitmentScheme};
78

89
#[derive(Clone, PartialEq, Eq, Hash)]
910
pub struct CommWindow;
@@ -28,7 +29,7 @@ fn pedersen_comm_eval(c: &mut Criterion) {
2829
let input = vec![5u8; 128];
2930
c.bench_function("Pedersen Commitment Eval", move |b| {
3031
b.iter(|| {
31-
let rng = &mut rand::thread_rng();
32+
let rng = &mut ark_std::test_rng();
3233
let commitment_randomness = Randomness::rand(rng);
3334
Commitment::<Edwards, CommWindow>::commit(&parameters, &input, &commitment_randomness)
3435
.unwrap()

cp-benches/benches/crypto_primitives/crh.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#[macro_use]
22
extern crate criterion;
33

4-
use algebra::ed_on_bls12_377::EdwardsProjective as Edwards;
4+
use ark_crypto_primitives::crh::{
5+
pedersen::{Window, CRH as PedersenCRH},
6+
CRH,
7+
};
8+
use ark_ed_on_bls12_377::EdwardsProjective as Edwards;
59
use criterion::Criterion;
6-
use crypto_primitives::crh::{pedersen::*, FixedLengthCRH};
710

811
#[derive(Clone, PartialEq, Eq, Hash)]
912
pub struct HashWindow;
@@ -17,17 +20,17 @@ fn pedersen_crh_setup(c: &mut Criterion) {
1720
c.bench_function("Pedersen CRH Setup", move |b| {
1821
b.iter(|| {
1922
let mut rng = &mut ark_std::test_rng();
20-
CRH::<Edwards, HashWindow>::setup(&mut rng).unwrap()
23+
PedersenCRH::<Edwards, HashWindow>::setup(&mut rng).unwrap()
2124
})
2225
});
2326
}
2427

2528
fn pedersen_crh_eval(c: &mut Criterion) {
2629
let mut rng = &mut ark_std::test_rng();
27-
let parameters = CRH::<Edwards, HashWindow>::setup(&mut rng).unwrap();
30+
let parameters = PedersenCRH::<Edwards, HashWindow>::setup(&mut rng).unwrap();
2831
let input = vec![5u8; 128];
2932
c.bench_function("Pedersen CRH Eval", move |b| {
30-
b.iter(|| CRH::<Edwards, HashWindow>::evaluate(&parameters, &input).unwrap())
33+
b.iter(|| PedersenCRH::<Edwards, HashWindow>::evaluate(&parameters, &input).unwrap())
3134
});
3235
}
3336

cp-benches/benches/crypto_primitives/prf.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
use rand;
2-
31
#[macro_use]
42
extern crate criterion;
53

6-
use criterion::Criterion;
7-
use crypto_primitives::prf::*;
4+
use ark_crypto_primitives::prf::*;
85
use ark_std::rand::Rng;
6+
use criterion::Criterion;
97

108
fn blake2s_prf_eval(c: &mut Criterion) {
119
let rng = &mut ark_std::test_rng();

0 commit comments

Comments
 (0)