16template <
typename Builder>
class cycle_group;
34 using Curve =
typename Builder::EmbeddedCurve;
38 static constexpr size_t NUM_BITS = ScalarField::modulus.get_msb() + 1;
39 static constexpr size_t LO_BITS = field_t::native::Params::MAX_BITS_PER_ENDOMORPHISM_SCALAR;
Represents a member of the Grumpkin curve scalar field (i.e. BN254 base field).
typename Builder::EmbeddedCurve Curve
typename Curve::ScalarField ScalarField
stdlib::bigfield< Builder, typename ScalarField::Params > BigScalarField
static constexpr size_t NUM_BITS
const field_t & hi() const
ScalarField get_value() const
const field_t & lo() const
static std::pair< uint256_t, uint256_t > decompose_into_lo_hi_u256(const uint256_t &value)
Decompose a uint256_t value into lo and hi parts for cycle_scalar representation.
static cycle_scalar from_witness(Builder *context, const ScalarField &value)
Construct a cycle scalar from a witness value in the Grumpkin scalar field.
static constexpr size_t LO_BITS
void validate_scalar_is_in_field() const
Validates that the scalar (lo + hi * 2^LO_BITS) is less than the Grumpkin scalar field modulus.
void unset_free_witness_tag()
Unset the free witness flag for the cycle scalar's tags.
Builder * get_context() const
void set_free_witness_tag()
Set the free witness flag for the cycle scalar's tags.
static constexpr size_t HI_BITS
OriginTag get_origin_tag() const
Get the origin tag of the cycle_scalar (a merge of the lo and hi tags)
void set_origin_tag(const OriginTag &tag)
Set the origin tag of lo and hi members of cycle scalar.
void unset_free_witness_tag() const
Unset the free witness flag for the field element's tag.
Builder * get_context() const
OriginTag get_origin_tag() const
void set_free_witness_tag()
Set the free witness flag for the field element's tag.
void set_origin_tag(const OriginTag &new_tag) const
StrictMock< MockContext > context
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
This file contains part of the logic for the Origin Tag mechanism that tracks the use of in-circuit p...