33template <
class Fq,
class Fr,
class Params>
class alignas(32)
element {
45 static constexpr
element one() noexcept {
return { Params::one_x, Params::one_y,
Fq::one() }; };
71 constexpr
element operator-() const noexcept;
116 template <typename = typename
std::enable_if<
Params::can_hash_to_curve>>
142 uint64_t predicate) noexcept;
146 os <<
"{ " <<
a.x <<
", " <<
a.y <<
", " <<
a.z <<
" }";
153 return os <<
"x:" << e.
x <<
" y:" << e.
y <<
" z:" << e.
z;
element class. Implements ecc group arithmetic using Jacobian coordinates See https://hyperelliptic....
element operator*=(const Fr &exponent) noexcept
BB_INLINE constexpr element set_infinity() const noexcept
element mul_with_endomorphism(const Fr &scalar) const noexcept
static element infinity()
static std::vector< affine_element< Fq, Fr, Params > > batch_mul_with_endomorphism(const std::span< const affine_element< Fq, Fr, Params > > &points, const Fr &scalar) noexcept
Multiply each point by the same scalar.
static constexpr element zero() noexcept
constexpr element dbl() const noexcept
constexpr element normalize() const noexcept
friend constexpr element operator-(const affine_element< Fq, Fr, Params > &left, const element &right) noexcept
constexpr void self_dbl() noexcept
static element random_element(numeric::RNG *engine=nullptr) noexcept
static void batch_normalize(element *elements, size_t num_elements) noexcept
static constexpr element one() noexcept
static void batch_affine_add(const std::span< affine_element< Fq, Fr, Params > > &first_group, const std::span< affine_element< Fq, Fr, Params > > &second_group, const std::span< affine_element< Fq, Fr, Params > > &results) noexcept
Pairwise affine add points in first and second group.
BB_INLINE constexpr bool on_curve() const noexcept
element operator*(const Fr &exponent) const noexcept
constexpr void self_mixed_add_or_sub(const affine_element< Fq, Fr, Params > &other, uint64_t predicate) noexcept
static constexpr Fq curve_b
element() noexcept=default
static void conditional_negate_affine(const affine_element< Fq, Fr, Params > &in, affine_element< Fq, Fr, Params > &out, uint64_t predicate) noexcept
static element random_coordinates_on_curve(numeric::RNG *engine=nullptr) noexcept
element mul_without_endomorphism(const Fr &scalar) const noexcept
constexpr element & operator=(const element &other) noexcept
BB_INLINE constexpr void self_set_infinity() noexcept
BB_INLINE constexpr bool is_point_at_infinity() const noexcept
crypto::Poseidon2Bn254ScalarFieldParams Params
std::ostream & operator<<(std::ostream &os, element< Fq, Fr, Params > const &e)
static constexpr field one()