|
| affine_element () noexcept=default |
|
| ~affine_element () noexcept=default |
|
constexpr | affine_element (const Fq &x, const Fq &y) noexcept |
|
constexpr | affine_element (const affine_element &other) noexcept=default |
|
constexpr | affine_element (affine_element &&other) noexcept=default |
|
constexpr affine_element & | operator= (const affine_element &other) noexcept=default |
|
constexpr affine_element & | operator= (affine_element &&other) noexcept=default |
|
constexpr affine_element | operator+ (const affine_element &other) const noexcept |
|
constexpr affine_element | operator* (const Fr &exponent) const noexcept |
|
template<typename BaseField = Fq, typename CompileTimeEnabled = std::enable_if_t<(BaseField::modulus >> 255) == uint256_t(0), void>> |
constexpr uint256_t | compress () const noexcept |
|
constexpr affine_element | set_infinity () const noexcept |
|
constexpr void | self_set_infinity () noexcept |
|
constexpr bool | is_point_at_infinity () const noexcept |
|
constexpr bool | on_curve () const noexcept |
|
constexpr bool | operator== (const affine_element &other) const noexcept |
|
constexpr affine_element | operator- () const noexcept |
|
constexpr bool | operator> (const affine_element &other) const noexcept |
|
constexpr bool | operator< (const affine_element &other) const noexcept |
|
std::vector< uint8_t > | to_buffer () const |
| Serialize the point to a byte vector.
|
|
void | msgpack_pack (auto &packer) const |
|
void | msgpack_unpack (auto o) |
|
void | msgpack_schema (auto &packer) const |
|
template<typename BaseField , typename CompileTimeEnabled > |
constexpr affine_element< Fq, Fr, T > | from_compressed (const uint256_t &compressed) noexcept |
|
template<typename BaseField , typename CompileTimeEnabled > |
constexpr std::array< affine_element< Fq, Fr, T >, 2 > | from_compressed_unsafe (const uint256_t &compressed) noexcept |
|
|
static constexpr affine_element | one () noexcept |
|
template<typename BaseField = Fq, typename CompileTimeEnabled = std::enable_if_t<(BaseField::modulus >> 255) == uint256_t(0), void>> |
static constexpr affine_element | from_compressed (const uint256_t &compressed) noexcept |
| Reconstruct a point in affine coordinates from compressed form.
|
|
template<typename BaseField = Fq, typename CompileTimeEnabled = std::enable_if_t<(BaseField::modulus >> 255) == uint256_t(1), void>> |
static constexpr std::array< affine_element, 2 > | from_compressed_unsafe (const uint256_t &compressed) noexcept |
| Reconstruct a point in affine coordinates from compressed form.
|
|
static affine_element | infinity () |
|
static constexpr std::optional< affine_element > | derive_from_x_coordinate (const Fq &x, bool sign_bit) noexcept |
|
static affine_element | random_element (numeric::RNG *engine=nullptr) noexcept |
| Samples a random point on the curve.
|
|
static constexpr affine_element | hash_to_curve (const std::vector< uint8_t > &seed, uint8_t attempt_count=0) noexcept |
| Hash a seed buffer into a point.
|
|
static void | serialize_to_buffer (const affine_element &value, uint8_t *buffer, bool write_x_first=false) |
| Serialize the point to the given buffer.
|
|
static affine_element | serialize_from_buffer (const uint8_t *buffer, bool write_x_first=false) |
| Restore point from a buffer.
|
|
static affine_element | reconstruct_from_public (const std::span< const bb::fr, PUBLIC_INPUTS_SIZE > &limbs) |
|
template<typename Fq_, typename Fr_, typename Params_>
class bb::group_elements::affine_element< Fq_, Fr_, Params_ >
Definition at line 21 of file affine_element.hpp.
template<typename Fq_ , typename Fr_ , typename Params_ >
template<typename BaseField = Fq, typename CompileTimeEnabled = std::enable_if_t<(BaseField::modulus >> 255) == uint256_t(0), void>>
Reconstruct a point in affine coordinates from compressed form.
#LARGE_MODULUS_AFFINE_POINT_COMPRESSION Point compression is only implemented for curves of a prime field F_p with p using < 256 bits. One possiblity for extending to a 256-bit prime field: https://patents.google.com/patent/US6252960B1/en.
- Parameters
-
compressed | compressed point |
- Returns
- constexpr affine_element
template<typename Fq_ , typename Fr_ , typename Params_ >
template<typename BaseField = Fq, typename CompileTimeEnabled = std::enable_if_t<(BaseField::modulus >> 255) == uint256_t(1), void>>
Reconstruct a point in affine coordinates from compressed form.
#LARGE_MODULUS_AFFINE_POINT_COMPRESSION Point compression is implemented for curves of a prime field F_p with p being 256 bits. TODO(Suyash): Check with kesha if this is correct.
- Parameters
-
compressed | compressed point |
- Returns
- constexpr affine_element
template<typename Fq_ , typename Fr_ , typename Params_ >
Restore point from a buffer.
- Parameters
-
buffer | Buffer from which we deserialize the point |
- Returns
- Deserialized point
We support serializing the point at infinity for curves defined over a bb::field (i.e., a native field of prime order) and for points of bb::g2.
- Warning
- This will need to be updated if we serialize points over composite-order fields other than fq2!
Definition at line 151 of file affine_element.hpp.
template<typename Fq_ , typename Fr_ , typename Params_ >
Serialize the point to the given buffer.
We support serializing the point at infinity for curves defined over a bb::field (i.e., a native field of prime order) and for points of bb::g2.
- Warning
- This will need to be updated if we serialize points over composite-order fields other than fq2!
Definition at line 124 of file affine_element.hpp.