|
Botan 3.11.0
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 (CT::Mask< uint64_t > mask, const Ed448Point &other) |
Assign other to this if mask is set (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 | negate () const |
| Negate the point. | |
| 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 | base_point_mul (const Scalar448 &scalar) |
| Fixed base point scalar multiplication (precomputed table, no doublings). | |
| static Ed448Point | decode (std::span< const uint8_t, ED448_LEN > enc) |
| Decode a point from its 57-byte encoding (RFC 8032 5.2.3). | |
| static Ed448Point | double_scalar_mul_vartime (const Scalar448 &s1, const Ed448Point &p1, const Scalar448 &s2, const Ed448Point &p2) |
| Variable-time double scalar multiplication using Shamir's trick: [s1]P + [s2]Q. | |
| static Ed448Point | identity () |
| Return the identity element. | |
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 26 of file ed448_internal.h.
|
inline |
Create a point from its projective coordinates X, Y, Z.
Definition at line 35 of file ed448_internal.h.
Referenced by base_point(), base_point_mul(), ct_conditional_assign(), decode(), double_point(), double_scalar_mul_vartime(), identity(), negate(), operator+(), operator==(), and scalar_mul().
|
static |
Create the curve's base point ('B' in RFC 8032 5.2).
Definition at line 122 of file ed448_internal.cpp.
References Ed448Point(), x(), and y().
Referenced by base_point_mul(), and Botan::verify_signature().
|
static |
Fixed base point scalar multiplication (precomputed table, no doublings).
Definition at line 242 of file ed448_internal.cpp.
References base_point(), double_point(), Ed448Point(), Botan::Scalar448::get_window(), identity(), and Botan::CT::Mask< T >::is_equal().
Referenced by Botan::create_pk_from_sk(), and Botan::sign_message().
| void Botan::Ed448Point::ct_conditional_assign | ( | CT::Mask< uint64_t > | mask, |
| const Ed448Point & | other ) |
Assign other to this if mask is set (constant time).
Definition at line 359 of file ed448_internal.cpp.
References Ed448Point().
|
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(), Ed448Point(), Botan::CT::Mask< T >::expand_bool(), Botan::Gf448Elem::is_odd(), Botan::mul_a24(), Botan::Gf448Elem::one(), Botan::root(), Botan::square(), Botan::WORDS_448, 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 174 of file ed448_internal.cpp.
References Ed448Point(), and Botan::square().
Referenced by base_point_mul(), and double_scalar_mul_vartime().
|
static |
Variable-time double scalar multiplication using Shamir's trick: [s1]P + [s2]Q.
Definition at line 293 of file ed448_internal.cpp.
References double_point(), Ed448Point(), Botan::Scalar448::get_window(), and identity().
Referenced by Botan::verify_signature().
| 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 140 of file ed448_internal.cpp.
References Botan::Gf448Elem::is_odd(), Botan::Gf448Elem::to_bytes(), x(), and y().
Referenced by Botan::create_pk_from_sk(), and Botan::sign_message().
|
inlinestatic |
Return the identity element.
Definition at line 41 of file ed448_internal.h.
References Ed448Point(), Botan::Gf448Elem::one(), and Botan::Gf448Elem::zero().
Referenced by base_point_mul(), double_scalar_mul_vartime(), and scalar_mul().
|
inline |
Negate the point.
Definition at line 65 of file ed448_internal.h.
References Ed448Point().
Referenced by Botan::verify_signature().
| Ed448Point Botan::Ed448Point::operator+ | ( | const Ed448Point & | other | ) | const |
Add two points (RFC 8032 5.2.4).
Definition at line 157 of file ed448_internal.cpp.
References Ed448Point(), Botan::mul_a24(), and Botan::square().
| bool Botan::Ed448Point::operator== | ( | const Ed448Point & | other | ) | const |
Check if two points are equal (constant time).
Definition at line 344 of file ed448_internal.cpp.
References Ed448Point(), and Botan::CT::Mask< T >::expand_bool().
| Ed448Point Botan::Ed448Point::scalar_mul | ( | const Scalar448 & | scalar | ) | const |
Scalar multiplication.
Definition at line 189 of file ed448_internal.cpp.
References Ed448Point(), Botan::Scalar448::get_window(), identity(), and Botan::CT::Mask< T >::is_equal().
Referenced by Botan::operator*().
|
inline |
Getter for point coordinate x.
Definition at line 77 of file ed448_internal.h.
Referenced by base_point(), Ed448Point(), Ed448Point(), and encode().
|
inline |
Getter for projective coordinate X.
Definition at line 68 of file ed448_internal.h.
|
inline |
Getter for point coordinate y.
Definition at line 80 of file ed448_internal.h.
Referenced by base_point(), decode(), Ed448Point(), Ed448Point(), and encode().
|
inline |
Getter for projective coordinate Y.
Definition at line 71 of file ed448_internal.h.
|
inline |
Getter for projective coordinate Z.
Definition at line 74 of file ed448_internal.h.