Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
pure_bitwise.cpp
Go to the documentation of this file.
1
#include "
barretenberg/vm2/simulation/standalone/pure_bitwise.hpp
"
2
3
#include "
barretenberg/vm2/common/memory_types.hpp
"
4
#include "
barretenberg/vm2/common/tagged_value.hpp
"
5
#include "
barretenberg/vm2/simulation/interfaces/bitwise.hpp
"
6
7
namespace
bb::avm2::simulation
{
8
9
MemoryValue
PureBitwise::and_op
(
const
MemoryValue
&
a
,
const
MemoryValue
&
b
)
10
{
11
try
{
12
return
a
&
b
;
13
}
catch
(
const
std::exception& e) {
14
throw
BitwiseException
(
"AND, "
+ std::string(e.what()));
15
}
16
}
17
MemoryValue
PureBitwise::or_op
(
const
MemoryValue
&
a
,
const
MemoryValue
&
b
)
18
{
19
try
{
20
return
a
|
b
;
21
}
catch
(
const
std::exception& e) {
22
throw
BitwiseException
(
"OR, "
+ std::string(e.what()));
23
}
24
}
25
MemoryValue
PureBitwise::xor_op
(
const
MemoryValue
&
a
,
const
MemoryValue
&
b
)
26
{
27
try
{
28
return
a
^
b
;
29
}
catch
(
const
std::exception& e) {
30
throw
BitwiseException
(
"XOR, "
+ std::string(e.what()));
31
}
32
}
33
34
}
// namespace bb::avm2::simulation
bb::avm2::TaggedValue
Definition
tagged_value.hpp:70
bb::avm2::simulation::BitwiseException
Definition
bitwise.hpp:15
bb::avm2::simulation::PureBitwise::xor_op
MemoryValue xor_op(const MemoryValue &a, const MemoryValue &b) override
Definition
pure_bitwise.cpp:25
bb::avm2::simulation::PureBitwise::or_op
MemoryValue or_op(const MemoryValue &a, const MemoryValue &b) override
Definition
pure_bitwise.cpp:17
bb::avm2::simulation::PureBitwise::and_op
MemoryValue and_op(const MemoryValue &a, const MemoryValue &b) override
Definition
pure_bitwise.cpp:9
a
FF a
Definition
field_gt.test.cpp:52
b
FF b
Definition
field_gt.test.cpp:53
memory_types.hpp
bb::avm2::simulation
Definition
address_derivation_event.hpp:6
pure_bitwise.hpp
bitwise.hpp
tagged_value.hpp
src
barretenberg
vm2
simulation
standalone
pure_bitwise.cpp
Generated by
1.9.8