mirror of
https://github.com/logos-storage/gnark-plonky2-verifier.git
synced 2026-01-02 13:13:06 +00:00
fix for V-SCT-VUL-029
This commit is contained in:
parent
de0ff4f698
commit
06f91e4465
@ -23,6 +23,20 @@ func deserializeExponentiationGate(parameters map[string]string) Gate {
|
||||
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))
|
||||
}
|
||||
|
||||
|
||||
@ -36,6 +36,20 @@ func deserializeRandomAccessGate(parameters map[string]string) Gate {
|
||||
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)
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user