|
Botan 3.13.0
Crypto and TLS for C&
|
#include <spake2p.h>
Public Member Functions | |
| RegistrationRecord | registration_record (RandomNumberGenerator &rng) const |
| secure_vector< uint8_t > | serialize () const |
Static Public Member Functions | |
| static ProverSecret | deserialize (const SystemParameters ¶ms, std::span< const uint8_t > secret) |
| static ProverSecret | from_password (const SystemParameters ¶ms, std::string_view password, std::span< const uint8_t > prover_id, std::span< const uint8_t > verifier_id, std::span< const uint8_t > salt) |
| static ProverSecret | from_prehashed (EC_Scalar w0, EC_Scalar w1) |
Friends | |
| class | ProverContext |
SPAKE2+ Prover Secret
This is the information (w0 and w1 in RFC 9383) which the prover derives from the password in order to authenticate itself.
|
static |
Deserialize a ProverSecret previously serialized by serialize
Definition at line 296 of file spake2p.cpp.
References Botan::EC_Scalar::deserialize_pair(), and Botan::SPAKE2p::SystemParameters::group().
Referenced by botan_spake2p_prover_init(), and botan_spake2p_registration_record().
|
static |
Derive the prover secret from a password
The derivation uses Argon2id with the memory-constrained parameters from RFC 9106, namely m=64 MiB, t=3, p=4. Following RFC 9383, the Argon2id passphrase input is the concatenation
len(pw) || pw || len(idProver) || idProver || len(idVerifier) || idVerifier
with each length an 8-byte little-endian count of bytes, and the salt is provided to Argon2id directly. The Argon2id output is split in two halves, each of which is reduced modulo the group order.
The identities and salt may be empty; if a salt is available it should be used, as this prevents precomputed dictionary attacks.
Definition at line 283 of file spake2p.cpp.
Referenced by botan_spake2p_derive_secret(), and Botan::SPAKE2p::RegistrationRecord::from_password().
Create a prover secret from already derived scalars
Definition at line 292 of file spake2p.cpp.
| RegistrationRecord Botan::SPAKE2p::ProverSecret::registration_record | ( | RandomNumberGenerator & | rng | ) | const |
Compute the registration record (w0 and L=w1*P) for this secret
This would typically be done once, when the password is first registered with the verifier.
Definition at line 308 of file spake2p.cpp.
References Botan::EC_AffinePoint::g_mul().
Referenced by Botan::SPAKE2p::RegistrationRecord::from_password().
| secure_vector< uint8_t > Botan::SPAKE2p::ProverSecret::serialize | ( | ) | const |
Serialize the prover secret
Definition at line 304 of file spake2p.cpp.
References Botan::EC_Scalar::serialize_pair().
|
friend |