Skip to content

Instantly share code, notes, and snippets.

@enricobottazzi
Created January 5, 2023 11:11
Show Gist options
  • Save enricobottazzi/382e726dc426c5ebae08498207e4f004 to your computer and use it in GitHub Desktop.
Save enricobottazzi/382e726dc426c5ebae08498207e4f004 to your computer and use it in GitHub Desktop.
Circuit to test Range Check Overflow
pragma circom 2.1.0;
include "node_modules/circomlib/circuits/bitify.circom";
template Example () {
signal input a;
log(a);
// prevent overflow of leafSum
component aRangeCheck = Num2Bits(252);
aRangeCheck.in <== a;
}
component main = Example();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment