|
Botan 3.14.1
Crypto and TLS for C&
|
#include <ed25519_scalar.h>
Public Member Functions | |
| Ed25519_Scalar | operator* (const Ed25519_Scalar &other) const |
| Ed25519_Scalar | operator+ (const Ed25519_Scalar &other) const |
| Ed25519_Scalar | operator- () const |
| void | serialize_to (std::span< uint8_t, BYTES > b) const |
| std::array< uint8_t, BYTES > | to_bytes () const |
Static Public Member Functions | |
| static Ed25519_Scalar | from_bytes (std::span< const uint8_t, BYTES > b) |
| static std::optional< Ed25519_Scalar > | from_canonical_bytes (std::span< const uint8_t, BYTES > b) |
| static Ed25519_Scalar | from_wide_bytes (std::span< const uint8_t, 2 *BYTES > b) |
| static Ed25519_Scalar | one () |
| static Ed25519_Scalar | zero () |
Static Public Attributes | |
| static constexpr size_t | BYTES = 32 |
An integer modulo the order of the Ed25519 group, l = 2^252 + 27742317777372353535851937790883648493
Values are always fully reduced, and all operations aside from from_canonical_bytes are constant time.
Definition at line 26 of file ed25519_scalar.h.
|
static |
Deserialize 32 little endian bytes, reducing modulo l
Definition at line 122 of file ed25519_scalar.cpp.
Referenced by Botan::x25519_basepoint().
|
static |
Deserialize 32 little endian bytes, returning nullopt unless the value is already reduced
Definition at line 135 of file ed25519_scalar.cpp.
References Botan::word_sub().
|
static |
Deserialize 64 little endian bytes (eg a wide hash output), reducing modulo l
Definition at line 127 of file ed25519_scalar.cpp.
References BYTES.
|
inlinestatic |
Definition at line 35 of file ed25519_scalar.h.
Referenced by Botan::ed25519_valid_public_key_point().
| Ed25519_Scalar Botan::Ed25519_Scalar::operator* | ( | const Ed25519_Scalar & | other | ) | const |
Definition at line 175 of file ed25519_scalar.cpp.
| Ed25519_Scalar Botan::Ed25519_Scalar::operator+ | ( | const Ed25519_Scalar & | other | ) | const |
Definition at line 157 of file ed25519_scalar.cpp.
| Ed25519_Scalar Botan::Ed25519_Scalar::operator- | ( | ) | const |
Definition at line 161 of file ed25519_scalar.cpp.
References Botan::CT::all_zeros(), Botan::CT::conditional_assign_mem(), and Botan::word_sub().
| void Botan::Ed25519_Scalar::serialize_to | ( | std::span< uint8_t, BYTES > | b | ) | const |
Serialize to 32 little endian bytes
Definition at line 151 of file ed25519_scalar.cpp.
References Botan::store_le().
Referenced by to_bytes().
|
inline |
Definition at line 59 of file ed25519_scalar.h.
References serialize_to().
|
inlinestatic |
Definition at line 33 of file ed25519_scalar.h.
Referenced by Botan::ed25519_valid_public_key_point().
|
staticconstexpr |
Definition at line 31 of file ed25519_scalar.h.
Referenced by from_wide_bytes().