NilFoundation / zkLLVM

Zero-Knowledge Proof Systems Circuit Compiler
https://docs.nil.foundation/zkllvm
278 stars 48 forks source link

[Feature request]: Range check intrinsic #505

Open ETatuzova opened 7 months ago

ETatuzova commented 7 months ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is.

Describe the solution or interface you'd like Input -- field type Parameter -- number of bits Output -- bool

Additional context We need this for poseidon grinding block in recursive verification. We have to have a possibility to check that field element is less than 222 bits

ETatuzova commented 7 months ago

We can just switch on range_check component for operator < on pallas::base_field_type::value_type if second operand is constant and 2-degree