Botan: src/pubkey/dlies/dlies.h Source File

Botan 1.10.17

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:
23 DLIES_Encryptor(const PK_Key_Agreement_Key&,
24 KDF* kdf,
25 MessageAuthenticationCode* mac,
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
38 PK_Key_Agreement ka;
39 KDF* kdf;
40 MessageAuthenticationCode* mac;
41 size_t mac_keylen;
42 };
43
44 /**
45 * DLIES Decryption
46 */
47 class BOTAN_DLL DLIES_Decryptor : public PK_Decryptor
48 {
49 public:
50 DLIES_Decryptor(const PK_Key_Agreement_Key&,
51 KDF* kdf,
52 MessageAuthenticationCode* mac,
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
62 PK_Key_Agreement ka;
63 KDF* kdf;
64 MessageAuthenticationCode* mac;
65 size_t mac_keylen;
66 };
67
68 }
69
70 #endif
Botan::RandomNumberGenerator
Definition: rng.h:20
Botan::MessageAuthenticationCode
Definition: mac.h:20
Botan::byte
unsigned char byte
Definition: types.h:22
Botan::MemoryRegion< byte >
Botan
Definition: algo_base.h:14
Botan::DLIES_Encryptor
Definition: dlies.h:20
Botan::PK_Key_Agreement
Definition: pubkey.h:312
Botan::KDF
Definition: kdf.h:20
Botan::PK_Key_Agreement_Key
Definition: pk_keys.h:118
Botan::SecureVector< byte >
Botan::DLIES_Decryptor
Definition: dlies.h:47
Botan::PK_Decryptor
Definition: pubkey.h:85
Botan::PK_Encryptor
Definition: pubkey.h:37