Botan 3.6.1
Crypto and TLS for C&
|
Representation of a point on the Ed448 curve. More...
#include <ed448_internal.h>
Public Member Functions | |
void | ct_conditional_assign (bool cond, const Ed448Point &other) |
Assign other to this if cond is true (constant time) | |
Ed448Point | double_point () const |
Double a point (RFC 8032 5.2.4) | |
Ed448Point (const Gf448Elem &x, const Gf448Elem &y) | |
Create a point from its coordinates x, y. | |
Ed448Point (const Gf448Elem &x, const Gf448Elem &y, const Gf448Elem &z) | |
Create a point from its projective coordinates X, Y, Z. | |
std::array< uint8_t, ED448_LEN > | encode () const |
Encode the point to its 57-byte representation (RFC 8032 5.2.2) | |
Ed448Point | operator+ (const Ed448Point &other) const |
Add two points (RFC 8032 5.2.4) | |
bool | operator== (const Ed448Point &other) const |
Check if two points are equal (constant time) | |
Ed448Point | scalar_mul (const Scalar448 &scalar) const |
Scalar multiplication. | |
Gf448Elem | x () const |
Getter for point coordinate x. | |
Gf448Elem | x_proj () const |
Getter for projective coordinate X. | |
Gf448Elem | y () const |
Getter for point coordinate y. | |
Gf448Elem | y_proj () const |
Getter for projective coordinate Y. | |
Gf448Elem | z_proj () const |
Getter for projective coordinate Z. | |
Static Public Member Functions | |
static Ed448Point | base_point () |
Create the curve's base point ('B' in RFC 8032 5.2) | |
static Ed448Point | decode (std::span< const uint8_t, ED448_LEN > enc) |
Decode a point from its 57-byte encoding (RFC 8032 5.2.3) | |
Representation of a point on the Ed448 curve.
The point is represented in projective coordinates (X, Y, Z). All operations are constant time.
Definition at line 25 of file ed448_internal.h.
|
inline |
Create a point from its projective coordinates X, Y, Z.
Definition at line 34 of file ed448_internal.h.
Referenced by base_point(), double_point(), and operator+().
Create a point from its coordinates x, y.
Definition at line 37 of file ed448_internal.h.
|
static |
Create the curve's base point ('B' in RFC 8032 5.2)
Definition at line 123 of file ed448_internal.cpp.
References Ed448Point(), x(), and y().
Referenced by Botan::create_pk_from_sk(), Botan::sign_message(), and Botan::verify_signature().
void Botan::Ed448Point::ct_conditional_assign | ( | bool | cond, |
const Ed448Point & | other ) |
Assign other to this if cond is true (constant time)
Definition at line 214 of file ed448_internal.cpp.
References Botan::Gf448Elem::ct_cond_assign().
Referenced by scalar_mul().
|
static |
Decode a point from its 57-byte encoding (RFC 8032 5.2.3)
Definition at line 73 of file ed448_internal.cpp.
References Botan::Gf448Elem::bytes_are_canonical_representation(), Botan::CT::Mask< T >::expand(), Botan::Gf448Elem::is_odd(), Botan::root(), Botan::square(), and y().
Referenced by Botan::Ed448_PublicKey::check_key(), and Botan::verify_signature().
Ed448Point Botan::Ed448Point::double_point | ( | ) | const |
Double a point (RFC 8032 5.2.4)
Definition at line 175 of file ed448_internal.cpp.
References Ed448Point(), and Botan::square().
Referenced by scalar_mul().
std::array< uint8_t, ED448_LEN > Botan::Ed448Point::encode | ( | ) | const |
Encode the point to its 57-byte representation (RFC 8032 5.2.2)
Definition at line 141 of file ed448_internal.cpp.
References Botan::Gf448Elem::is_odd(), Botan::Gf448Elem::to_bytes(), x(), and y().
Ed448Point Botan::Ed448Point::operator+ | ( | const Ed448Point & | other | ) | const |
Add two points (RFC 8032 5.2.4)
Definition at line 158 of file ed448_internal.cpp.
References Ed448Point(), and Botan::square().
bool Botan::Ed448Point::operator== | ( | const Ed448Point & | other | ) | const |
Check if two points are equal (constant time)
Definition at line 206 of file ed448_internal.cpp.
References Botan::CT::Mask< T >::expand(), x(), and y().
Ed448Point Botan::Ed448Point::scalar_mul | ( | const Scalar448 & | scalar | ) | const |
Scalar multiplication.
Definition at line 190 of file ed448_internal.cpp.
References ct_conditional_assign(), double_point(), and Botan::Scalar448::get_bit().
Referenced by Botan::operator*().
|
inline |
Getter for point coordinate x.
Definition at line 61 of file ed448_internal.h.
Referenced by base_point(), encode(), and operator==().
|
inline |
Getter for projective coordinate X.
Definition at line 52 of file ed448_internal.h.
|
inline |
Getter for point coordinate y.
Definition at line 64 of file ed448_internal.h.
Referenced by base_point(), decode(), encode(), and operator==().
|
inline |
Getter for projective coordinate Y.
Definition at line 55 of file ed448_internal.h.
|
inline |
Getter for projective coordinate Z.
Definition at line 58 of file ed448_internal.h.