|
Botan 3.14.1
Crypto and TLS for C&
|
#include <ed25519_fe.h>
Public Member Functions | |
| constexpr void | conditional_assign (CT::Choice cond, const Ed25519_FieldElement &other) |
| constexpr | Ed25519_FieldElement () |
| constexpr Ed25519_FieldElement | invert () const |
| constexpr bool | is_negative () const |
| constexpr bool | is_zero () const |
| constexpr Ed25519_FieldElement | pow_22523 () const |
| void | serialize_to (std::span< uint8_t, 32 > b) const |
| constexpr Ed25519_FieldElement | sqr () const |
| constexpr Ed25519_FieldElement | sqr2 () const |
| constexpr Ed25519_FieldElement | sqr_iter (size_t iter) const |
Static Public Member Functions | |
| static constexpr Ed25519_FieldElement | add (const Ed25519_FieldElement &a, const Ed25519_FieldElement &b) |
| static constexpr void | conditional_swap (CT::Choice cond, Ed25519_FieldElement &x, Ed25519_FieldElement &y) |
| static std::optional< Ed25519_FieldElement > | deserialize (const uint8_t b[32]) |
| static constexpr Ed25519_FieldElement | from_word (word x) |
| static constexpr Ed25519_FieldElement | mul (const Ed25519_FieldElement &a, const Ed25519_FieldElement &b) |
| static constexpr Ed25519_FieldElement | negate (const Ed25519_FieldElement &a) |
| static constexpr Ed25519_FieldElement | one () |
| static constexpr Ed25519_FieldElement | sub (const Ed25519_FieldElement &a, const Ed25519_FieldElement &b) |
| static constexpr Ed25519_FieldElement | zero () |
An element of the field Z/(2^255-19)
The value is stored as saturated words. Aside from a value being reduced below 2^256 (rather than below p), there are no per-word bounds to track: additions and subtractions fold their carry or borrow back in immediately using 2^256 == 38 (mod p), and multiplications reduce below 2^255 using the same identity. Only serialization produces the canonical value.
Definition at line 42 of file ed25519_fe.h.
|
inlineconstexpr |
Default zero initialization
Definition at line 144 of file ed25519_fe.h.
Referenced by add(), conditional_assign(), conditional_swap(), deserialize(), from_word(), invert(), mul(), negate(), one(), pow_22523(), sqr(), sqr2(), sqr_iter(), sub(), and zero().
|
inlinestaticconstexpr |
Definition at line 212 of file ed25519_fe.h.
References Ed25519_FieldElement(), and Botan::word_add().
Referenced by Botan::operator+(), and sqr2().
|
inlineconstexpr |
If cond is set, assign other to this
Definition at line 281 of file ed25519_fe.h.
References Botan::choose(), Ed25519_FieldElement(), and Botan::CT::Choice::into_bitmask().
|
inlinestaticconstexpr |
If cond is set, swap x and y
Definition at line 291 of file ed25519_fe.h.
References Botan::choose(), Ed25519_FieldElement(), and Botan::CT::Choice::into_bitmask().
|
inlinestatic |
Deserialize 32 little endian bytes, ignoring the high bit
RFC 8032 5.1.3 requires that the encoded value (with the sign bit cleared) is already less than p; a value in [p, 2^255) is rejected rather than reduced.
Definition at line 167 of file ed25519_fe.h.
References Ed25519_FieldElement(), Botan::load_le(), and Botan::word_sub().
|
inlinestaticconstexpr |
Definition at line 154 of file ed25519_fe.h.
References Ed25519_FieldElement().
|
constexpr |
Definition at line 321 of file ed25519_fe.h.
References Ed25519_FieldElement(), and sqr().
|
inlineconstexpr |
Definition at line 210 of file ed25519_fe.h.
|
inlineconstexpr |
Definition at line 193 of file ed25519_fe.h.
References Botan::CT::all_zeros().
|
inlinestaticconstexpr |
Definition at line 242 of file ed25519_fe.h.
References Botan::comba_mul(), and Ed25519_FieldElement().
Referenced by Botan::operator*().
|
inlinestaticconstexpr |
Definition at line 232 of file ed25519_fe.h.
References Ed25519_FieldElement(), sub(), and Botan::CT::value_barrier().
Referenced by Botan::operator-().
|
inlinestaticconstexpr |
Definition at line 148 of file ed25519_fe.h.
References Ed25519_FieldElement().
|
constexpr |
Definition at line 348 of file ed25519_fe.h.
References Ed25519_FieldElement(), and sqr().
|
inline |
Definition at line 186 of file ed25519_fe.h.
References Botan::store_le().
|
inlineconstexpr |
Definition at line 250 of file ed25519_fe.h.
References Botan::comba_sqr(), and Ed25519_FieldElement().
Referenced by invert(), pow_22523(), and sqr2().
|
inlineconstexpr |
Definition at line 269 of file ed25519_fe.h.
References add(), Ed25519_FieldElement(), and sqr().
|
inlineconstexpr |
Definition at line 258 of file ed25519_fe.h.
References Botan::comba_sqr(), and Ed25519_FieldElement().
|
inlinestaticconstexpr |
Definition at line 222 of file ed25519_fe.h.
References Ed25519_FieldElement(), and Botan::word_sub().
Referenced by negate(), and Botan::operator-().
|
inlinestaticconstexpr |