mirror of
https://github.com/arnaucube/gnark-plonky2-verifier.git
synced 2026-01-12 00:51:33 +01:00
fix for V-SCT-VUL-031
This commit is contained in:
@@ -10,6 +10,7 @@ package poseidon
|
|||||||
import (
|
import (
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
|
"github.com/consensys/gnark-crypto/ecc/bn254"
|
||||||
"github.com/consensys/gnark/frontend"
|
"github.com/consensys/gnark/frontend"
|
||||||
gl "github.com/succinctlabs/gnark-plonky2-verifier/goldilocks"
|
gl "github.com/succinctlabs/gnark-plonky2-verifier/goldilocks"
|
||||||
)
|
)
|
||||||
@@ -28,6 +29,10 @@ type BN254State = [BN254_SPONGE_WIDTH]frontend.Variable
|
|||||||
type BN254HashOut = frontend.Variable
|
type BN254HashOut = frontend.Variable
|
||||||
|
|
||||||
func NewBN254Chip(api frontend.API) *BN254Chip {
|
func NewBN254Chip(api frontend.API) *BN254Chip {
|
||||||
|
if api.Compiler().Field().Cmp(bn254.ID.ScalarField()) != 0 {
|
||||||
|
panic("Gnark compiler not set to BN254 scalar field")
|
||||||
|
}
|
||||||
|
|
||||||
return &BN254Chip{api: api, gl: *gl.New(api)}
|
return &BN254Chip{api: api, gl: *gl.New(api)}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user