|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
Witness-generating implementation of bitwise AND/OR/XOR operations. More...
#include <bitwise.hpp>
Public Member Functions | |
| Bitwise (EventEmitterInterface< BitwiseEvent > &event_emitter) | |
| MemoryValue | and_op (const MemoryValue &a, const MemoryValue &b) override |
| Perform bitwise AND on two tagged memory values. | |
| MemoryValue | or_op (const MemoryValue &a, const MemoryValue &b) override |
| Perform bitwise OR on two tagged memory values. | |
| MemoryValue | xor_op (const MemoryValue &a, const MemoryValue &b) override |
| Perform bitwise XOR on two tagged memory values. | |
| std::pair< MemoryValue, MemoryValue > | simd_and_op_64 (const MemoryValue &a1, const MemoryValue &b1, const MemoryValue &a2, const MemoryValue &b2) override |
| Two independent U64 ANDs packed into one U128 sub-trace row (SIMD-64). | |
| std::pair< MemoryValue, MemoryValue > | simd_xor_op_64 (const MemoryValue &a1, const MemoryValue &b1, const MemoryValue &a2, const MemoryValue &b2) override |
| Two independent U64 XORs packed into one U128 sub-trace row (SIMD-64). See simd_and_op_64. | |
Public Member Functions inherited from bb::avm2::simulation::BitwiseInterface | |
| virtual | ~BitwiseInterface ()=default |
Private Attributes | |
| EventEmitterInterface< BitwiseEvent > & | events |
Witness-generating implementation of bitwise AND/OR/XOR operations.
Definition at line 15 of file bitwise.hpp.
|
inline |
| event_emitter | Destination for BitwiseEvent emissions consumed by tracegen. |
Definition at line 20 of file bitwise.hpp.
|
overridevirtual |
Perform bitwise AND on two tagged memory values.
On success, emits a BitwiseEvent with the computed result and returns it. On error (FF tag or tag mismatch), emits the event with res=0, then throws.
| a | Left operand. |
| b | Right operand. |
| BitwiseException | If either tag is FF or tags don't match. |
Implements bb::avm2::simulation::BitwiseInterface.
Definition at line 21 of file bitwise.cpp.
|
overridevirtual |
Perform bitwise OR on two tagged memory values.
On success, emits a BitwiseEvent with the computed result and returns it. On error (FF tag or tag mismatch), emits the event with res=0, then throws.
| a | Left operand. |
| b | Right operand. |
| BitwiseException | If either tag is FF or tags don't match. |
Implements bb::avm2::simulation::BitwiseInterface.
Definition at line 50 of file bitwise.cpp.
|
overridevirtual |
Two independent U64 ANDs packed into one U128 sub-trace row (SIMD-64).
AND is bit-independent, so the low and high 64-bit lanes do not interact. Emits a single BitwiseEvent with simd_64=true holding the packed U128 operands/result.
Implements bb::avm2::simulation::BitwiseSimdInterface.
Definition at line 116 of file bitwise.cpp.
|
overridevirtual |
Two independent U64 XORs packed into one U128 sub-trace row (SIMD-64). See simd_and_op_64.
Implements bb::avm2::simulation::BitwiseSimdInterface.
Definition at line 137 of file bitwise.cpp.
|
overridevirtual |
Perform bitwise XOR on two tagged memory values.
On success, emits a BitwiseEvent with the computed result and returns it. On error (FF tag or tag mismatch), emits the event with res=0, then throws.
| a | Left operand. |
| b | Right operand. |
| BitwiseException | If either tag is FF or tags don't match. |
Implements bb::avm2::simulation::BitwiseInterface.
Definition at line 79 of file bitwise.cpp.
|
private |
Definition at line 38 of file bitwise.hpp.