2#include "../../bool/bool.hpp"
3#include "../../byte_array/byte_array.hpp"
4#include "../../circuit_builders/circuit_builders_fwd.hpp"
5#include "../../field/field.hpp"
6#include "../../plookup/plookup.hpp"
13 using FF =
typename Builder::FF;
14 static constexpr size_t width =
sizeof(Native) * 8;
28 std::vector<uint32_t> constrain_accumulators(
Builder* ctx,
const uint32_t witness_index)
const;
30 static constexpr size_t bits_per_limb = 12;
31 static constexpr size_t num_accumulators() {
return (width + bits_per_limb - 1) / bits_per_limb; }
60 return ror(
static_cast<size_t>(target_rotation.data[0]));
64 return rol(
static_cast<size_t>(target_rotation.data[0]));
77 *
this = operator+(other);
82 *
this = operator-(other);
87 *
this = operator*(other);
92 *
this = operator/(other);
97 *
this = operator%(other);
103 *
this = operator&(other);
108 *
this = operator^(other);
113 *
this = operator|(other);
119 *
this = operator>>(shift);
124 *
this = operator<<(shift);
132 bool is_constant()
const {
return witness_index == IS_CONSTANT; }
133 Builder* get_context()
const {
return context; }
137 size_t get_width()
const {
return width; }
139 uint32_t get_witness_index()
const {
return witness_index; }
141 uint256_t get_additive_constant()
const {
return additive_constant; }
143 std::vector<uint32_t> get_accumulators()
const {
return accumulators; }
149 enum WitnessStatus { OK, NOT_NORMALIZED, WEAK_NORMALIZED };
152 mutable WitnessStatus witness_status;
155 mutable std::vector<uint32_t> accumulators;
156 mutable uint32_t witness_index;
159 static constexpr uint256_t MASK = CIRCUIT_UINT_MAX_PLUS_ONE - 1;
167 std::pair<uint_plookup, uint_plookup> divmod(
const uint_plookup& other)
const;
171template <
typename T,
typename w>
inline std::ostream& operator<<(std::ostream& os,
uint_plookup<T, w> const& v)
173 return os << v.get_value();
176EXTERN_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint8_t);
177EXTERN_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint16_t);
178EXTERN_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint32_t);
179EXTERN_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint64_t);
Definition: uint256.hpp:25
Definition: standard_circuit_builder.hpp:12
Definition: byte_array.hpp:9
bool_t< Builder > operator>(const uint_plookup &other) const
Definition: comparison.cpp:10
Definition: witness.hpp:10
Definition: widget.bench.cpp:13