constraint optimizations for assertLeadingZeros

This commit is contained in:
Kevin Jue
2023-12-22 11:42:53 -08:00
parent 1a0372621c
commit daad394f73
2 changed files with 7 additions and 8 deletions

View File

@@ -333,6 +333,11 @@ func (p *Chip) RangeCheck(x Variable) {
)
}
// This function will assert that the field element x is less than 2^maxNbBits.
func (p *Chip) RangeCheckWithMaxBits(x Variable, maxNbBits uint64) {
p.rangeChecker.Check(x.Limb, int(maxNbBits))
}
func (p *Chip) AssertIsEqual(x, y Variable) {
p.api.AssertIsEqual(x.Limb, y.Limb)
}