Botan 3.6.1
Crypto and TLS for C&
|
#include <sp800_108.h>
Public Member Functions | |
KDF * | clone () const |
template<concepts::resizable_byte_buffer T = secure_vector<uint8_t>> | |
T | derive_key (size_t key_len, const uint8_t secret[], size_t secret_len, const uint8_t salt[], size_t salt_len, const uint8_t label[]=nullptr, size_t label_len=0) const |
template<concepts::resizable_byte_buffer T = secure_vector<uint8_t>> | |
T | derive_key (size_t key_len, const uint8_t secret[], size_t secret_len, std::string_view salt="", std::string_view label="") const |
template<concepts::resizable_byte_buffer T = secure_vector<uint8_t>> | |
T | derive_key (size_t key_len, std::span< const uint8_t > secret, const uint8_t salt[], size_t salt_len, std::string_view label="") const |
template<concepts::resizable_byte_buffer T = secure_vector<uint8_t>> | |
T | derive_key (size_t key_len, std::span< const uint8_t > secret, std::span< const uint8_t > salt, std::span< const uint8_t > label) const |
template<concepts::resizable_byte_buffer T = secure_vector<uint8_t>> | |
T | derive_key (size_t key_len, std::span< const uint8_t > secret, std::string_view salt="", std::string_view label="") const |
void | derive_key (std::span< uint8_t > key, std::span< const uint8_t > secret, std::span< const uint8_t > salt, std::span< const uint8_t > label) const |
void | kdf (uint8_t key[], size_t key_len, const uint8_t secret[], size_t secret_len, const uint8_t salt[], size_t salt_len, const uint8_t label[], size_t label_len) const override |
std::string | name () const override |
std::unique_ptr< KDF > | new_object () const override |
SP800_108_Counter (std::unique_ptr< MessageAuthenticationCode > mac) | |
Static Public Member Functions | |
static std::unique_ptr< KDF > | create (std::string_view algo_spec, std::string_view provider="") |
static std::unique_ptr< KDF > | create_or_throw (std::string_view algo_spec, std::string_view provider="") |
static std::vector< std::string > | providers (std::string_view algo_spec) |
NIST SP 800-108 KDF in Counter Mode (5.1)
Definition at line 19 of file sp800_108.h.
|
inlineexplicit |
mac | MAC algorithm to use |
Definition at line 54 of file sp800_108.h.
|
inlineinherited |
|
staticinherited |
Create an instance based on a name If provider is empty then best available is chosen.
algo_spec | algorithm name |
provider | provider implementation to choose |
Definition at line 71 of file kdf.cpp.
References Botan::SCAN_Name::algo_name(), Botan::SCAN_Name::arg(), Botan::SCAN_Name::arg_count(), BOTAN_UNUSED, Botan::HashFunction::create(), Botan::MessageAuthenticationCode::create(), and Botan::fmt().
Referenced by Botan::KDF::create_or_throw(), and Botan::get_kdf().
|
staticinherited |
Create an instance based on a name, or throw if the algo/provider combination cannot be found. If provider is empty then best available is chosen.
Definition at line 199 of file kdf.cpp.
References Botan::KDF::create(), and Botan::KDF::kdf().
Referenced by botan_kdf(), Botan::ECIES_KA_Operation::derive_secret(), Botan::PK_Ops::KEM_Decryption_with_KDF::KEM_Decryption_with_KDF(), Botan::PK_Ops::KEM_Encryption_with_KDF::KEM_Encryption_with_KDF(), Botan::PK_Ops::Key_Agreement_with_KDF::Key_Agreement_with_KDF(), and Botan::TLS::Handshake_State::protocol_specific_prf().
|
inlineinherited |
Derive a key
key_len | the desired output length in bytes |
secret | the secret input |
secret_len | size of secret in bytes |
salt | a diversifier |
salt_len | size of salt in bytes |
label | purpose for the derived keying material |
label_len | size of label in bytes |
Definition at line 86 of file kdf.h.
References T.
|
inlineinherited |
Derive a key
key_len | the desired output length in bytes |
secret | the secret input |
secret_len | size of secret in bytes |
salt | a diversifier |
label | purpose for the derived keying material |
Definition at line 181 of file kdf.h.
References Botan::cast_char_ptr_to_uint8().
|
inlineinherited |
Derive a key
key_len | the desired output length in bytes |
secret | the secret input |
salt | a diversifier |
salt_len | size of salt in bytes |
label | purpose for the derived keying material |
Definition at line 162 of file kdf.h.
References Botan::cast_char_ptr_to_uint8().
|
inlineinherited |
Derive a key
key_len | the desired output length in bytes |
secret | the secret input |
salt | a diversifier |
label | purpose for the derived keying material |
Definition at line 144 of file kdf.h.
|
inlineinherited |
Derive a key
key_len | the desired output length in bytes |
secret | the secret input |
salt | a diversifier |
label | purpose for the derived keying material |
Definition at line 107 of file kdf.h.
References Botan::cast_char_ptr_to_uint8().
|
inlineinherited |
Derive a key
key | the output buffer for the to-be-derived key |
secret | the secret input |
salt | a diversifier |
label | purpose for the derived keying material |
Definition at line 127 of file kdf.h.
|
overridevirtual |
Derive a key using the SP800-108 KDF in Counter mode.
The implementation hard codes the length of [L]_2 and [i]_2 (the value r) to 32 bits.
key | resulting keying material |
key_len | the desired output length in bytes |
secret | K_I |
secret_len | size of K_I in bytes |
salt | Context |
salt_len | size of Context in bytes |
label | Label |
label_len | size of Label in bytes |
Invalid_Argument | key_len > 2^32 |
Implements Botan::KDF.
Definition at line 25 of file sp800_108.cpp.
References BOTAN_ASSERT, Botan::copy_mem(), and Botan::store_be().
|
overridevirtual |
Implements Botan::KDF.
Definition at line 17 of file sp800_108.cpp.
References Botan::fmt().
|
overridevirtual |
Implements Botan::KDF.
Definition at line 21 of file sp800_108.cpp.
|
staticinherited |
Definition at line 206 of file kdf.cpp.
References Botan::probe_providers_of().