From 297a82025f476ac0268cfec3852735e06c637f31 Mon Sep 17 00:00:00 2001 From: Kevin Jue Date: Mon, 18 Dec 2023 15:42:09 -0800 Subject: [PATCH] fix for V-SCT-VUL-002 and V-SCT-VUL-003 --- goldilocks/base.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/goldilocks/base.go b/goldilocks/base.go index 2eae792..9a53ab6 100644 --- a/goldilocks/base.go +++ b/goldilocks/base.go @@ -193,7 +193,7 @@ func (p *Chip) Reduce(x Variable) Variable { remainder := NewVariable(result[1]) p.RangeCheck(remainder) - p.api.AssertIsEqual(x, p.api.Add(p.api.Mul(quotient, MODULUS), remainder.Limb)) + p.api.AssertIsEqual(x.Limb, p.api.Add(p.api.Mul(quotient, MODULUS), remainder.Limb)) return remainder } @@ -218,7 +218,7 @@ func (p *Chip) ReduceWithMaxBits(x Variable, maxNbBits uint64) Variable { remainder := NewVariable(result[1]) p.RangeCheck(remainder) - p.api.AssertIsEqual(x, p.api.Add(p.api.Mul(quotient, MODULUS), remainder.Limb)) + p.api.AssertIsEqual(x.Limb, p.api.Add(p.api.Mul(quotient, MODULUS), remainder.Limb)) return remainder }