|
Botan 3.14.1
Crypto and TLS for C&
|
#include <ml_dsa_impl.h>
Public Member Functions | |
| DilithiumDecodedKeypair | decode_keypair (std::span< const uint8_t > private_key, DilithiumConstants mode) const override |
| secure_vector< uint8_t > | encode_keypair (const DilithiumInternalKeypair &keypair, MlPrivateKeyFormat format) const override |
Static Public Member Functions | |
| static std::unique_ptr< Dilithium_Keypair_Codec > | create (DilithiumMode mode) |
Definition at line 21 of file ml_dsa_impl.h.
|
staticinherited |
Definition at line 22 of file dilithium_keys.cpp.
References Botan::DilithiumMode::is_dilithium_round3(), and Botan::DilithiumMode::is_ml_dsa().
Referenced by Botan::DilithiumConstants::DilithiumConstants().
|
overridevirtual |
Decodes any of the three RFC 9881 CHOICE alternatives. For backwards compatibility, also the raw 32-byte seed and the raw expanded key of FIPS 204 (without any ASN.1 wrapping) are accepted.
Implements Botan::Dilithium_Keypair_Codec.
Definition at line 113 of file ml_dsa_impl.cpp.
References Botan::Both, Botan::ContextSpecific, Botan::Dilithium_Algos::decode_keypair(), Botan::BER_Decoder::Limits::DER(), Botan::Dilithium_Algos::expand_keypair(), Botan::Expanded, Botan::OctetString, Botan::BER_Decoder::peek_next_object(), Botan::DilithiumConstants::private_key_bytes(), Botan::Seed, Botan::DilithiumConstants::SEED_RANDOMNESS_BYTES, and Botan::Universal.
|
overridevirtual |
Encodes the private key as one of the three CHOICE alternatives of the ML-DSA-PrivateKey structure specified in RFC 9881, Section 6.
Implements Botan::Dilithium_Keypair_Codec.
Definition at line 71 of file ml_dsa_impl.cpp.
References BOTAN_ASSERT_NONNULL, Botan::Both, Botan::ContextSpecific, Botan::DER_Encoder::encode(), Botan::Dilithium_Algos::encode_keypair(), Botan::DER_Encoder::end_cons(), Botan::Expanded, Botan::OctetString, Botan::Seed, and Botan::DER_Encoder::start_sequence().