Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
to_radix.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <stdexcept>
5#include <string>
6#include <utility>
7#include <vector>
8
11
12namespace bb::avm2::simulation {
13
14// Forward declarations
15class MemoryInterface;
16
18 public:
19 virtual ~ToRadixInterface() = default;
20 virtual std::pair<std::vector<uint8_t>, /* truncated */ bool> to_le_radix(const FF& value,
21 uint32_t num_limbs,
22 uint32_t radix) = 0;
23 virtual std::pair<std::vector<bool>, /* truncated */ bool> to_le_bits(const FF& value, uint32_t num_limbs) = 0;
25 const FF& value,
26 uint32_t radix,
27 uint32_t num_limbs,
28 bool is_output_bits,
30};
31
32class ToRadixException : public std::runtime_error {
33 public:
34 explicit ToRadixException(const std::string& message)
35 : std::runtime_error("ToRadix Exception: " + message)
36 {}
37};
38
39} // namespace bb::avm2::simulation
ToRadixException(const std::string &message)
Definition to_radix.hpp:34
virtual std::pair< std::vector< bool >, bool > to_le_bits(const FF &value, uint32_t num_limbs)=0
virtual std::pair< std::vector< uint8_t >, bool > to_le_radix(const FF &value, uint32_t num_limbs, uint32_t radix)=0
virtual void to_be_radix(MemoryInterface &memory, const FF &value, uint32_t radix, uint32_t num_limbs, bool is_output_bits, MemoryAddress dst_addr)=0
uint32_t dst_addr
AVM range check gadget for witness generation.
AvmFlavorSettings::FF FF
Definition field.hpp:10
uint32_t MemoryAddress
STL namespace.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13