Botan  1.10.9
dlies.h
Go to the documentation of this file.
1 /*
2 * DLIES
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7 
8 #ifndef BOTAN_DLIES_H__
9 #define BOTAN_DLIES_H__
10 
11 #include <botan/pubkey.h>
12 #include <botan/mac.h>
13 #include <botan/kdf.h>
14 
15 namespace Botan {
16 
17 /**
18 * DLIES Encryption
19 */
20 class BOTAN_DLL DLIES_Encryptor : public PK_Encryptor
21  {
22  public:
24  KDF* kdf,
26  size_t mac_key_len = 20);
27 
28  ~DLIES_Encryptor();
29 
30  void set_other_key(const MemoryRegion<byte>&);
31  private:
32  SecureVector<byte> enc(const byte[], size_t,
33  RandomNumberGenerator&) const;
34  size_t maximum_input_size() const;
35 
36  SecureVector<byte> other_key, my_key;
37 
39  KDF* kdf;
41  size_t mac_keylen;
42  };
43 
44 /**
45 * DLIES Decryption
46 */
47 class BOTAN_DLL DLIES_Decryptor : public PK_Decryptor
48  {
49  public:
51  KDF* kdf,
53  size_t mac_key_len = 20);
54 
55  ~DLIES_Decryptor();
56 
57  private:
58  SecureVector<byte> dec(const byte[], size_t) const;
59 
60  SecureVector<byte> my_key;
61 
63  KDF* kdf;
65  size_t mac_keylen;
66  };
67 
68 }
69 
70 #endif
unsigned char byte
Definition: types.h:22
MessageAuthenticationCode * mac
Definition: fpe_fe1.cpp:94
Definition: kdf.h:20