Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

kdf1.h
Go to the documentation of this file.
1 /*
2 * KDF1
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7
8 #ifndef BOTAN_KDF1_H__
9 #define BOTAN_KDF1_H__
10
11 #include <botan/kdf.h>
12 #include <botan/hash.h>
13
14 namespace Botan {
15
16 /**
17 * KDF1, from IEEE 1363
18 */
19 class BOTAN_DLL KDF1 final : public KDF
20 {
21 public:
22 std::string name() const override { return "KDF1(" + m_hash->name() + ")"; }
23
24 KDF* clone() const override { return new KDF1(m_hash->clone()); }
25
26 size_t kdf(uint8_t key[], size_t key_len,
27 const uint8_t secret[], size_t secret_len,
28 const uint8_t salt[], size_t salt_len,
29 const uint8_t label[], size_t label_len) const override;
30
31 /**
32 * @param h hash function to use
33 */
34 explicit KDF1(HashFunction* h) : m_hash(h) {}
35 private:
36 std::unique_ptr<HashFunction> m_hash;
37 };
38
39 }
40
41 #endif
Botan::KDF1
Definition: kdf1.h:19
Botan::KDF1::name
std::string name() const override
Definition: kdf1.h:22
Botan::KDF1::KDF1
KDF1(HashFunction *h)
Definition: kdf1.h:34
Botan
Definition: alg_id.cpp:13
Botan::HashFunction
Definition: hash.h:19
Botan::KDF
Definition: kdf.h:20
m_hash
std::unique_ptr< HashFunction > m_hash
Definition: tpm.cpp:439
Botan::KDF1::clone
KDF * clone() const override
Definition: kdf1.h:24