Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bitwise.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4
8
9namespace bb::avm2::simulation {
10
12 public:
13 virtual ~BitwiseInterface() = default;
14 virtual MemoryValue and_op(const MemoryValue& a, const MemoryValue& b) = 0;
15 virtual MemoryValue or_op(const MemoryValue& a, const MemoryValue& b) = 0;
16 virtual MemoryValue xor_op(const MemoryValue& a, const MemoryValue& b) = 0;
17};
18
19class Bitwise : public BitwiseInterface {
20 public:
24
25 MemoryValue and_op(const MemoryValue& a, const MemoryValue& b) override;
26 MemoryValue or_op(const MemoryValue& a, const MemoryValue& b) override;
27 MemoryValue xor_op(const MemoryValue& a, const MemoryValue& b) override;
28
29 private:
30 // TODO: Use deduplicating events + consider (see bottom paragraph of bitwise.pil) a further deduplication
31 // when some inputs are prefixes of another ones (with a bigger tag).
33};
34
35} // namespace bb::avm2::simulation
MemoryValue and_op(const MemoryValue &a, const MemoryValue &b) override
Definition bitwise.cpp:11
Bitwise(EventEmitterInterface< BitwiseEvent > &event_emitter)
Definition bitwise.hpp:21
EventEmitterInterface< BitwiseEvent > & events
Definition bitwise.hpp:32
MemoryValue or_op(const MemoryValue &a, const MemoryValue &b) override
Definition bitwise.cpp:24
MemoryValue xor_op(const MemoryValue &a, const MemoryValue &b) override
Definition bitwise.cpp:37
virtual MemoryValue or_op(const MemoryValue &a, const MemoryValue &b)=0
virtual MemoryValue xor_op(const MemoryValue &a, const MemoryValue &b)=0
virtual MemoryValue and_op(const MemoryValue &a, const MemoryValue &b)=0
EventEmitter< DataCopyEvent > event_emitter
FF a
FF b