mirror of
https://github.com/arnaucube/gnark-plonky2-verifier.git
synced 2026-01-12 09:01:32 +01:00
finished evaluateGateConstraints
This commit is contained in:
@@ -116,17 +116,6 @@ func (p *PlonkChip) checkPartialProducts(
|
||||
return partialProductChecks
|
||||
}
|
||||
|
||||
func (p *PlonkChip) evalFiltered(
|
||||
g gate,
|
||||
vars EvaluationVars,
|
||||
row int,
|
||||
selectorIndex int,
|
||||
groupRange Range,
|
||||
numSelectors int
|
||||
) []QuadraticExtension {
|
||||
|
||||
}
|
||||
|
||||
func (p *PlonkChip) evaluateGateConstraints(
|
||||
commonData CommonCircuitData,
|
||||
x QuadraticExtension,
|
||||
@@ -142,10 +131,26 @@ func (p *PlonkChip) evaluateGateConstraints(
|
||||
constraints := make([]QuadraticExtension, commonData.NumGateConstraints)
|
||||
|
||||
for i, gate := range commonData.Gates {
|
||||
selectorIndex := commonData.selector
|
||||
selectorIndex := commonData.SelectorsInfo.selectorIndices[i]
|
||||
|
||||
gateConstraints := p.evalFiltered(
|
||||
gate,
|
||||
vars,
|
||||
i,
|
||||
int(selectorIndex),
|
||||
commonData.SelectorsInfo.groups[selectorIndex],
|
||||
commonData.SelectorsInfo.NumSelectors(),
|
||||
)
|
||||
|
||||
for _, constraint := range gateConstraints {
|
||||
// assert j < commonData.NumGateConstraints
|
||||
constraints[i] = p.qeAPI.AddExtension(constraints[i], constraint)
|
||||
}
|
||||
}
|
||||
|
||||
return constraints
|
||||
}
|
||||
|
||||
func (p *PlonkChip) evalVanishingPoly(proofChallenges ProofChallenges, openings OpeningSet, zetaPowN QuadraticExtension) []QuadraticExtension {
|
||||
// TODO: evaluate_gate_constraints logic should be implemented here. See https://github.com/mir-protocol/plonky2/blob/main/plonky2/src/plonk/vanishing_poly.rs#L39
|
||||
|
||||
|
||||
Reference in New Issue
Block a user