Botan  2.16.0
Crypto and TLS for C++11
kdf1_iso18033.h
Go to the documentation of this file.
1 /*
2 * KDF1 from ISO 18033-2
3 * (C) 2016 Philipp Weber
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7 
8 #ifndef BOTAN_KDF1_18033_H_
9 #define BOTAN_KDF1_18033_H_
10 
11 #include <botan/kdf.h>
12 #include <botan/hash.h>
13 
14 BOTAN_FUTURE_INTERNAL_HEADER(kdf1_iso18033.h)
15 
16 namespace Botan {
17 
18 /**
19 * KDF1, from ISO 18033-2
20 */
21 class BOTAN_PUBLIC_API(2,0) KDF1_18033 final : public KDF
22  {
23  public:
24  std::string name() const override { return "KDF1-18033(" + m_hash->name() + ")"; }
25 
26  KDF* clone() const override { return new KDF1_18033(m_hash->clone()); }
27 
28  size_t kdf(uint8_t key[], size_t key_len,
29  const uint8_t secret[], size_t secret_len,
30  const uint8_t salt[], size_t salt_len,
31  const uint8_t label[], size_t label_len) const override;
32 
33  /**
34  * @param h hash function to use
35  */
36  explicit KDF1_18033(HashFunction* h) : m_hash(h) {}
37  private:
38  std::unique_ptr<HashFunction> m_hash;
39  };
40 
41 }
42 
43 #endif
KDF1_18033(HashFunction *h)
Definition: kdf1_iso18033.h:36
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
size_t salt_len
Definition: x509_obj.cpp:25
Definition: alg_id.cpp:13
KDF * clone() const override
Definition: kdf1_iso18033.h:26
Definition: kdf.h:20
virtual size_t 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 =0
std::string name() const override
Definition: kdf1_iso18033.h:24
#define BOTAN_FUTURE_INTERNAL_HEADER(hdr)
Definition: compiler.h:145