diff --git a/src/lib/gadgets/gadgets.ts b/src/lib/gadgets/gadgets.ts index ab010921b0..00e11a7a72 100644 --- a/src/lib/gadgets/gadgets.ts +++ b/src/lib/gadgets/gadgets.ts @@ -253,7 +253,7 @@ const Gadgets = { * * @throws Throws an error if `xy` exceeds 2*88 = 176 bits, or if z exceeds 88 bits. */ - compactMultiRangeCheck(limbs: [Field, Field]) { - return compactMultiRangeCheck(limbs); + compactMultiRangeCheck(xy: Field, z: Field) { + return compactMultiRangeCheck(xy, z); }, }; diff --git a/src/lib/gadgets/range-check.ts b/src/lib/gadgets/range-check.ts index bc806f430e..1f4f369157 100644 --- a/src/lib/gadgets/range-check.ts +++ b/src/lib/gadgets/range-check.ts @@ -77,11 +77,7 @@ function multiRangeCheck([x, y, z]: [Field, Field, Field]) { * * Returns the full limbs x, y, z */ -function compactMultiRangeCheck([xy, z]: [Field, Field]): [ - Field, - Field, - Field -] { +function compactMultiRangeCheck(xy: Field, z: Field): [Field, Field, Field] { // constant case if (xy.isConstant() && z.isConstant()) { if (xy.toBigInt() >> twoL || z.toBigInt() >> L) { diff --git a/src/lib/gadgets/range-check.unit-test.ts b/src/lib/gadgets/range-check.unit-test.ts index 0796183871..c66c6a806d 100644 --- a/src/lib/gadgets/range-check.unit-test.ts +++ b/src/lib/gadgets/range-check.unit-test.ts @@ -38,8 +38,8 @@ let check64 = Provable.constraintSystem(() => { Gadgets.rangeCheck64(x); }); let multi = Provable.constraintSystem(() => { - let [x, y, z] = exists(3, () => [0n, 0n, 0n]); - Gadgets.multiRangeCheck(x, y, z); + let x = exists(3, () => [0n, 0n, 0n]); + Gadgets.multiRangeCheck(x); }); let compact = Provable.constraintSystem(() => { let [xy, z] = exists(2, () => [0n, 0n]); @@ -70,7 +70,7 @@ let RangeCheck = ZkProgram({ checkMulti: { privateInputs: [Field, Field, Field], method(x, y, z) { - Gadgets.multiRangeCheck(x, y, z); + Gadgets.multiRangeCheck([x, y, z]); }, }, checkCompact: {