Botan 1.10.17
Botan::KDF Class Referenceabstract

#include <kdf.h>

Inheritance diagram for Botan::KDF:
Botan::Algorithm Botan::KDF1 Botan::KDF2 Botan::SSL3_PRF Botan::TLS_12_PRF Botan::TLS_PRF Botan::X942_PRF

Public Member Functions

void clear ()
virtual KDFclone () const =0
SecureVector< bytederive_key (size_t key_len, const byte secret[], size_t secret_len, const byte salt[], size_t salt_len) const
SecureVector< bytederive_key (size_t key_len, const byte secret[], size_t secret_len, const std::string &salt="") const
SecureVector< bytederive_key (size_t key_len, const MemoryRegion< byte > &secret, const byte salt[], size_t salt_len) const
SecureVector< bytederive_key (size_t key_len, const MemoryRegion< byte > &secret, const MemoryRegion< byte > &salt) const
SecureVector< bytederive_key (size_t key_len, const MemoryRegion< byte > &secret, const std::string &salt="") const
virtual std::string name () const =0

Detailed Description

Key Derivation Function

Definition at line 20 of file kdf.h.

Member Function Documentation

◆ clear()

void Botan::KDF::clear ( )
inlinevirtual

Zeroize internal state

Implements Botan::Algorithm.

Definition at line 81 of file kdf.h.

81{}

◆ clone()

virtual KDF * Botan::KDF::clone ( ) const
pure virtual

◆ derive_key() [1/5]

SecureVector< byte > Botan::KDF::derive_key ( size_t key_len,
const byte secret[],
size_t secret_len,
const byte salt[],
size_t salt_len ) const

Derive a key

Parameters
key_lenthe desired output length in bytes
secretthe secret input
secret_lensize of secret in bytes
salta diversifier
salt_lensize of salt in bytes

Definition at line 61 of file kdf.cpp.

64 {
65 return derive(key_len, secret, secret_len, salt, salt_len);
66 }

◆ derive_key() [2/5]

SecureVector< byte > Botan::KDF::derive_key ( size_t key_len,
const byte secret[],
size_t secret_len,
const std::string & salt = "" ) const

Derive a key

Parameters
key_lenthe desired output length in bytes
secretthe secret input
secret_lensize of secret in bytes
salta diversifier

Definition at line 49 of file kdf.cpp.

52 {
53 return derive_key(key_len, secret, secret_len,
54 reinterpret_cast<const byte*>(salt.data()),
55 salt.length());
56 }
SecureVector< byte > derive_key(size_t key_len, const MemoryRegion< byte > &secret, const std::string &salt="") const
Definition kdf.cpp:15

References derive_key().

◆ derive_key() [3/5]

SecureVector< byte > Botan::KDF::derive_key ( size_t key_len,
const MemoryRegion< byte > & secret,
const byte salt[],
size_t salt_len ) const

Derive a key

Parameters
key_lenthe desired output length in bytes
secretthe secret input
salta diversifier
salt_lensize of salt in bytes

Definition at line 27 of file kdf.cpp.

30 {
31 return derive_key(key_len, &secret[0], secret.size(),
32 salt, salt_len);
33 }

References derive_key(), and Botan::MemoryRegion< T >::size().

◆ derive_key() [4/5]

SecureVector< byte > Botan::KDF::derive_key ( size_t key_len,
const MemoryRegion< byte > & secret,
const MemoryRegion< byte > & salt ) const

Derive a key

Parameters
key_lenthe desired output length in bytes
secretthe secret input
salta diversifier

Definition at line 38 of file kdf.cpp.

41 {
42 return derive_key(key_len, &secret[0], secret.size(),
43 &salt[0], salt.size());
44 }

References derive_key(), and Botan::MemoryRegion< T >::size().

◆ derive_key() [5/5]

SecureVector< byte > Botan::KDF::derive_key ( size_t key_len,
const MemoryRegion< byte > & secret,
const std::string & salt = "" ) const

Derive a key

Parameters
key_lenthe desired output length in bytes
secretthe secret input
salta diversifier

Definition at line 15 of file kdf.cpp.

18 {
19 return derive_key(key_len, &secret[0], secret.size(),
20 reinterpret_cast<const byte*>(salt.data()),
21 salt.length());
22 }

References derive_key(), and Botan::MemoryRegion< T >::size().

Referenced by derive_key(), derive_key(), derive_key(), and derive_key().

◆ name()

virtual std::string Botan::Algorithm::name ( ) const
pure virtualinherited
Returns
name of this algorithm

Implemented in Botan::Adler32, Botan::AES_128, Botan::AES_128_NI, Botan::AES_128_SSSE3, Botan::AES_192, Botan::AES_192_NI, Botan::AES_192_SSSE3, Botan::AES_256, Botan::AES_256_NI, Botan::AES_256_SSSE3, Botan::ANSI_X919_MAC, Botan::ARC4, Botan::Blowfish, Botan::BMW_512, Botan::Camellia_128, Botan::Camellia_192, Botan::Camellia_256, Botan::Cascade_Cipher, Botan::CAST_128, Botan::CAST_256, Botan::CBC_MAC, Botan::CMAC, Botan::Comb4P, Botan::CRC24, Botan::CRC32, Botan::CTR_BE, Botan::DES, Botan::DESX, Botan::GOST_28147_89, Botan::GOST_34_11, Botan::HAS_160, Botan::HMAC, Botan::IDEA, Botan::KASUMI, Botan::KDF1, Botan::KDF2, Botan::Keccak_1600, Botan::Lion, Botan::LubyRackoff, Botan::MARS, Botan::MD2, Botan::MD4, Botan::MD5, Botan::MessageAuthenticationCode, Botan::MISTY1, Botan::Noekeon, Botan::OFB, Botan::OpenPGP_S2K, Botan::Parallel, Botan::PKCS5_PBKDF1, Botan::PKCS5_PBKDF2, Botan::RC2, Botan::RIPEMD_128, Botan::RIPEMD_160, Botan::SAFER_SK, Botan::Salsa20, Botan::SEED, Botan::Serpent, Botan::SHA_160, Botan::SHA_224, Botan::SHA_256, Botan::SHA_384, Botan::SHA_512, Botan::Skein_512, Botan::Skipjack, Botan::Square, Botan::SSL3_MAC, Botan::SSL3_PRF, Botan::TEA, Botan::Tiger, Botan::TLS_12_PRF, Botan::TLS_PRF, Botan::TripleDES, Botan::Turing, Botan::Twofish, Botan::Whirlpool, Botan::WiderWake_41_BE, Botan::X942_PRF, and Botan::XTEA.

Referenced by Botan::Algorithm_Factory::add_block_cipher(), Botan::Algorithm_Factory::add_hash_function(), Botan::Algorithm_Factory::add_pbkdf(), Botan::Algorithm_Factory::add_stream_cipher(), Botan::choose_sig_format(), Botan::PBE_PKCS5v15::PBE_PKCS5v15(), Botan::PBE_PKCS5v20::PBE_PKCS5v20(), Botan::StreamCipher::set_iv(), and Botan::SymmetricAlgorithm::set_key().


The documentation for this class was generated from the following files: