Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shubham-kanodia/91090217764f788274d5c18d8b7e36ff to your computer and use it in GitHub Desktop.
Save shubham-kanodia/91090217764f788274d5c18d8b7e36ff to your computer and use it in GitHub Desktop.
What input value greater than 4294967296 and within the prime field satisfies the given equation?
pragma circom 2.1.4;
include "circomlib/circuits/comparators.circom";
template RangeProof(bits, max_abs_value) {
signal input in;
component lowerBound = LessThan(bits);
component upperBound = LessThan(bits);
lowerBound.in[0] <== max_abs_value + in;
lowerBound.in[1] <== 0;
lowerBound.out === 0;
upperBound.in[0] <== 2 * max_abs_value;
upperBound.in[1] <== max_abs_value + in;
upperBound.out === 0;
}
component main = RangeProof(33, 4294967296);
/* INPUT = {
"in": ""
} */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment