Botan  1.10.9
kdf1.h
Go to the documentation of this file.
1 /*
2 * KDF1
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
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 : public KDF
20  {
21  public:
22  SecureVector<byte> derive(size_t,
23  const byte secret[], size_t secret_len,
24  const byte P[], size_t P_len) const;
25 
26  std::string name() const { return "KDF1(" + hash->name() + ")"; }
27  KDF* clone() const { return new KDF1(hash->clone()); }
28 
29  KDF1(HashFunction* h) : hash(h) {}
30  KDF1(const KDF1& other) : KDF(), hash(other.hash->clone()) {}
31 
32  ~KDF1() { delete hash; }
33  private:
34  HashFunction* hash;
35  };
36 
37 }
38 
39 #endif
std::string name() const
Definition: kdf1.h:26
KDF1(const KDF1 &other)
Definition: kdf1.h:30
KDF1(HashFunction *h)
Definition: kdf1.h:29
unsigned char byte
Definition: types.h:22
KDF * clone() const
Definition: kdf1.h:27
Definition: kdf.h:20
~KDF1()
Definition: kdf1.h:32