|
Botan 3.13.0
Crypto and TLS for C&
|
#include <spake2p.h>
Public Member Functions | |
| std::vector< uint8_t > | generate_message (RandomNumberGenerator &rng) |
| const SystemParameters & | parameters () const |
| std::vector< uint8_t > | process_message (std::span< const uint8_t > peer_message, RandomNumberGenerator &rng) |
| ProverContext (const SystemParameters ¶ms, const ProverSecret &secret, std::span< const uint8_t > prover_id, std::span< const uint8_t > verifier_id, std::span< const uint8_t > context={}) | |
| secure_vector< uint8_t > | shared_secret () const |
SPAKE2+ (RFC 9383) Prover
The prover knows the password secret (w0 and w1) and authenticates itself to a verifier which knows the matching registration record.
| Botan::SPAKE2p::ProverContext::ProverContext | ( | const SystemParameters & | params, |
| const ProverSecret & | secret, | ||
| 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 313 of file spake2p.cpp.
| std::vector< uint8_t > Botan::SPAKE2p::ProverContext::generate_message | ( | RandomNumberGenerator & | rng | ) |
Generate the prover's key share (shareP), which is sent to the verifier.
This can be called only once.
Definition at line 324 of file spake2p.cpp.
References BOTAN_STATE_CHECK, Botan::EC_AffinePoint::generator(), Botan::EC_AffinePoint::mul_px_qy(), and Botan::EC_Scalar::random().
|
inline |
| std::vector< uint8_t > Botan::SPAKE2p::ProverContext::process_message | ( | std::span< const uint8_t > | peer_message, |
| RandomNumberGenerator & | rng ) |
Consume the message from the verifier (shareV followed by confirmV) and return the prover's key confirmation (confirmP), which is sent to the verifier.
Throws Decoding_Error if the message is malformed, and Invalid_Authentication_Tag if the verifier's key confirmation is wrong (typically due to a password mismatch).
Definition at line 340 of file spake2p.cpp.
References BOTAN_STATE_CHECK, Botan::constant_time_compare(), Botan::EC_AffinePoint::deserialize_uncompressed(), and Botan::EC_AffinePoint::mul_px_qy().
| secure_vector< uint8_t > Botan::SPAKE2p::ProverContext::shared_secret | ( | ) | const |
Return the shared secret (K_shared)
This may be called only after process_message has succeeded.
Definition at line 387 of file spake2p.cpp.
References BOTAN_STATE_CHECK.