mirror of
https://github.com/arnaucube/gnark-plonky2-verifier.git
synced 2026-01-12 00:51:33 +01:00
fix for V-SCT-VUL-028
This commit is contained in:
@@ -49,14 +49,14 @@ func (f *Chip) GetInstance(zeta gl.QuadraticExtensionVariable) InstanceInfo {
|
|||||||
zeta,
|
zeta,
|
||||||
)
|
)
|
||||||
|
|
||||||
zetaNextBath := BatchInfo{
|
zetaNextBatch := BatchInfo{
|
||||||
Point: zetaNext,
|
Point: zetaNext,
|
||||||
Polynomials: friZSPolys(f.commonData),
|
Polynomials: friZSPolys(f.commonData),
|
||||||
}
|
}
|
||||||
|
|
||||||
return InstanceInfo{
|
return InstanceInfo{
|
||||||
Oracles: friOracles(f.commonData),
|
Oracles: friOracles(f.commonData),
|
||||||
Batches: []BatchInfo{zetaBatch, zetaNextBath},
|
Batches: []BatchInfo{zetaBatch, zetaNextBatch},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ func (f *Chip) expFromBitsConstBase(
|
|||||||
) gl.Variable {
|
) gl.Variable {
|
||||||
product := gl.One()
|
product := gl.One()
|
||||||
for i, bit := range exponentBits {
|
for i, bit := range exponentBits {
|
||||||
// If the bit is on, we multiply product by base^pow.
|
// If the bit is 1, we multiply product by base^pow.
|
||||||
// We can arithmetize this as:
|
// We can arithmetize this as:
|
||||||
// product *= 1 + bit (base^pow - 1)
|
// product *= 1 + bit (base^pow - 1)
|
||||||
// product = (base^pow - 1) product bit + product
|
// product = (base^pow - 1) product bit + product
|
||||||
@@ -326,7 +326,7 @@ func (f *Chip) computeEvaluation(
|
|||||||
) gl.QuadraticExtensionVariable {
|
) gl.QuadraticExtensionVariable {
|
||||||
arity := 1 << arityBits
|
arity := 1 << arityBits
|
||||||
if (len(evals)) != arity {
|
if (len(evals)) != arity {
|
||||||
panic("len(evals) ! arity")
|
panic("len(evals) != arity")
|
||||||
}
|
}
|
||||||
if arityBits > 8 {
|
if arityBits > 8 {
|
||||||
panic("currently assuming that arityBits is <= 8")
|
panic("currently assuming that arityBits is <= 8")
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
gl "github.com/succinctlabs/gnark-plonky2-verifier/goldilocks"
|
gl "github.com/succinctlabs/gnark-plonky2-verifier/goldilocks"
|
||||||
)
|
)
|
||||||
|
|
||||||
var aritheticExtensionGateRegex = regexp.MustCompile("ArithmeticExtensionGate { num_ops: (?P<numOps>[0-9]+) }")
|
var arithmeticExtensionGateRegex = regexp.MustCompile("ArithmeticExtensionGate { num_ops: (?P<numOps>[0-9]+) }")
|
||||||
|
|
||||||
func deserializeExtensionArithmeticGate(parameters map[string]string) Gate {
|
func deserializeExtensionArithmeticGate(parameters map[string]string) Gate {
|
||||||
// Has the format "ArithmeticExtensionGate { num_ops: 10 }"
|
// Has the format "ArithmeticExtensionGate { num_ops: 10 }"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
gl "github.com/succinctlabs/gnark-plonky2-verifier/goldilocks"
|
gl "github.com/succinctlabs/gnark-plonky2-verifier/goldilocks"
|
||||||
)
|
)
|
||||||
|
|
||||||
var aritheticGateRegex = regexp.MustCompile("ArithmeticGate { num_ops: (?P<numOps>[0-9]+) }")
|
var arithmeticGateRegex = regexp.MustCompile("ArithmeticGate { num_ops: (?P<numOps>[0-9]+) }")
|
||||||
|
|
||||||
func deserializeArithmeticGate(parameters map[string]string) Gate {
|
func deserializeArithmeticGate(parameters map[string]string) Gate {
|
||||||
// Has the format "ArithmeticGate { num_ops: 10 }"
|
// Has the format "ArithmeticGate { num_ops: 10 }"
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ type Gate interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var gateRegexHandlers = map[*regexp.Regexp]func(parameters map[string]string) Gate{
|
var gateRegexHandlers = map[*regexp.Regexp]func(parameters map[string]string) Gate{
|
||||||
aritheticGateRegex: deserializeArithmeticGate,
|
arithmeticGateRegex: deserializeArithmeticGate,
|
||||||
aritheticExtensionGateRegex: deserializeExtensionArithmeticGate,
|
arithmeticExtensionGateRegex: deserializeExtensionArithmeticGate,
|
||||||
baseSumGateRegex: deserializeBaseSumGate,
|
baseSumGateRegex: deserializeBaseSumGate,
|
||||||
constantGateRegex: deserializeConstantGate,
|
constantGateRegex: deserializeConstantGate,
|
||||||
cosetInterpolationGateRegex: deserializeCosetInterpolationGate,
|
cosetInterpolationGateRegex: deserializeCosetInterpolationGate,
|
||||||
|
|||||||
Reference in New Issue
Block a user