Skip to content

Commit

Permalink
Reflect PRs in gnark-crypto: A field element is always in Montgomery …
Browse files Browse the repository at this point in the history
…form and big.Ints are always non-Mont (#422)

* refactor: no non-mont on bls12-377

* refactor: groth16 backend tests pass

* refactor: MSM takes Montgomery only - Plonk

* fix:`ToBigIntRegular` => `BigInt`

* fix: more `ToBigIntRegular` => `BigInt`
  • Loading branch information
Tabaie authored Dec 20, 2022
1 parent 935ab13 commit 908eb80
Show file tree
Hide file tree
Showing 77 changed files with 353 additions and 607 deletions.
2 changes: 1 addition & 1 deletion constraint/bls12-377/coeff.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion constraint/bls12-377/solution.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion constraint/bls12-381/coeff.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion constraint/bls12-381/solution.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion constraint/bls24-315/coeff.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion constraint/bls24-315/solution.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion constraint/bls24-317/coeff.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion constraint/bls24-317/solution.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion constraint/bn254/coeff.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion constraint/bn254/solution.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion constraint/bw6-633/coeff.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion constraint/bw6-633/solution.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion constraint/bw6-761/coeff.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion constraint/bw6-761/solution.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion constraint/tinyfield/coeff.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion constraint/tinyfield/solution.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/rollup/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ func (o *Operator) updateState(t Transfer, numTransfer int) error {

// checks if the amount is correct
var bAmount, bBalance big.Int
receiverAccount.balance.ToBigIntRegular(&bBalance)
t.amount.ToBigIntRegular(&bAmount)
receiverAccount.balance.BigInt(&bBalance)
t.amount.BigInt(&bAmount)
if bAmount.Cmp(&bBalance) == 1 {
return ErrAmountTooHigh
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.18
require (
github.com/blang/semver/v4 v4.0.0
github.com/consensys/bavard v0.1.13
github.com/consensys/gnark-crypto v0.8.1-0.20221205155504-6b860ba21fbd
github.com/consensys/gnark-crypto v0.8.1-0.20221220191316-4b7364bddab8
github.com/fxamacker/cbor/v2 v2.2.0
github.com/google/go-cmp v0.5.8
github.com/google/pprof v0.0.0-20220729232143-a41b82acbcb1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/Yj
github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI=
github.com/consensys/gnark-crypto v0.8.1-0.20221205155504-6b860ba21fbd h1:xpAhzOw3dZvRiQeTWmIO8KemBS5XdBsU+/jLfwibEmc=
github.com/consensys/gnark-crypto v0.8.1-0.20221205155504-6b860ba21fbd/go.mod h1:CkbdF9hbRidRJYMRzmfX8TMOr95I2pYXRHF18MzRrvA=
github.com/consensys/gnark-crypto v0.8.1-0.20221220191316-4b7364bddab8 h1:Ij6UQpKx4/Ox6L6qFPk8NhEnTsYCEXlILnh+1Hi1grY=
github.com/consensys/gnark-crypto v0.8.1-0.20221220191316-4b7364bddab8/go.mod h1:CkbdF9hbRidRJYMRzmfX8TMOr95I2pYXRHF18MzRrvA=
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
22 changes: 3 additions & 19 deletions internal/backend/bls12-377/groth16/prove.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 7 additions & 23 deletions internal/backend/bls12-377/groth16/setup.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/backend/bls12-377/groth16/verify.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/backend/bls12-377/plonk/prove.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/backend/bls12-377/plonk/verify.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 908eb80

Please sign in to comment.