Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.8.0 placeholder #455

Merged
merged 249 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
249 commits
Select commit Hold shift + click to select a range
6dddcbf
feat(plonk): addition of skeleton prover with non homomorphic PCS
ThomasPiellard Jan 26, 2022
7549473
style: removed printing functions
ThomasPiellard Jan 26, 2022
25381e1
feat: addition of missing commitments and openings in vk and pk
ThomasPiellard Jan 26, 2022
6978abc
fix(plonk): fixed generic verifier
ThomasPiellard Feb 1, 2022
68b2c94
feat: added verifier (forgot to commit it)
ThomasPiellard Feb 2, 2022
12d1d3a
style: uncomment verify.go in generic plonk
ThomasPiellard Feb 2, 2022
2307a25
fix: removed unused debug function
ThomasPiellard Feb 3, 2022
8a03b06
Merge branch 'develop' into feat/plonk_generic
ThomasPiellard Mar 4, 2022
b23e9cf
fix: fixed vanilla plonk fri
ThomasPiellard Mar 8, 2022
8d76551
feat: addition of proximity tests
ThomasPiellard Mar 11, 2022
b5403bb
feat: addition of proofs for s1,s2,s3 and ccircuit coefficients
ThomasPiellard Mar 11, 2022
1f8c964
fix: fixed opening Merkle path
ThomasPiellard Mar 11, 2022
fed8295
fix: fixed size Iop (error due to the blinding)
ThomasPiellard Mar 18, 2022
68e21f3
feat: verification of Z, Zshifted
ThomasPiellard Mar 18, 2022
67b2873
fix: fixed position of the shifted opening
ThomasPiellard Mar 21, 2022
89f2dd1
feat: removed mock commitment scheme
ThomasPiellard Mar 22, 2022
86b9c23
feat: removed dead code + old commented code
ThomasPiellard Mar 22, 2022
5e487cf
style: removed dead debug printings
ThomasPiellard Mar 22, 2022
b6407bb
feat: re activated blinding
ThomasPiellard Mar 22, 2022
138aaa4
feat: Fiat Shamir done
ThomasPiellard Mar 23, 2022
b4eda7e
feat: addition of templates
ThomasPiellard Mar 24, 2022
c8a818e
feat: code gen
ThomasPiellard Mar 24, 2022
a979beb
refactor: VerifyFri -> Verify
ThomasPiellard Mar 25, 2022
83e1e9b
feat: addition of plonkfri in test package
ThomasPiellard Mar 25, 2022
732afcd
feat: only mul is tested for plonk fri
ThomasPiellard Apr 6, 2022
10f4bd2
feat: uncomment integration tests
ThomasPiellard Apr 6, 2022
33b812d
feat(hint): allow registering multiple hints
ivokub Apr 7, 2022
ba7738f
feat(std/nonnative): implement non-native field arithmetic
ivokub Feb 1, 2022
ec2b59c
fix: copy instead of loop
ivokub Apr 7, 2022
a75bced
fix: check unchecked error
ivokub Apr 7, 2022
e27089d
fix: remove unused error return
ivokub Apr 7, 2022
e2a775a
style: remove unused documentation file
ivokub Apr 7, 2022
3a09996
style: test name update
ivokub Apr 7, 2022
0f2664b
feat: merge develop
ThomasPiellard Apr 7, 2022
91ef255
fix: ignore plonk_fri in internal/stats for now
gbotrel Apr 7, 2022
2cf3601
fix: remove api from constant init
ivokub Apr 8, 2022
1041c8c
fix: enfore width after inverse and div
ivokub Apr 8, 2022
2ebbae1
feat(std/sw_bls12377): G2 scalar multiplication
yelhousni Apr 12, 2022
d7a778c
feat(std/sw_bls24315): G2 scalar multiplication
yelhousni Apr 12, 2022
3abfb03
Merge branch 'develop' into feat/std/kzg-verifier
yelhousni Apr 14, 2022
8a2f231
Merge branch develop into feat/std/kzg-verifier
yelhousni Apr 14, 2022
af8ae92
feat(std): KZG verifier gadget bls24-315 (with static witness)
yelhousni Apr 14, 2022
4816350
fix: added DecomposeScalarG2 to std.RegisterHints
gbotrel Apr 14, 2022
bf55244
style(std/bls24): rename DecomposeScalar hint (consistent with bls12)
yelhousni Apr 14, 2022
5243210
Merge branch 'develop' into feat/std/kzg-verifier
yelhousni Apr 14, 2022
1b0457f
feat: add panicking constant init
ivokub Apr 27, 2022
fc2e17b
feat: implement Lookup2 and select
ivokub Apr 27, 2022
74879c2
test: implement select test
ivokub Apr 27, 2022
0b613f1
test: implement large computation circuit
ivokub Apr 27, 2022
507b3c0
fix: remove second high limb exception in sub padding
ivokub Apr 28, 2022
b911c22
fix: multiplication top limb width
ivokub May 2, 2022
7100e4c
style: change field to params in tests
ivokub May 2, 2022
10652ae
test: fewer test cases
ivokub May 2, 2022
920d759
test: implement constant test
ivokub May 2, 2022
86753ab
test: implement lookup2 test
ivokub May 2, 2022
ffc870f
style: cleanup test comments
ivokub May 2, 2022
0828b5e
style: inline test struct init
ivokub May 2, 2022
bb33b0f
fix: remove debug calls
ivokub May 2, 2022
9238f62
style: rename n to r
ivokub May 4, 2022
0f13dc3
fix: make conversion functions private
ivokub May 10, 2022
1cdeada
docs: add method docs
ivokub May 10, 2022
d027e0b
style: typos
ivokub May 10, 2022
72193c0
docs: comments
ivokub May 10, 2022
e0f0953
fix: more precise padding computation
ivokub May 10, 2022
4ac60fb
fix: remove unused method
ivokub May 10, 2022
c592def
docs: add explainer
ivokub May 10, 2022
dc6b1bc
ci: fix slack integration + adds golanglint-ci (#316)
gbotrel May 10, 2022
373df92
build: update CI (#318)
gbotrel May 11, 2022
82ce4d5
fix: set overflow after reduce
ivokub May 19, 2022
89415c2
fix: add/set use argument nb of limbs
ivokub May 24, 2022
daedbb4
feat: add Params.isEqual
ivokub May 24, 2022
2e6009c
Revert "feat: add Params.isEqual"
ivokub May 24, 2022
92e31e4
fix: return element
ivokub May 26, 2022
1b1c39f
Merge branch 'develop' into feat/plonk_generic
gbotrel May 26, 2022
5d82ea4
fix: consider carries in bit decomposition
ivokub May 30, 2022
39d3181
feat: binary composition
ivokub May 30, 2022
164df24
fix: ToBits edge case for overflow=0
ivokub May 31, 2022
7d5a623
fix: ToBits return nb of bits
ivokub May 31, 2022
85d422f
test: binary composition test
ivokub May 31, 2022
8622e8d
fix: reduce given argument not inline
ivokub Jun 1, 2022
c397226
feat: implement AssertIsLessEqualThan
ivokub Jun 6, 2022
58f4ffc
feat(test)!: implement test engine options
ivokub Jun 6, 2022
e25c216
feat(test)!: implement test engine options (#326)
ivokub Jun 6, 2022
9266fff
refactor: Compile(ecc.ID) -> Compile(field *big.Int) (#328)
gbotrel Jun 7, 2022
1e47608
Addition of a circuit that checks FRI proximity proofs (#321)
ThomasPiellard Jun 7, 2022
33ef617
Merge branch 'develop' into feat/std/kzg-verifier
yelhousni Jun 8, 2022
718a3e8
test: add test/solver_test.go (#329)
gbotrel Jun 8, 2022
71b79f1
Merge remote-tracking branch 'upstream/develop' into feat/nonnative-ff
ivokub Jun 14, 2022
9f170fa
fix: change hint definitions
ivokub Jun 14, 2022
31ab015
fix: use scalar field bitlength directly
ivokub Jun 14, 2022
699e9dc
fix: use BaseField() to get modulus
ivokub Jun 14, 2022
9bcd1c8
Merge pull request #302 from ConsenSys/feat/nonnative-ff
ivokub Jun 14, 2022
5a52177
perf: optimize equality check
ivokub May 16, 2022
775e7ab
perf: constrain main bits in equality diff to be only zeros
ivokub May 16, 2022
63bb450
perf: lazy reduction
ivokub May 17, 2022
dc315df
fix: remove subtraction padding optimisation
ivokub May 17, 2022
3bb0d7d
docs: add method documentation
ivokub May 19, 2022
b253e26
perf: remove width enforcement in Reduce()
ivokub May 30, 2022
23e29d2
style: remove irrelevant TODOs
ivokub May 31, 2022
226ef4b
fix: remove broken equality fast-path
ivokub Jun 23, 2022
8a5866f
docs: describe limb regrouping for equality
ivokub Jun 23, 2022
616018d
perf: allocate less in test engine
ivokub Jun 9, 2022
edca9fb
feat: add VariableCount method to builder
ivokub Jun 20, 2022
f1c1ca5
refactor: use field in schema leaf handler
ivokub Jun 20, 2022
89de68a
feat: count fields in first schema parsing
ivokub Jun 20, 2022
5bf0880
fix: reduce div integration circuit
ivokub Jun 1, 2022
a1a78f5
fix: rebase on develop
yelhousni Jun 28, 2022
44e5c91
fix: kzg verifier test
yelhousni Jun 28, 2022
899b27c
test: bench kzg verifier with plonk
yelhousni Jun 28, 2022
86c67fe
style: remove dead code
ThomasPiellard Jun 29, 2022
1860dfc
style: factored code in integration_test
ThomasPiellard Jun 29, 2022
0307a0b
style: removed dead comments
ThomasPiellard Jun 29, 2022
ea42f2f
fix: fixed comments
ThomasPiellard Jun 29, 2022
6e3b087
feat: size of fiat shamir data is harcoded
ThomasPiellard Jun 29, 2022
0ec8ae2
style: removed dead code
ThomasPiellard Jun 29, 2022
d8066d7
style: moved kzg in circuit in commitment/ folder
ThomasPiellard Jun 30, 2022
32e0f42
feat: addition of dynamic test kzg bls12377
ThomasPiellard Jun 30, 2022
ad6b129
feat: addition of dynamic test for kzg bls24315
ThomasPiellard Jun 30, 2022
9729606
style: comment about scalar fields of in-circuit KZG
yelhousni Jun 30, 2022
08764fc
Merge branch 'develop' into feat/plonk_generic
gbotrel Jun 30, 2022
4229251
Merge pull request #307 from ConsenSys/feat/std/kzg-verifier
yelhousni Jun 30, 2022
3d36721
Merge pull request #320 from ConsenSys/perf/nonnative
ivokub Jul 4, 2022
40f2db0
fix(nonnative): off by one error
ivokub Jul 5, 2022
48b6b12
Merge pull request #334 from ConsenSys/fix/nonnative-offbyone
ivokub Jul 5, 2022
e4b5289
Merge pull request #332 from ConsenSys/refactor/schema-parsing
ivokub Jul 6, 2022
3a7800d
Merge pull request #331 from ConsenSys/perf/test-engine
ivokub Jul 6, 2022
ba17dfa
refactor: remove in-method reductions
ivokub May 24, 2022
6abce2b
feat: split add/mul/sub into cond and op
ivokub May 26, 2022
c6fd895
fix: reduce element when init from const
ivokub Jun 9, 2022
f59c2bb
feat: add fake API for emulated arithmetics
ivokub Jun 10, 2022
fc35307
test: add fake API tests
ivokub Jun 10, 2022
79c517d
feat: add gnark tags
ivokub Jun 23, 2022
773eb69
fix: remove leq overwrite
ivokub Jul 5, 2022
0550aef
feat(frontend): add builder wrapper compile opt
ivokub Jul 6, 2022
4a45e6f
test: add Goldilocks tests
ivokub Jul 6, 2022
d65e05e
Merge pull request #325 from ConsenSys/feat/emulated-api
ivokub Jul 8, 2022
f271acc
Merge branch 'develop' into feat/plonk_generic
gbotrel Jul 14, 2022
31bc701
Merge pull request #250 from ConsenSys/feat/plonk_generic
gbotrel Jul 14, 2022
5cc8365
Add new BLS24-317 (#310)
yelhousni Jul 14, 2022
487d331
build: re-ran go generate
gbotrel Jul 14, 2022
99a488c
perf: minor improvments to big.Int test engine (#344)
gbotrel Jul 20, 2022
d8ab4c9
feat: added serialization header to CS and debug info to all constrai…
gbotrel Jul 22, 2022
a70df34
refactor: std/math/nonnative -> std/math/emulated (#345)
gbotrel Jul 29, 2022
34e16a3
build: test only on go 1.18 for now
gbotrel Jul 29, 2022
e8ae5d6
adds `gnark/profile` that outputs pprof compatible circuit profiling …
gbotrel Aug 3, 2022
9a6a7d1
clean: remove deadcode and kill `api.Tag` and `api.Counter` (#353)
gbotrel Aug 3, 2022
8e80058
feat: replaced full bit decomposition by rshift in emulated/assertIsE…
gbotrel Aug 3, 2022
f14e014
go1.19: update CI and run gofmt on files (#357)
gbotrel Aug 12, 2022
b308ebb
perf: api.IsZero generate less constraints (#356)
gbotrel Aug 19, 2022
2f40389
feat: some sumcheck experiments
Tabaie Aug 30, 2022
346ae76
test: sumcheck in circuit, getting errors
Tabaie Sep 1, 2022
8fafec4
feat!: copy paste gkr verifier from gnark-crypto
Tabaie Sep 5, 2022
cda10b7
style: Multilin -> MultiLin
Tabaie Sep 5, 2022
e4bd34d
Merge branch 'feat/sumcheck' into feat/gkr
Tabaie Sep 5, 2022
91cbd41
feat: gkr verifier
Tabaie Sep 7, 2022
079eced
fix: minor typo
Tabaie Sep 8, 2022
00c873a
fix: extra nosec G404 in test file
Tabaie Sep 8, 2022
adaf096
Merge pull request #362 from ConsenSys/fix/mathrand
Tabaie Sep 8, 2022
ef7d769
feat: poly functions and some tests
Tabaie Sep 7, 2022
df0b5dd
test: pass
Tabaie Sep 7, 2022
df4f0a8
fix: InterpolateOnRange works even when it doesn't really have to "in…
Tabaie Sep 8, 2022
58a893e
Merge pull request #363 from ConsenSys/fix/lde-0div
Tabaie Sep 8, 2022
3159d31
feat: some sumcheck experiments
Tabaie Aug 30, 2022
6d665ea
test: sumcheck in circuit, getting errors
Tabaie Sep 1, 2022
187bb99
style: Multilin -> MultiLin
Tabaie Sep 5, 2022
5e03ba1
refactor: use polynomial package
Tabaie Sep 8, 2022
520ce29
fix: Sumcheck verifier usable as circuit
Tabaie Sep 8, 2022
c182f7f
feat: gkr verifier is NOT a witness object
Tabaie Sep 9, 2022
23b4f4a
style: remove questions
Tabaie Sep 9, 2022
21aca78
Merge pull request #361 from ConsenSys/feat/polynomial
Tabaie Sep 9, 2022
25c4c41
test: all parts of witness get unconstrained error
Tabaie Sep 12, 2022
05b8200
test: counter start from 2
Tabaie Sep 12, 2022
6ec3f7a
test: circuit and witness cannot be the same object
Tabaie Sep 12, 2022
ef191c9
fix: fixes #359 missing fields in plonk serialized format (#364)
gbotrel Sep 12, 2022
9509b02
add plonk proof serialization without point compression (#365)
gbotrel Sep 12, 2022
9c520e9
test: fix incorrect proof
Tabaie Sep 12, 2022
f7c7a85
fix(emulated): enforce widths of packed limbs (#368)
ivokub Sep 14, 2022
57c0666
fix: IsZero throws panic on (#367)
ivokub Sep 14, 2022
7b60e25
add experimental plonk solidity verifier (#366)
gbotrel Sep 14, 2022
b33f88c
Fix Or && Xor (#355)
liyue201 Sep 15, 2022
aaf7472
fix: simple sumcheck test passes
Tabaie Sep 20, 2022
4b19fb2
Merge branch 'feat/sumcheck' into feat/gkr
Tabaie Sep 20, 2022
1a93ec8
Optimize bn254/groth16 solidity verifier. (#376)
citizen-stig Oct 6, 2022
020b2d6
style,perf: refactor groth16 solidity, remove one add (#377)
gbotrel Oct 7, 2022
2466ff4
feat: map in snark
Tabaie Oct 12, 2022
6c62810
Merge branch 'master' into feat/gkr
Tabaie Oct 12, 2022
cdf3034
test: singleMap works
Tabaie Oct 12, 2022
ef885e4
test: doubleMap works
Tabaie Oct 12, 2022
f489cc4
Fix/xor cst var plonk (#383)
ThomasPiellard Oct 13, 2022
29251cd
test: Transcript fails
Tabaie Oct 13, 2022
47e654f
fix: TestTranscript works
Tabaie Oct 13, 2022
aec00bb
test: routine developed for gkr
Tabaie Oct 14, 2022
d94dc2d
fix: some problems in sumcheck and gkr
Tabaie Oct 14, 2022
c0d87a4
test: trying to feed proof as circuit input, reflect errors
Tabaie Oct 14, 2022
14ad433
fix: less elegant "hollow", but it works
Tabaie Oct 15, 2022
4607b20
test!: feed everything into test circuit as secret, TestSingleIdentit…
Tabaie Oct 15, 2022
28c5a2e
test: all pass except "two_input_single_identity_gate_two_instances"
Tabaie Oct 31, 2022
0a146dc
fix: update test vectors, hash finalevalproofs
Tabaie Nov 8, 2022
84ccad0
fix: multi-fan-out input bug
Tabaie Nov 8, 2022
37e2a5a
test: add four-instance test case
Tabaie Nov 9, 2022
7034e4f
Merge branch 'develop' into feat/gkr
Tabaie Nov 9, 2022
cb1091f
fix: staticcheck
Tabaie Nov 14, 2022
34fd380
fix: fixed Lagrange polynomials construction (#389)
ThomasPiellard Nov 18, 2022
03c9545
feat: add inherit circuit tag (#387)
ivokub Nov 18, 2022
779b150
build: updated to feat/commitment branch on gnark-crypto (#408)
gbotrel Dec 5, 2022
2e88f72
Feat/g16 enormous fs hint (#405)
Tabaie Dec 5, 2022
610796c
fix: fix #400 with trim path handling in profile report (#409)
gbotrel Dec 5, 2022
3c248a9
Merge branch 'develop' into feat/gkr
Tabaie Dec 7, 2022
befadf6
refactor: add constraint package and improve memory management in fro…
gbotrel Dec 14, 2022
3f0a9e5
Merge branch 'develop' into feat/gkr
Tabaie Dec 15, 2022
54df7a7
refactor: reflect gnark-crypto gkr changes, debug pending
Tabaie Dec 15, 2022
b14a925
fix: update test vector proofs to proper size, some bugs
Tabaie Dec 15, 2022
2f1da32
feat: add linear expression packing for R1CS (#418)
ivokub Dec 16, 2022
5feca04
fix: idiotic load circuit bug
Tabaie Dec 16, 2022
ca9880d
fix: verifier input building
Tabaie Dec 16, 2022
9709306
style: clean up unused functions
Tabaie Dec 16, 2022
f260cf9
feat: testing options and clearer errors
Tabaie Dec 16, 2022
f2c263e
feat: split field in field emulation into Field and FieldAPI (#395)
ivokub Dec 17, 2022
935ab13
fix: engine.Println to take strings (#419)
Tabaie Dec 19, 2022
8b11c7d
Merge branch 'develop' into feat/gkr
Tabaie Dec 19, 2022
67f8942
fix: tests expected to fail
Tabaie Dec 19, 2022
908eb80
Reflect PRs in gnark-crypto: A field element is always in Montgomery …
Tabaie Dec 20, 2022
b3778b3
autogenerate tinyfield arithmetic (#424)
gbotrel Dec 20, 2022
24fe00b
feat: add debug.SymbolTable into constraint system for storage effici…
gbotrel Dec 21, 2022
66e4fab
Restore frontend.WithCapacity (to merge after perf/debugInfo) (#423)
gbotrel Dec 22, 2022
6bd6ac0
feat: keccak-f permutation function (#401)
ivokub Jan 10, 2023
5f837b0
feat: adds `api.MAC(..)` (#427)
gbotrel Jan 12, 2023
0d0df78
fix: closes #400 path trimming correct, example with unix path separa…
gbotrel Jan 13, 2023
3a03e4e
fix: fix previous commit
gbotrel Jan 13, 2023
355ef5b
fix: closes #434 returns a copy of the input slice when filtering gro…
gbotrel Jan 13, 2023
aab2cc2
Merge pull request #393 from ConsenSys/feat/gkr
Tabaie Jan 19, 2023
2b9d934
fix: add shortcut for const input in MulConst (#438)
ivokub Jan 19, 2023
2aab2fb
feat: add ECDSA signature verification (#372)
ivokub Jan 19, 2023
c221154
build: make linter happy remove deprecated call
gbotrel Jan 19, 2023
2f5d634
fix: pack full limbs for quotient (#439)
ivokub Jan 19, 2023
5c50b9a
fix: handle recursive hints in level builder (#441)
gbotrel Jan 23, 2023
475b5dc
fix #442: use `reflectwalk` to walk through circuit structures withou…
gbotrel Jan 23, 2023
8a39609
feat: add automatic non-native witness element limb constraining (#446)
ivokub Jan 24, 2023
3f4cefa
refactor: emulated clean up fixes #448 (#449)
gbotrel Jan 27, 2023
534031b
perf: mimc on bls12-377/fr uses x^17 as a permutation
yelhousni Jan 31, 2023
0914308
refactor: clean up witness package, introduces clean `witness.Witness…
gbotrel Feb 1, 2023
f08ef4d
feat: add cs.GetConstraint with examples, and pretty printer helpers …
gbotrel Feb 1, 2023
381d72c
Merge pull request #453 from ConsenSys/mimx/nb-rounds-bls12377
Tabaie Feb 2, 2023
1097a17
Refactor: remove geth dependency (#440)
yelhousni Feb 6, 2023
22f5cbc
feat: add test.NoFuzzing() testing option (#296)
ivokub Feb 6, 2023
4e854d5
fix: mark and output boolean (#459)
ivokub Feb 7, 2023
f216e8d
docs: update doc link
gbotrel Feb 7, 2023
3194646
docs: remove logo references
gbotrel Feb 7, 2023
15e204a
docs: updated README.md
gbotrel Feb 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
63 changes: 44 additions & 19 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- name: install Go
uses: actions/setup-go@v2
with:
go-version: 1.18.x
go-version: 1.19.x
- name: checkout code
uses: actions/checkout@v2
with:
Expand All @@ -22,20 +22,14 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
args: --timeout=5m
- name: install deps
run: go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest
- name: gofmt
run: if [[ -n $(gofmt -l .) ]]; then echo "please run gofmt"; exit 1; fi
- name: go vet
run: go vet ./...
- name: staticcheck
run: |
go install honnef.co/go/tools/cmd/staticcheck@23e1086441d24fed9f668ad1cd4374245118b590
staticcheck ./...
- name: gosec
run: |
go install github.com/securego/gosec/v2/cmd/gosec@latest
gosec -exclude G204 ./...
- name: generated files should not be modified
run: |
go generate ./...
Expand All @@ -46,7 +40,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.18.x]
go-version: [1.19.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
needs:
Expand Down Expand Up @@ -74,17 +68,48 @@ jobs:
run: |
go test -v -short -timeout=30m ./...

slack-workflow-status:
if: always()
slack-workflow-status-failed:
if: failure()
name: post workflow status to slack
needs:
- staticcheck
- test
runs-on: ubuntu-latest
steps:
- name: Notify slack -- workflow failed
id: slack
uses: slackapi/slack-github-action@v1.19.0
with:
payload: |
{
"actor": "${{ github.actor }}",
"repo": "${{ github.repository }}",
"status": "FAIL",
"title": "${{ github.event.pull_request.title }}",
"pr": "${{ github.event.pull_request.head.ref }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

slack-workflow-status-success:
if: success()
name: post workflow status to slack
needs:
- staticcheck
- test
runs-on: ubuntu-latest
steps:
- name: Build notification
uses: Gamesight/slack-workflow-status@master
- name: Notify slack -- workflow succeeded
id: slack
uses: slackapi/slack-github-action@v1.19.0
with:
repo_token: ${{secrets.GITHUB_TOKEN}}
slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}}
channel: '#team-gnark-build'
payload: |
{
"actor": "${{ github.actor }}",
"repo": "${{ github.repository }}",
"status": "SUCCESS",
"title": "${{ github.event.pull_request.title }}",
"pr": "${{ github.event.pull_request.head.ref }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_SUCCESS }}
63 changes: 44 additions & 19 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: install Go
uses: actions/setup-go@v2
with:
go-version: 1.18.x
go-version: 1.19.x
- name: checkout code
uses: actions/checkout@v2
with:
Expand All @@ -26,20 +26,14 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
args: --timeout=5m
- name: install deps
run: go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest
- name: gofmt
run: if [[ -n $(gofmt -l .) ]]; then echo "please run gofmt"; exit 1; fi
- name: go vet
run: go vet ./...
- name: staticcheck
run: |
go install honnef.co/go/tools/cmd/staticcheck@23e1086441d24fed9f668ad1cd4374245118b590
staticcheck ./...
- name: gosec
run: |
go install github.com/securego/gosec/v2/cmd/gosec@latest
gosec -exclude G204 ./...
- name: generated files should not be modified
run: |
go generate ./...
Expand All @@ -50,7 +44,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.17.x, 1.18.x]
go-version: [1.19.x]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
needs:
Expand Down Expand Up @@ -82,17 +76,48 @@ jobs:
run: |
go test -v -timeout=50m -race -short ./...

slack-workflow-status:
if: always()
slack-workflow-status-failed:
if: failure()
name: post workflow status to slack
needs:
- staticcheck
- test
runs-on: ubuntu-latest
steps:
- name: Notify slack -- workflow failed
id: slack
uses: slackapi/slack-github-action@v1.19.0
with:
payload: |
{
"actor": "${{ github.actor }}",
"repo": "${{ github.repository }}",
"status": "FAIL",
"title": "push to ${{ github.event.push.base_ref }}",
"pr": ""
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

slack-workflow-status-success:
if: success()
name: post workflow status to slack
needs:
- staticcheck
- test
runs-on: ubuntu-latest
steps:
- name: Build notification
uses: Gamesight/slack-workflow-status@master
- name: Notify slack -- workflow succeeded
id: slack
uses: slackapi/slack-github-action@v1.19.0
with:
repo_token: ${{secrets.GITHUB_TOKEN}}
slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}}
channel: '#team-gnark-build'
payload: |
{
"actor": "${{ github.actor }}",
"repo": "${{ github.repository }}",
"status": "SUCCESS",
"title": "push to ${{ github.event.push.base_ref }}",
"pr": ""
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_SUCCESS }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ gnarkd/circuits/**

# compiled sage -> python code
*.sage.py

# Jetbrains stuff
.idea/
12 changes: 12 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
linters:
disable-all: true
enable:
- gofmt
- staticcheck
- gosec
- gosimple
- govet
- ineffassign

run:
issues-exit-code: 1
30 changes: 14 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
[![PkgGoDev](https://pkg.go.dev/badge/mod/github.com/consensys/gnark)](https://pkg.go.dev/mod/github.com/consensys/gnark)
[![Documentation Status](https://readthedocs.com/projects/pegasys-gnark/badge/)][`gnark` User Documentation] [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5819104.svg)](https://doi.org/10.5281/zenodo.5819104)

<img width="100px"
src="logo_new.png">

`gnark` is a fast zk-SNARK library that offers a high-level API to design circuits. The library is open source and developed under the Apache 2.0 license


Expand All @@ -16,7 +13,7 @@ src="logo_new.png">
* [`gnark` User Documentation]
* [`gnark` Playground]
* [`gnark` Issues]
* [`gnark` Benchmarks](https://docs.gnark.consensys.net/en/latest/#gnark-is-fast)
* [`gnark` Benchmarks](https://docs.gnark.consensys.net/overview#gnark-is-fast) 🏁
* [`gnark-announce`] - Announcement list for new releases and security patches


Expand All @@ -29,7 +26,7 @@ Checkout the [online playground][`gnark` Playground] to compile circuits and vis

## Warning

**`gnark` has not been audited and is provided as-is, we make no guarantees or warranties to its safety and reliability. In particular, `gnark` makes no security guarantees such as constant time implementation or side-channel attack resistance.**
**`gnark` has been [partially audited](https://github.com/ConsenSys/gnark-crypto/blob/master/audit_oct2022.pdf) and is provided as-is, we make no guarantees or warranties to its safety and reliability. In particular, `gnark` makes no security guarantees such as constant time implementation or side-channel attack resistance.**

`gnark` and `gnark-crypto` packages are optimized for 64bits architectures (x86 `amd64`) and tested on Unix (Linux / macOS).

Expand Down Expand Up @@ -64,6 +61,7 @@ which can be instantiated with the following curves
- [x] BW6-761
- [x] BLS24-315
- [x] BW6-633
- [x] BLS24-317

### Example

Expand Down Expand Up @@ -91,14 +89,14 @@ func (circuit *CubicCircuit) Define(api frontend.API) error {

// compiles our circuit into a R1CS
var circuit CubicCircuit
ccs, err := frontend.Compile(ecc.BN254, r1cs.NewBuilder, &circuit)
ccs, err := frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &circuit)

// groth16 zkSNARK: Setup
pk, vk, err := groth16.Setup(ccs)

// witness definition
assignment := CubicCircuit{X: 3, Y: 35}
witness, err := frontend.NewWitness(&assignment, ecc.BN254)
witness, err := frontend.NewWitness(&assignment, ecc.BN254.ScalarField())
publicWitness, _ := witness.Public()

// groth16: Prove & Verify
Expand All @@ -112,19 +110,19 @@ If you use `gnark` in your research a citation would be appreciated.
Please use the following BibTeX to cite the most recent release.

```bib
@software{gnark-v0.6.4,
@software{gnark-v0.8.0,
author = {Gautam Botrel and
Thomas Piellard and
Youssef El Housni and
Ivo Kubjas and
Arya Tabaie},
title = {ConsenSys/gnark: v0.6.4},
title = {ConsenSys/gnark: v0.8.0},
month = feb,
year = 2022,
year = 2023,
publisher = {Zenodo},
version = {v0.6.4},
doi = {10.5281/zenodo.6093969},
url = {https://doi.org/10.5281/zenodo.6093969}
version = {v0.8.0},
doi = {10.5281/zenodo.5819104},
url = {https://doi.org/10.5281/zenodo.5819104}
}
```

Expand All @@ -142,8 +140,8 @@ This project is licensed under the Apache 2 License - see the [LICENSE](LICENSE)

[`gnark` Issues]: https://github.com/consensys/gnark/issues
[`gnark` Playground]: https://play.gnark.io
[`gnark` User Documentation]: https://docs.gnark.consensys.net/en/latest/
[`gnark` User Documentation]: https://docs.gnark.consensys.net/
[GitHub discussions]: https://github.com/ConsenSys/gnark/discussions
[Proving schemes and curves]: https://docs.gnark.consensys.net/en/latest/Concepts/schemes_curves/
[Proving schemes and curves]: https://docs.gnark.consensys.net/Concepts/schemes_curves
[`gnark-announce`]: https://groups.google.com/g/gnark-announce
[@gnark_team]: https://twitter.com/gnark_team
[@gnark_team]: https://twitter.com/gnark_team
5 changes: 4 additions & 1 deletion backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ const (
UNKNOWN ID = iota
GROTH16
PLONK
PLONKFRI
)

// Implemented return the list of proof systems implemented in gnark
func Implemented() []ID {
return []ID{GROTH16, PLONK}
return []ID{GROTH16, PLONK, PLONKFRI}
}

// String returns the string representation of a proof system
Expand All @@ -42,6 +43,8 @@ func (id ID) String() string {
return "groth16"
case PLONK:
return "plonk"
case PLONKFRI:
return "plonkFRI"
default:
return "unknown"
}
Expand Down
12 changes: 8 additions & 4 deletions backend/groth16/bellman_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,17 @@ func TestVerifyBellmanProof(t *testing.T) {

// verify groth16 proof
// we need to prepend the number of elements in the witness.
// witness package expects [nbPublic nbSecret] followed by [n | elements];
// note that n is redundant with nbPublic + nbSecret
var buf bytes.Buffer
binary.Write(&buf, binary.BigEndian, uint32(len(inputsBytes)/(fr.Limbs*8)))
_ = binary.Write(&buf, binary.BigEndian, uint32(len(inputsBytes)/(fr.Limbs*8)))
_ = binary.Write(&buf, binary.BigEndian, uint32(0))
_ = binary.Write(&buf, binary.BigEndian, uint32(len(inputsBytes)/(fr.Limbs*8)))
buf.Write(inputsBytes)

witness := &witness.Witness{
CurveID: ecc.BLS12_381,
}
witness, err := witness.New(ecc.BLS12_381.ScalarField())
require.NoError(t, err)

err = witness.UnmarshalBinary(buf.Bytes())
require.NoError(t, err)

Expand Down
Loading