Skip to content

Commit 1e90a34

Browse files
committed
initial commit: open sourcing
0 parents  commit 1e90a34

File tree

203 files changed

+39696
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

203 files changed

+39696
-0
lines changed

.circleci/config.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: 2.1
2+
jobs:
3+
build:
4+
docker:
5+
- image: circleci/golang:latest
6+
steps:
7+
- checkout
8+
- restore_cache:
9+
keys:
10+
- go-mod-v1-{{ checksum "go.sum" }}
11+
- run: if [[ -n $(gofmt -l .) ]]; then echo "Please run gofmt"; exit 1; fi
12+
- run: go vet -tags bls377 -v ./...
13+
- run: go vet -tags bls381 -v ./...
14+
- run: go vet -tags bn256 -v ./...
15+
- run: go test -v -tags bls377,debug ./cs/... ./ecc/bls377/... .
16+
- run: go test -v -tags bls381,debug ./cs/... ./ecc/bls381/... .
17+
- run: go test -v -tags bn256,debug ./cs/... ./ecc/bn256/... .
18+
- save_cache:
19+
key: go-mod-v1-{{ checksum "go.sum" }}
20+
paths:
21+
- "/go/pkg/mod"

.gitignore

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, build with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool, specifically when used with LiteIDE
12+
*.out
13+
14+
old*.txt
15+
new*.txt
16+
*.prof
17+
*.pprof
18+
tasks.txt
19+
**/ref.txt
20+
*.pk
21+
*.vk
22+
*.proof
23+
*.input
24+
*.r1cs
25+
*.log
26+
27+
# generated files during integratrion tests
28+
internal/tests/integration/
29+
30+
# binary
31+
gnark
32+
playground
33+
34+
.vscode
35+
36+
# compiled sage -> python code
37+
*.sage.py

CODE_OF_CONDUCT.md

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Contributor gnark Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [[email protected]].
59+
All complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org

CONTRIBUTING.md

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Contributing to gnark
2+
3+
### Table of Contents
4+
5+
[Code of Conduct](#code-of-conduct)
6+
7+
[How to Contribute](#how-to-contribute)
8+
9+
* [Reporting Bugs](#reporting-bugs)
10+
* [Suggesting Enhancements](#suggesting-enhancements)
11+
* [Pull Requests](#pull-requests)
12+
13+
14+
15+
## Code of Conduct
16+
* This project is governed by the [gnark Code of Conduct](CODE_OF_CONDUCT.md). By participating,
17+
you are agreeing to uphold this code. Please report unacceptable behavior.
18+
## How to Contribute
19+
20+
### Reporting Bugs
21+
#### Before Submitting A Bug
22+
* Ensure the bug is not already reported by searching on GitHub under
23+
[Issues](https://github.com/consensys/gnark/issues).
24+
#### How Do I Submit a (Good) Bug?
25+
* If you are unable to find an open issue addressing the problem, open a new one. Be sure to include a
26+
**title and clear description**, as much relevant information as possible, and a **code sample** or
27+
an **executable test case** demonstrating the unexpected behavior.
28+
* Describe the **exact steps** to **reproduce the problem** in as many details as possible. When
29+
listing steps, don't just say what you did, but explain how you did it. For example, the exact
30+
commands used in the terminal to start `gnark`.
31+
* Provide **specific examples** to demonstrate the steps. Include links to files or GitHub projects, or
32+
copy/pasteable snippets, which you use in those examples. If you're providing snippets in the issue,
33+
use [Markdown code blocks](https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/).
34+
* Describe the **behavior you observed** after following the steps and explain the
35+
problem with that behavior.
36+
* Explain the **behavior you expected** instead and why.
37+
* **Can you reliably reproduce the issue?** If not, provide details about how often the problem
38+
happens and under which conditions it normally happens.
39+
40+
### Suggesting Enhancements
41+
#### Before Submitting An Enhancement Suggestion
42+
* [Search](https://github.com/consensys/gnark/issues) to see if the enhancement has already been
43+
suggested. If it has, add a comment to the existing issue instead of opening a new one.
44+
45+
#### How Do I Submit A (Good) Enhancement Suggestion?
46+
Enhancement suggestions are tracked as GitHub issues. Create an issue on and provide
47+
the following information:
48+
49+
* Use a **clear and descriptive title** for the issue to identify the suggestion.
50+
* Provide a **step-by-step description** of the suggested enhancement in as much detail as possible.
51+
* Describe the **current behavior** and explain the **behavior you expect** instead and why.
52+
* Explain why this enhancement would be useful to other users.
53+
* Specify the **name and version of the OS** you're using.
54+
* Specify the **name and version of any relevant packages**.
55+
56+
### Pull Requests
57+
There are a number of automated checks:
58+
* `go fmt`
59+
* `go vet`
60+
61+
If these checks pass, pull requests will be reviewed by the project team against criteria including:
62+
* purpose - is this change useful
63+
* test coverage - are there unit/integration/acceptance tests demonstrating the change is effective
64+
* code consistency - naming, comments, design
65+
* changes that are solely formatting are likely to be rejected
66+
67+
Always write a clear log message for your commits. One-line messages are fine for small changes, but
68+
bigger changes should contain more detail.

Dockerfile.benchmark

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM golang:latest
2+
3+
ENV GO111MODULE=on
4+
5+
WORKDIR /go/src/github.com/consensys/gnark
6+
7+
COPY go.mod .
8+
COPY go.sum .
9+
RUN go mod download
10+
11+
COPY . .
12+
13+
# Build the application
14+
# RUN make
15+
16+
WORKDIR /go/src/github.com/consensys/gnark/benchmark/benchmark
17+
RUN mkdir bls377 && mkdir bls381 && mkdir bn256
18+
RUN go build -tags bls377 -ldflags "-s -w" -o ./bls377/benchmark
19+
RUN go build -tags bls381 -ldflags "-s -w" -o ./bls381/benchmark
20+
RUN go build -tags bn256 -ldflags "-s -w" -o ./bn256/benchmark
21+
22+
WORKDIR /go/src/github.com/consensys/gnark/benchmark/benchmark/bls377
23+
RUN /go/src/github.com/consensys/gnark/benchmark/benchmark/bls377/benchmark generate
24+
25+
WORKDIR /go/src/github.com/consensys/gnark/benchmark/benchmark/bls381
26+
RUN /go/src/github.com/consensys/gnark/benchmark/benchmark/bls381/benchmark generate
27+
28+
WORKDIR /go/src/github.com/consensys/gnark/benchmark/benchmark/bn256
29+
RUN /go/src/github.com/consensys/gnark/benchmark/benchmark/bn256/benchmark generate
30+
31+
WORKDIR /go/src/github.com/consensys/gnark/benchmark/benchmark
32+
33+
CMD ["/bin/bash"]
34+
35+

0 commit comments

Comments
 (0)