Skip to content

Commit

Permalink
revert compact rc signature tweak, and fixup test
Browse files Browse the repository at this point in the history
  • Loading branch information
mitschabaude committed Nov 3, 2023
1 parent 1a666e8 commit 9a594c9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/lib/gadgets/gadgets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
};
6 changes: 1 addition & 5 deletions src/lib/gadgets/range-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions src/lib/gadgets/range-check.unit-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down Expand Up @@ -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: {
Expand Down

0 comments on commit 9a594c9

Please sign in to comment.