|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include <range_check.hpp>
Public Member Functions | |
| RangeCheck (EventEmitterInterface< RangeCheckEvent > &event_emitter) | |
| void | assert_range (uint128_t value, uint8_t num_bits) override |
| Assert that a value fits within a given bit-width. | |
Public Member Functions inherited from bb::avm2::simulation::RangeCheckInterface | |
| virtual | ~RangeCheckInterface ()=default |
Private Attributes | |
| EventEmitterInterface< RangeCheckEvent > & | events |
Definition at line 11 of file range_check.hpp.
|
inline |
Definition at line 13 of file range_check.hpp.
|
overridevirtual |
Assert that a value fits within a given bit-width.
Validates that the value can be represented using at most num_bits bits (i.e., value < 2^num_bits). On success, emits a RangeCheckEvent that will be consumed by trace generation to produce the corresponding range check constraint rows.
| value | The value to range-check (up to 128 bits). |
| num_bits | The maximum number of bits allowed. Must be <= 128. |
Implements bb::avm2::simulation::RangeCheckInterface.
Definition at line 25 of file range_check.cpp.
|
private |
Definition at line 20 of file range_check.hpp.