|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include <alu.hpp>
Public Member Functions | |
| Alu (GreaterThanInterface &greater_than, FieldGreaterThanInterface &field_gt, RangeCheckInterface &range_check, EventEmitterInterface< AluEvent > &event_emitter) | |
| MemoryValue | add (const MemoryValue &a, const MemoryValue &b) override |
| Add two memory values and emit an event of type AluEvent. | |
| MemoryValue | sub (const MemoryValue &a, const MemoryValue &b) override |
| Subtract two memory values and emit an event of type AluEvent. | |
| MemoryValue | mul (const MemoryValue &a, const MemoryValue &b) override |
| Multiply two memory values and emit an event of type AluEvent. | |
| MemoryValue | div (const MemoryValue &a, const MemoryValue &b) override |
| Divide two memory values and emit an event of type AluEvent. | |
| MemoryValue | fdiv (const MemoryValue &a, const MemoryValue &b) override |
| Perform field division on two memory values and emit an event of type AluEvent. | |
| MemoryValue | eq (const MemoryValue &a, const MemoryValue &b) override |
| Check if two memory values are equal and emit an event of type AluEvent. | |
| MemoryValue | lt (const MemoryValue &a, const MemoryValue &b) override |
| Check if the first memory value is less than the second and emit an event of type AluEvent. | |
| MemoryValue | lte (const MemoryValue &a, const MemoryValue &b) override |
| Check if the first memory value is less than or equal to the second and emit an event of type AluEvent. | |
| MemoryValue | op_not (const MemoryValue &a) override |
| Perform bitwise NOT operation on a memory value and emit an event of type AluEvent. | |
| MemoryValue | shr (const MemoryValue &a, const MemoryValue &b) override |
| Perform right shift operation on a memory value and emit an event of type AluEvent. | |
| MemoryValue | shl (const MemoryValue &a, const MemoryValue &b) override |
| Perform left shift operation on a memory value and emit an event of type AluEvent. | |
| MemoryValue | truncate (const FF &a, MemoryTag dst_tag) override |
| Truncate a field element to a specific memory tag and emit an event of type AluEvent. | |
Public Member Functions inherited from bb::avm2::simulation::AluInterface | |
| virtual | ~AluInterface ()=default |
Private Attributes | |
| GreaterThanInterface & | greater_than |
| FieldGreaterThanInterface & | field_gt |
| RangeCheckInterface & | range_check |
| EventEmitterInterface< AluEvent > & | events |
|
inline |
|
overridevirtual |
Add two memory values and emit an event of type AluEvent.
| AluException | if the tags of a and b do not match. |
| a | The first memory value. |
| b | The second memory value. |
Implements bb::avm2::simulation::AluInterface.
|
overridevirtual |
Divide two memory values and emit an event of type AluEvent.
| AluException | if (in order):
|
| a | The dividend memory value. |
| b | The divisor memory value. |
Implements bb::avm2::simulation::AluInterface.
|
overridevirtual |
Check if two memory values are equal and emit an event of type AluEvent.
| AluException | if the tags of a and b do not match. |
| a | The first memory value. |
| b | The second memory value. |
Implements bb::avm2::simulation::AluInterface.
|
overridevirtual |
Perform field division on two memory values and emit an event of type AluEvent.
| AluException | if (in order):
|
| a | The dividend memory value. |
| b | The divisor memory value. |
Implements bb::avm2::simulation::AluInterface.
|
overridevirtual |
Check if the first memory value is less than the second and emit an event of type AluEvent.
| AluException | if the tags of a and b do not match. |
| a | The first memory value. |
| b | The second memory value. |
Implements bb::avm2::simulation::AluInterface.
|
overridevirtual |
Check if the first memory value is less than or equal to the second and emit an event of type AluEvent.
| AluException | if the tags of a and b do not match. |
| a | The first memory value. |
| b | The second memory value. |
Implements bb::avm2::simulation::AluInterface.
|
overridevirtual |
Multiply two memory values and emit an event of type AluEvent.
| AluException | if the tags of a and b do not match. |
| a | The first memory value. |
| b | The second memory value. |
Implements bb::avm2::simulation::AluInterface.
|
overridevirtual |
Perform bitwise NOT operation on a memory value and emit an event of type AluEvent.
| AluException | for field elements. |
| a | The memory value to negate. |
Implements bb::avm2::simulation::AluInterface.
|
overridevirtual |
Perform left shift operation on a memory value and emit an event of type AluEvent.
| AluException | if the tags (in order):
|
| a | The memory value to shift. |
| b | The number of positions to shift left. |
Implements bb::avm2::simulation::AluInterface.
|
overridevirtual |
Perform right shift operation on a memory value and emit an event of type AluEvent.
| AluException | if the tags (in order):
|
| a | The memory value to shift. |
| b | The number of positions to shift right. |
Implements bb::avm2::simulation::AluInterface.
|
overridevirtual |
Subtract two memory values and emit an event of type AluEvent.
| AluException | if the tags of a and b do not match. |
| a | The first memory value (minuend). |
| b | The second memory value (subtrahend). |
Implements bb::avm2::simulation::AluInterface.
|
overridevirtual |
Truncate a field element to a specific memory tag and emit an event of type AluEvent.
| a | The field element to truncate. |
| dst_tag | The target memory tag to truncate to. |
Implements bb::avm2::simulation::AluInterface.
|
private |
|
private |
|
private |
|
private |