1
0
Fork 0
mirror of synced 2025-09-23 04:08:33 +00:00
ZoKrates/zokrates_cli/examples/test_lt_max_value.zok
2022-04-06 20:23:58 +02:00

10 lines
325 B
Text

from "field" import FIELD_SIZE_IN_BITS;
// we can compare numbers up to 2^(pbits - 2) - 1, ie any number which fits in (pbits - 2) bits
// lt should work for the maxvalue = 2^(pbits - 2) - 1
def main(field a) -> bool {
u32 pbits = FIELD_SIZE_IN_BITS;
field maxvalue = 2**(pbits - 2) - 1;
return 0 < maxvalue;
}