Botan: src/mac/cbc_mac/cbc_mac.h Source File

Botan 1.10.12

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

cbc_mac.h
Go to the documentation of this file.
1 /*
2 * CBC-MAC
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7
8 #ifndef BOTAN_CBC_MAC_H__
9 #define BOTAN_CBC_MAC_H__
10
11 #include <botan/mac.h>
12 #include <botan/block_cipher.h>
13
14 namespace Botan {
15
16 /**
17 * CBC-MAC
18 */
19 class BOTAN_DLL CBC_MAC : public MessageAuthenticationCode
20 {
21 public:
22 std::string name() const;
23 MessageAuthenticationCode* clone() const;
24 size_t output_length() const { return e->block_size(); }
25 void clear();
26
27 Key_Length_Specification key_spec() const
28 {
29 return e->key_spec();
30 }
31
32 /**
33 * @param cipher the underlying block cipher to use
34 */
35 CBC_MAC(BlockCipher* cipher);
36 ~CBC_MAC();
37 private:
38 void add_data(const byte[], size_t);
39 void final_result(byte[]);
40 void key_schedule(const byte[], size_t);
41
42 BlockCipher* e;
43 SecureVector<byte> state;
44 size_t position;
45 };
46
47 }
48
49 #endif
Botan::CBC_MAC::key_spec
Key_Length_Specification key_spec() const
Definition: cbc_mac.h:27
Botan::CBC_MAC::output_length
size_t output_length() const
Definition: cbc_mac.h:24
Botan::CBC_MAC
Definition: cbc_mac.h:19
Botan::Key_Length_Specification
Definition: key_spec.h:18
Botan::MessageAuthenticationCode
Definition: mac.h:20
Botan::byte
unsigned char byte
Definition: types.h:22
Botan
Definition: algo_base.h:14
Botan::SecureVector< byte >
Botan::BlockCipher
Definition: block_cipher.h:18