|
Botan 3.13.0
Crypto and TLS for C&
|
#include <spake2p.h>
Public Member Functions | |
| const SystemParameters & | parameters () const |
| std::vector< uint8_t > | process_message (std::span< const uint8_t > peer_message, RandomNumberGenerator &rng) |
| secure_vector< uint8_t > | shared_secret () const |
| void | skip_confirmation () |
| VerifierContext (const SystemParameters ¶ms, const RegistrationRecord &record, std::span< const uint8_t > prover_id, std::span< const uint8_t > verifier_id, std::span< const uint8_t > context={}) | |
| void | verify_confirmation (std::span< const uint8_t > confirmation) |
SPAKE2+ (RFC 9383) Verifier
The verifier does not know the password itself; it stores only the registration record.
| Botan::SPAKE2p::VerifierContext::VerifierContext | ( | const SystemParameters & | params, |
| const RegistrationRecord & | record, | ||
| std::span< const uint8_t > | prover_id, | ||
| std::span< const uint8_t > | verifier_id, | ||
| std::span< const uint8_t > | context = {} ) |
Set up for an execution of the protocol
The identities and context must be agreed upon by both parties; the identities must additionally match the values used during password registration. Both the identities and the context may be empty.
Definition at line 392 of file spake2p.cpp.
|
inline |
| std::vector< uint8_t > Botan::SPAKE2p::VerifierContext::process_message | ( | std::span< const uint8_t > | peer_message, |
| RandomNumberGenerator & | rng ) |
Consume the prover's key share (shareP) and return the verifier's response (shareV followed by confirmV), which is sent to the prover.
This can be called only once. Throws Decoding_Error if the key share is malformed.
Definition at line 403 of file spake2p.cpp.
References BOTAN_STATE_CHECK, Botan::concat(), Botan::EC_AffinePoint::deserialize_uncompressed(), Botan::EC_AffinePoint::generator(), Botan::EC_AffinePoint::mul_px_qy(), and Botan::EC_Scalar::random().
| secure_vector< uint8_t > Botan::SPAKE2p::VerifierContext::shared_secret | ( | ) | const |
Return the shared secret (K_shared)
This may be called only after verify_confirmation has succeeded, or after skip_confirmation.
RFC 9383 Section 3.3: "The Verifier MUST NOT send application data to the Prover until it has received and verified the confirmation message."
Definition at line 461 of file spake2p.cpp.
References BOTAN_STATE_CHECK.
| void Botan::SPAKE2p::VerifierContext::skip_confirmation | ( | ) |
Skip checking the prover's key confirmation (confirmP)
This can be called after process_message, in place of verify_confirmation, to allow extracting the shared secret without having checked the prover's key confirmation.
Definition at line 454 of file spake2p.cpp.
References BOTAN_STATE_CHECK.
| void Botan::SPAKE2p::VerifierContext::verify_confirmation | ( | std::span< const uint8_t > | confirmation | ) |
Check the prover's key confirmation (confirmP)
Throws Invalid_Authentication_Tag if the confirmation is wrong, meaning the prover does not know the password.
Definition at line 440 of file spake2p.cpp.
References BOTAN_STATE_CHECK, and Botan::constant_time_compare().