Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
mutation_helper.cpp
Go to the documentation of this file.
1#include "mutation_helper.hpp"
2
3#include <cassert>
4#include <cstdint>
5
9
11
12using bb::avm2::FF;
15
16MemoryValue read_mem_value(FuzzedDataProvider& fdp)
17{
18 // Grab 32 bytes for a uint256
19 uint64_t limb0 = fdp.ConsumeIntegral<uint64_t>();
20 uint64_t limb1 = fdp.ConsumeIntegral<uint64_t>();
21 uint64_t limb2 = fdp.ConsumeIntegral<uint64_t>();
22 uint64_t limb3 = fdp.ConsumeIntegral<uint64_t>();
23
24 uint256_t value = uint256_t(limb0, limb1, limb2, limb3);
25
26 int tag_choice = fdp.ConsumeIntegralInRange<int>(0, 6);
27 switch (tag_choice) {
28 case 0:
30 break;
31 case 1:
33 break;
34 case 2:
36 break;
37 case 3:
39 break;
40 case 4:
42 break;
43 case 5:
45 break;
46 case 6:
48 break;
49 default:
50 assert(false && "unreachable");
51 }
52 // To satisfy compiler
54}
55
56} // namespace bb::avm2::fuzzing
bb::field< bb::Bn254FrParams > FF
Definition field.cpp:22
static TaggedValue from_tag_truncating(ValueTag tag, FF value)
MemoryValue read_mem_value(FuzzedDataProvider &fdp)
Read a MemoryValue from the fuzzed data provider.
AvmFlavorSettings::FF FF
Definition field.hpp:10