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

Botan 1.10.17

x919_mac.h
Go to the documentation of this file.
1 /*
2 * ANSI X9.19 MAC
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7
8 #ifndef BOTAN_ANSI_X919_MAC_H__
9 #define BOTAN_ANSI_X919_MAC_H__
10
11 #include <botan/mac.h>
12 #include <botan/block_cipher.h>
13
14 namespace Botan {
15
16 /**
17 * DES/3DES-based MAC from ANSI X9.19
18 */
19 class BOTAN_DLL ANSI_X919_MAC : public MessageAuthenticationCode
20 {
21 public:
22 void clear();
23 std::string name() const;
24 size_t output_length() const { return e->block_size(); }
25 MessageAuthenticationCode* clone() const;
26
27 Key_Length_Specification key_spec() const
28 {
29 return Key_Length_Specification(8, 16, 8);
30 }
31
32 /**
33 * @param cipher the underlying block cipher to use
34 */
35 ANSI_X919_MAC(BlockCipher* cipher);
36 ~ANSI_X919_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 BlockCipher* d;
44 SecureVector<byte> state;
45 size_t position;
46 };
47
48 }
49
50 #endif
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::ANSI_X919_MAC::output_length
size_t output_length() const
Definition: x919_mac.h:24
Botan::ANSI_X919_MAC
Definition: x919_mac.h:19
Botan
Definition: algo_base.h:14
Botan::ANSI_X919_MAC::key_spec
Key_Length_Specification key_spec() const
Definition: x919_mac.h:27
Botan::SecureVector< byte >
Botan::BlockCipher
Definition: block_cipher.h:18