16template <
typename Builder>
class cycle_group;
33 using Curve =
typename Builder::EmbeddedCurve;
37 static constexpr size_t NUM_BITS = ScalarField::modulus.get_msb() + 1;
38 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
bool skip_primality_test() const
bool use_bn254_scalar_field_for_primality_test() const
static cycle_scalar from_u256_witness(Builder *context, const uint256_t &bitstring)
Construct a cycle scalar from a uint256_t witness bitstring.
stdlib::bigfield< Builder, typename ScalarField::Params > BigScalarField
static constexpr size_t NUM_BITS
ScalarField get_value() const
bool _use_bn254_scalar_field_for_primality_test
cycle_scalar(const field_t &_lo, const field_t &_hi, const size_t bits, const bool skip_primality_test, const bool use_bn254_scalar_field_for_primality_test)
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 appropriate field modulus.
bool _skip_primality_test
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.
void set_origin_tag(const OriginTag &tag) const
Set the origin tag of lo and hi members of cycle scalar.
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)
static cycle_scalar create_from_bn254_scalar(const field_t &_in)
Construct a cycle scalar (grumpkin scalar field element) from a bn254 scalar field element.
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...