#include <gt.hpp>
Definition at line 14 of file gt.hpp.
◆ GreaterThan()
◆ gt() [1/3]
| bool bb::avm2::simulation::GreaterThan::gt |
( |
const FF & |
a, |
|
|
const FF & |
b |
|
) |
| |
|
overridevirtual |
Computes whether a > b for field elements, delegating to the ff_gt gadget.
- Parameters
-
| a | The first field element. |
| b | The second field element. |
- Returns
- true if a > b (as canonical field integers), false otherwise.
Implements bb::avm2::simulation::GreaterThanInterface.
Definition at line 15 of file gt.cpp.
◆ gt() [2/3]
Computes whether a > b for memory values, dispatching by tag.
Field-tagged values are compared via the ff_gt gadget. All other types (u8, u16, u32, u64, u128) are compared as uint128 integers.
- Parameters
-
| a | The first memory value. |
| b | The second memory value. |
- Returns
- true if a > b, false otherwise.
- Note
- Asserts that neither input has FF tag when taking the integer comparison path.
Implements bb::avm2::simulation::GreaterThanInterface.
Definition at line 58 of file gt.cpp.
◆ gt() [3/3]
Computes whether a > b for uint128 values.
Computes the absolute difference: (a - b - 1) if a > b, or (b - a) if a <= b. Range-checks this difference to prove the subtraction did not underflow, which in turn proves the comparison result is correct. See gt.pil for the full argument.
- Parameters
-
| a | The first uint128 value. |
| b | The second uint128 value. |
- Returns
- true if a > b, false otherwise.
Implements bb::avm2::simulation::GreaterThanInterface.
Definition at line 31 of file gt.cpp.
◆ events
◆ field_gt
◆ range_check
The documentation for this class was generated from the following files:
- src/barretenberg/vm2/simulation/gadgets/gt.hpp
- src/barretenberg/vm2/simulation/gadgets/gt.cpp