mirror of
https://github.com/arnaucube/gnark-plonky2-verifier.git
synced 2026-01-12 00:51:33 +01:00
Moved to variables
This commit is contained in:
@@ -11,6 +11,9 @@ package goldilocks
|
||||
// be very beneficial to use the no reduction methods and keep track of the maximum number of bits
|
||||
// your computation uses.
|
||||
|
||||
// This implementation is based on the following plonky2 implementation of Goldilocks
|
||||
// Available here: https://github.com/0xPolygonZero/plonky2/blob/main/field/src/goldilocks_field.rs#L70
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
@@ -76,50 +79,50 @@ func NegOne() Variable {
|
||||
}
|
||||
|
||||
// The chip used for Goldilocks field operations.
|
||||
type GoldilocksApi struct {
|
||||
type Chip struct {
|
||||
api frontend.API
|
||||
rangeChecker frontend.Rangechecker
|
||||
}
|
||||
|
||||
// Creates a new Goldilocks chip.
|
||||
func NewGoldilocksApi(api frontend.API) *GoldilocksApi {
|
||||
// Creates a new Goldilocks Chip.
|
||||
func New(api frontend.API) *Chip {
|
||||
rangeChecker := rangecheck.New(api)
|
||||
return &GoldilocksApi{api: api, rangeChecker: rangeChecker}
|
||||
return &Chip{api: api, rangeChecker: rangeChecker}
|
||||
}
|
||||
|
||||
// Adds two field elements such that x + y = z within the Golidlocks field.
|
||||
func (p *GoldilocksApi) Add(a Variable, b Variable) Variable {
|
||||
func (p *Chip) Add(a Variable, b Variable) Variable {
|
||||
return p.MulAdd(a, NewVariable(1), b)
|
||||
}
|
||||
|
||||
// Adds two field elements such that x + y = z within the Golidlocks field without reducing.
|
||||
func (p *GoldilocksApi) AddNoReduce(a Variable, b Variable) Variable {
|
||||
func (p *Chip) AddNoReduce(a Variable, b Variable) Variable {
|
||||
return NewVariable(p.api.Add(a.Limb, b.Limb))
|
||||
}
|
||||
|
||||
// Subtracts two field elements such that x + y = z within the Golidlocks field.
|
||||
func (p *GoldilocksApi) Sub(a Variable, b Variable) Variable {
|
||||
func (p *Chip) Sub(a Variable, b Variable) Variable {
|
||||
return p.MulAdd(b, NewVariable(MODULUS.Uint64()-1), a)
|
||||
}
|
||||
|
||||
// Subtracts two field elements such that x + y = z within the Golidlocks field without reducing.
|
||||
func (p *GoldilocksApi) SubNoReduce(a Variable, b Variable) Variable {
|
||||
func (p *Chip) SubNoReduce(a Variable, b Variable) Variable {
|
||||
return NewVariable(p.api.Add(a.Limb, p.api.Mul(b.Limb, MODULUS.Uint64()-1)))
|
||||
}
|
||||
|
||||
// Multiplies two field elements such that x * y = z within the Golidlocks field.
|
||||
func (p *GoldilocksApi) Mul(a Variable, b Variable) Variable {
|
||||
func (p *Chip) Mul(a Variable, b Variable) Variable {
|
||||
return p.MulAdd(a, b, Zero())
|
||||
}
|
||||
|
||||
// Multiplies two field elements such that x * y = z within the Golidlocks field without reducing.
|
||||
func (p *GoldilocksApi) MulNoReduce(a Variable, b Variable) Variable {
|
||||
func (p *Chip) MulNoReduce(a Variable, b Variable) Variable {
|
||||
return NewVariable(p.api.Mul(a.Limb, b.Limb))
|
||||
}
|
||||
|
||||
// Multiplies two field elements and adds a field element such that x * y + z = c within the
|
||||
// Golidlocks field.
|
||||
func (p *GoldilocksApi) MulAdd(a Variable, b Variable, c Variable) Variable {
|
||||
func (p *Chip) MulAdd(a Variable, b Variable, c Variable) Variable {
|
||||
result, err := p.api.Compiler().NewHint(MulAddHint, 2, a.Limb, b.Limb, c.Limb)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -140,7 +143,7 @@ func (p *GoldilocksApi) MulAdd(a Variable, b Variable, c Variable) Variable {
|
||||
|
||||
// Multiplies two field elements and adds a field element such that x * y + z = c within the
|
||||
// Golidlocks field without reducing.
|
||||
func (p *GoldilocksApi) MulAddNoReduce(a Variable, b Variable, c Variable) Variable {
|
||||
func (p *Chip) MulAddNoReduce(a Variable, b Variable, c Variable) Variable {
|
||||
return p.AddNoReduce(p.MulNoReduce(a, b), c)
|
||||
}
|
||||
|
||||
@@ -168,7 +171,7 @@ func MulAddHint(_ *big.Int, inputs []*big.Int, results []*big.Int) error {
|
||||
}
|
||||
|
||||
// Reduces a field element x such that x % MODULUS = y.
|
||||
func (p *GoldilocksApi) Reduce(x Variable) Variable {
|
||||
func (p *Chip) Reduce(x Variable) Variable {
|
||||
// Witness a `quotient` and `remainder` such that:
|
||||
//
|
||||
// MODULUS * quotient + remainder = x
|
||||
@@ -192,7 +195,7 @@ func (p *GoldilocksApi) Reduce(x Variable) Variable {
|
||||
}
|
||||
|
||||
// Reduces a field element x such that x % MODULUS = y.
|
||||
func (p *GoldilocksApi) ReduceWithMaxBits(x Variable, maxNbBits uint64) Variable {
|
||||
func (p *Chip) ReduceWithMaxBits(x Variable, maxNbBits uint64) Variable {
|
||||
// Witness a `quotient` and `remainder` such that:
|
||||
//
|
||||
// MODULUS * quotient + remainder = x
|
||||
@@ -227,7 +230,7 @@ func ReduceHint(_ *big.Int, inputs []*big.Int, results []*big.Int) error {
|
||||
}
|
||||
|
||||
// Computes the inverse of a field element x such that x * x^-1 = 1.
|
||||
func (p *GoldilocksApi) Inverse(x Variable) Variable {
|
||||
func (p *Chip) Inverse(x Variable) Variable {
|
||||
result, err := p.api.Compiler().NewHint(InverseHint, 1, x.Limb)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -261,7 +264,7 @@ func InverseHint(_ *big.Int, inputs []*big.Int, results []*big.Int) error {
|
||||
}
|
||||
|
||||
// Computes a field element raised to some power.
|
||||
func (p *GoldilocksApi) Exp(x Variable, k *big.Int) Variable {
|
||||
func (p *Chip) Exp(x Variable, k *big.Int) Variable {
|
||||
if k.IsUint64() && k.Uint64() == 0 {
|
||||
return One()
|
||||
}
|
||||
@@ -306,7 +309,7 @@ func SplitLimbsHint(_ *big.Int, inputs []*big.Int, results []*big.Int) error {
|
||||
}
|
||||
|
||||
// Range checks a field element x to be less than the Golidlocks modulus 2 ^ 64 - 2 ^ 32 + 1.
|
||||
func (p *GoldilocksApi) RangeCheck(x Variable) {
|
||||
func (p *Chip) RangeCheck(x Variable) {
|
||||
// The Goldilocks' modulus is 2^64 - 2^32 + 1, which is:
|
||||
//
|
||||
// 1111111111111111111111111111111100000000000000000000000000000001
|
||||
@@ -350,7 +353,7 @@ func (p *GoldilocksApi) RangeCheck(x Variable) {
|
||||
)
|
||||
}
|
||||
|
||||
func (p *GoldilocksApi) AssertIsEqual(x, y Variable) {
|
||||
func (p *Chip) AssertIsEqual(x, y Variable) {
|
||||
p.api.AssertIsEqual(x.Limb, y.Limb)
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ type TestGoldilocksRangeCheckCircuit struct {
|
||||
}
|
||||
|
||||
func (c *TestGoldilocksRangeCheckCircuit) Define(api frontend.API) error {
|
||||
glApi := NewGoldilocksApi(api)
|
||||
glApi := New(api)
|
||||
glApi.RangeCheck(NewVariable(c.X))
|
||||
return nil
|
||||
}
|
||||
@@ -48,7 +48,7 @@ type TestGoldilocksRangeCheckBenchmarkCircuit struct {
|
||||
}
|
||||
|
||||
func (c *TestGoldilocksRangeCheckBenchmarkCircuit) Define(api frontend.API) error {
|
||||
glApi := NewGoldilocksApi(api)
|
||||
glApi := New(api)
|
||||
for _, x := range c.X {
|
||||
glApi.RangeCheck(NewVariable(x))
|
||||
glApi.Reduce(NewVariable(x))
|
||||
@@ -88,7 +88,7 @@ type TestGoldilocksMulAddCircuit struct {
|
||||
}
|
||||
|
||||
func (c *TestGoldilocksMulAddCircuit) Define(api frontend.API) error {
|
||||
glApi := NewGoldilocksApi(api)
|
||||
glApi := New(api)
|
||||
calculateValue := glApi.MulAdd(NewVariable(c.X), NewVariable(c.Y), NewVariable(c.Z))
|
||||
api.AssertIsEqual(calculateValue.Limb, c.ExpectedResult)
|
||||
return nil
|
||||
|
||||
@@ -28,35 +28,35 @@ func OneExtension() QuadraticExtensionVariable {
|
||||
}
|
||||
|
||||
// Adds two quadratic extension variables in the Goldilocks field.
|
||||
func (p *GoldilocksApi) AddExtension(a, b QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
func (p *Chip) AddExtension(a, b QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
c0 := p.Add(a[0], b[0])
|
||||
c1 := p.Add(a[1], b[1])
|
||||
return NewQuadraticExtensionVariable(c0, c1)
|
||||
}
|
||||
|
||||
// Adds two quadratic extension variables in the Goldilocks field without reducing.
|
||||
func (p *GoldilocksApi) AddExtensionNoReduce(a, b QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
func (p *Chip) AddExtensionNoReduce(a, b QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
c0 := p.AddNoReduce(a[0], b[0])
|
||||
c1 := p.AddNoReduce(a[1], b[1])
|
||||
return NewQuadraticExtensionVariable(c0, c1)
|
||||
}
|
||||
|
||||
// Subtracts two quadratic extension variables in the Goldilocks field.
|
||||
func (p *GoldilocksApi) SubExtension(a, b QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
func (p *Chip) SubExtension(a, b QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
c0 := p.Sub(a[0], b[0])
|
||||
c1 := p.Sub(a[1], b[1])
|
||||
return NewQuadraticExtensionVariable(c0, c1)
|
||||
}
|
||||
|
||||
// Subtracts two quadratic extension variables in the Goldilocks field without reducing.
|
||||
func (p *GoldilocksApi) SubExtensionNoReduce(a, b QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
func (p *Chip) SubExtensionNoReduce(a, b QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
c0 := p.SubNoReduce(a[0], b[0])
|
||||
c1 := p.SubNoReduce(a[1], b[1])
|
||||
return NewQuadraticExtensionVariable(c0, c1)
|
||||
}
|
||||
|
||||
// Multiplies quadratic extension variable in the Goldilocks field.
|
||||
func (p *GoldilocksApi) MulExtension(a, b QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
func (p *Chip) MulExtension(a, b QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
product := p.MulExtensionNoReduce(a, b)
|
||||
product[0] = p.Reduce(product[0])
|
||||
product[1] = p.Reduce(product[1])
|
||||
@@ -64,7 +64,7 @@ func (p *GoldilocksApi) MulExtension(a, b QuadraticExtensionVariable) QuadraticE
|
||||
}
|
||||
|
||||
// Multiplies quadratic extension variable in the Goldilocks field without reducing.
|
||||
func (p *GoldilocksApi) MulExtensionNoReduce(a, b QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
func (p *Chip) MulExtensionNoReduce(a, b QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
c0o0 := p.MulNoReduce(a[0], b[0])
|
||||
c0o1 := p.MulNoReduce(p.MulNoReduce(NewVariable(7), a[1]), b[1])
|
||||
c0 := p.AddNoReduce(c0o0, c0o1)
|
||||
@@ -74,7 +74,7 @@ func (p *GoldilocksApi) MulExtensionNoReduce(a, b QuadraticExtensionVariable) Qu
|
||||
|
||||
// Multiplies two operands a and b and adds to c in the Goldilocks extension field. a * b + c must
|
||||
// be less than RANGE_CHECK_NB_BITS bits.
|
||||
func (p *GoldilocksApi) MulAddExtension(a, b, c QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
func (p *Chip) MulAddExtension(a, b, c QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
product := p.MulExtensionNoReduce(a, b)
|
||||
sum := p.AddExtensionNoReduce(product, c)
|
||||
sum[0] = p.Reduce(sum[0])
|
||||
@@ -82,7 +82,7 @@ func (p *GoldilocksApi) MulAddExtension(a, b, c QuadraticExtensionVariable) Quad
|
||||
return sum
|
||||
}
|
||||
|
||||
func (p *GoldilocksApi) MulAddExtensionNoReduce(a, b, c QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
func (p *Chip) MulAddExtensionNoReduce(a, b, c QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
product := p.MulExtensionNoReduce(a, b)
|
||||
sum := p.AddExtensionNoReduce(product, c)
|
||||
return sum
|
||||
@@ -90,7 +90,7 @@ func (p *GoldilocksApi) MulAddExtensionNoReduce(a, b, c QuadraticExtensionVariab
|
||||
|
||||
// Multiplies two operands a and b and subtracts to c in the Goldilocks extension field. a * b - c must
|
||||
// be less than RANGE_CHECK_NB_BITS bits.
|
||||
func (p *GoldilocksApi) SubMulExtension(a, b, c QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
func (p *Chip) SubMulExtension(a, b, c QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
difference := p.SubExtensionNoReduce(a, b)
|
||||
product := p.MulExtensionNoReduce(difference, c)
|
||||
product[0] = p.Reduce(product[0])
|
||||
@@ -99,7 +99,7 @@ func (p *GoldilocksApi) SubMulExtension(a, b, c QuadraticExtensionVariable) Quad
|
||||
}
|
||||
|
||||
// Multiplies quadratic extension variable in the Goldilocks field by a scalar.
|
||||
func (p *GoldilocksApi) ScalarMulExtension(
|
||||
func (p *Chip) ScalarMulExtension(
|
||||
a QuadraticExtensionVariable,
|
||||
b Variable,
|
||||
) QuadraticExtensionVariable {
|
||||
@@ -110,7 +110,7 @@ func (p *GoldilocksApi) ScalarMulExtension(
|
||||
}
|
||||
|
||||
// Computes an inner product over quadratic extension variable vectors in the Goldilocks field.
|
||||
func (p *GoldilocksApi) InnerProductExtension(
|
||||
func (p *Chip) InnerProductExtension(
|
||||
constant Variable,
|
||||
startingAcc QuadraticExtensionVariable,
|
||||
pairs [][2]QuadraticExtensionVariable,
|
||||
@@ -126,7 +126,7 @@ func (p *GoldilocksApi) InnerProductExtension(
|
||||
}
|
||||
|
||||
// Computes the inverse of a quadratic extension variable in the Goldilocks field.
|
||||
func (p *GoldilocksApi) InverseExtension(a QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
func (p *Chip) InverseExtension(a QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
a0IsZero := p.api.IsZero(a[0].Limb)
|
||||
a1IsZero := p.api.IsZero(a[1].Limb)
|
||||
p.api.AssertIsEqual(p.api.Mul(a0IsZero, a1IsZero), frontend.Variable(0))
|
||||
@@ -139,12 +139,12 @@ func (p *GoldilocksApi) InverseExtension(a QuadraticExtensionVariable) Quadratic
|
||||
}
|
||||
|
||||
// Divides two quadratic extension variables in the Goldilocks field.
|
||||
func (p *GoldilocksApi) DivExtension(a, b QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
func (p *Chip) DivExtension(a, b QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
return p.MulExtension(a, p.InverseExtension(b))
|
||||
}
|
||||
|
||||
// Exponentiates a quadratic extension variable to some exponent in the Golidlocks field.
|
||||
func (p *GoldilocksApi) ExpExtension(
|
||||
func (p *Chip) ExpExtension(
|
||||
a QuadraticExtensionVariable,
|
||||
exponent uint64,
|
||||
) QuadraticExtensionVariable {
|
||||
@@ -173,12 +173,12 @@ func (p *GoldilocksApi) ExpExtension(
|
||||
return product
|
||||
}
|
||||
|
||||
func (p *GoldilocksApi) ReduceExtension(x QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
func (p *Chip) ReduceExtension(x QuadraticExtensionVariable) QuadraticExtensionVariable {
|
||||
return NewQuadraticExtensionVariable(p.Reduce(x[0]), p.Reduce(x[1]))
|
||||
}
|
||||
|
||||
// Reduces a list of extension field terms with a scalar power in the Goldilocks field.
|
||||
func (p *GoldilocksApi) ReduceWithPowers(
|
||||
func (p *Chip) ReduceWithPowers(
|
||||
terms []QuadraticExtensionVariable,
|
||||
scalar QuadraticExtensionVariable,
|
||||
) QuadraticExtensionVariable {
|
||||
@@ -197,14 +197,14 @@ func (p *GoldilocksApi) ReduceWithPowers(
|
||||
}
|
||||
|
||||
// Outputs whether the quadratic extension variable is zero.
|
||||
func (p *GoldilocksApi) IsZero(x QuadraticExtensionVariable) frontend.Variable {
|
||||
func (p *Chip) IsZero(x QuadraticExtensionVariable) frontend.Variable {
|
||||
x0IsZero := p.api.IsZero(x[0].Limb)
|
||||
x1IsZero := p.api.IsZero(x[1].Limb)
|
||||
return p.api.Mul(x0IsZero, x1IsZero)
|
||||
}
|
||||
|
||||
// Lookup is similar to select, but returns the first variable if the bit is zero and vice-versa.
|
||||
func (p *GoldilocksApi) Lookup(
|
||||
func (p *Chip) Lookup(
|
||||
b frontend.Variable,
|
||||
x, y QuadraticExtensionVariable,
|
||||
) QuadraticExtensionVariable {
|
||||
@@ -214,7 +214,7 @@ func (p *GoldilocksApi) Lookup(
|
||||
}
|
||||
|
||||
// Lookup2 is similar to select2, but returns the first variable if the bit is zero and vice-versa.
|
||||
func (p *GoldilocksApi) Lookup2(
|
||||
func (p *Chip) Lookup2(
|
||||
b0 frontend.Variable,
|
||||
b1 frontend.Variable,
|
||||
qe0, qe1, qe2, qe3 QuadraticExtensionVariable,
|
||||
@@ -225,7 +225,7 @@ func (p *GoldilocksApi) Lookup2(
|
||||
}
|
||||
|
||||
// Asserts that two quadratic extension variables are equal.
|
||||
func (p *GoldilocksApi) AssertIsEqualExtension(
|
||||
func (p *Chip) AssertIsEqualExtension(
|
||||
a QuadraticExtensionVariable,
|
||||
b QuadraticExtensionVariable,
|
||||
) {
|
||||
@@ -233,7 +233,7 @@ func (p *GoldilocksApi) AssertIsEqualExtension(
|
||||
p.AssertIsEqual(a[1], b[1])
|
||||
}
|
||||
|
||||
func (p *GoldilocksApi) RangeCheckQE(a QuadraticExtensionVariable) {
|
||||
func (p *Chip) RangeCheckQE(a QuadraticExtensionVariable) {
|
||||
p.RangeCheck(a[0])
|
||||
p.RangeCheck(a[1])
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ func OneExtensionAlgebra() QuadraticExtensionAlgebraVariable {
|
||||
return OneExtension().ToQuadraticExtensionAlgebra()
|
||||
}
|
||||
|
||||
func (p *GoldilocksApi) AddExtensionAlgebra(
|
||||
func (p *Chip) AddExtensionAlgebra(
|
||||
a QuadraticExtensionAlgebraVariable,
|
||||
b QuadraticExtensionAlgebraVariable,
|
||||
) QuadraticExtensionAlgebraVariable {
|
||||
@@ -36,7 +36,7 @@ func (p *GoldilocksApi) AddExtensionAlgebra(
|
||||
return sum
|
||||
}
|
||||
|
||||
func (p *GoldilocksApi) SubExtensionAlgebra(
|
||||
func (p *Chip) SubExtensionAlgebra(
|
||||
a QuadraticExtensionAlgebraVariable,
|
||||
b QuadraticExtensionAlgebraVariable,
|
||||
) QuadraticExtensionAlgebraVariable {
|
||||
@@ -47,7 +47,7 @@ func (p *GoldilocksApi) SubExtensionAlgebra(
|
||||
return diff
|
||||
}
|
||||
|
||||
func (p GoldilocksApi) MulExtensionAlgebra(
|
||||
func (p Chip) MulExtensionAlgebra(
|
||||
a QuadraticExtensionAlgebraVariable,
|
||||
b QuadraticExtensionAlgebraVariable,
|
||||
) QuadraticExtensionAlgebraVariable {
|
||||
@@ -74,7 +74,7 @@ func (p GoldilocksApi) MulExtensionAlgebra(
|
||||
return product
|
||||
}
|
||||
|
||||
func (p *GoldilocksApi) ScalarMulExtensionAlgebra(
|
||||
func (p *Chip) ScalarMulExtensionAlgebra(
|
||||
a QuadraticExtensionVariable,
|
||||
b QuadraticExtensionAlgebraVariable,
|
||||
) QuadraticExtensionAlgebraVariable {
|
||||
@@ -85,7 +85,7 @@ func (p *GoldilocksApi) ScalarMulExtensionAlgebra(
|
||||
return product
|
||||
}
|
||||
|
||||
func (p *GoldilocksApi) PartialInterpolateExtAlgebra(
|
||||
func (p *Chip) PartialInterpolateExtAlgebra(
|
||||
domain []goldilocks.Element,
|
||||
values []QuadraticExtensionAlgebraVariable,
|
||||
barycentricWeights []goldilocks.Element,
|
||||
|
||||
@@ -15,7 +15,7 @@ type TestQuadraticExtensionMulCircuit struct {
|
||||
}
|
||||
|
||||
func (c *TestQuadraticExtensionMulCircuit) Define(api frontend.API) error {
|
||||
glApi := NewGoldilocksApi(api)
|
||||
glApi := New(api)
|
||||
actualRes := glApi.MulExtension(c.Operand1, c.Operand2)
|
||||
glApi.AssertIsEqual(actualRes[0], c.ExpectedResult[0])
|
||||
glApi.AssertIsEqual(actualRes[1], c.ExpectedResult[1])
|
||||
@@ -58,7 +58,7 @@ type TestQuadraticExtensionDivCircuit struct {
|
||||
}
|
||||
|
||||
func (c *TestQuadraticExtensionDivCircuit) Define(api frontend.API) error {
|
||||
glAPI := NewGoldilocksApi(api)
|
||||
glAPI := New(api)
|
||||
actualRes := glAPI.DivExtension(c.Operand1, c.Operand2)
|
||||
glAPI.AssertIsEqual(actualRes[0], c.ExpectedResult[0])
|
||||
glAPI.AssertIsEqual(actualRes[1], c.ExpectedResult[1])
|
||||
|
||||
Reference in New Issue
Block a user