arnaucube
arnaucube/gnark-plonky2-verifierPublic Self-hosted repository
fix for V-SCT-VUL-029
Kevin Jue kjue235@gmail.com
Tue, 19 Dec 2023 13:00:22 -0800
commit

06f91e4465966beec8fdb742db1afbef1ed17aeb

parent

de0ff4f698468801468be081abd72f6f1519a1fb

2 files changed, 28 insertions(+), 0 deletions(-)

jump to
M plonk/gates/exponentiation_gate.go → plonk/gates/exponentiation_gate.go

@@ -23,6 +23,20 @@ if err != nil {

panic("Invalid num_power_bits field in ExponentiationGate") } + base, hasBase := parameters["base"] + if !hasBase { + panic("Missing field base in ExponentiationGate") + } + + baseInt, err := strconv.Atoi(base) + if err != nil { + panic("Invalid base field in ExponentiationGate") + } + + if baseInt != gl.D { + panic("Expected base field in ExponentiationGate to equal gl.D") + } + return NewExponentiationGate(uint64(numPowerBitsInt)) }
M plonk/gates/random_access_gate.go → plonk/gates/random_access_gate.go

@@ -36,6 +36,20 @@ if err != nil {

panic("invalid numExtraConstants in RandomAccessGate") } + base, hasBase := parameters["base"] + if !hasBase { + panic("Missing field base in RandomAccessGate") + } + + baseInt, err := strconv.Atoi(base) + if err != nil { + panic("Invalid base field in RandomAccessGate") + } + + if baseInt != gl.D { + panic("Expected base field in RandomAccessGate to equal gl.D") + } + return NewRandomAccessGate(bitsInt, numCopiesInt, numExtraConstantsInt) }