From 1a0372621cbc4aa8f76623cae72caec04db530a3 Mon Sep 17 00:00:00 2001 From: Kevin Jue Date: Thu, 21 Dec 2023 14:20:23 -0800 Subject: [PATCH] removed Exp in goldilocks/base.go per V-SCT-VUL-016 --- goldilocks/base.go | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/goldilocks/base.go b/goldilocks/base.go index ba8ac8b..e49eaf1 100644 --- a/goldilocks/base.go +++ b/goldilocks/base.go @@ -269,28 +269,6 @@ func InverseHint(_ *big.Int, inputs []*big.Int, results []*big.Int) error { return nil } -// Computes a field element raised to some power. -func (p *Chip) Exp(x Variable, k *big.Int) Variable { - if k.IsUint64() && k.Uint64() == 0 { - return One() - } - - e := k - if k.Sign() == -1 { - panic("Unsupported negative exponent. Need to implement inversion.") - } - - z := x - for i := e.BitLen() - 2; i >= 0; i-- { - z = p.Mul(z, z) - if e.Bit(i) == 1 { - z = p.Mul(z, x) - } - } - - return z -} - // The hint used to split a GoldilocksVariable into 2 32 bit limbs. func SplitLimbsHint(_ *big.Int, inputs []*big.Int, results []*big.Int) error { if len(inputs) != 1 {