Botan  1.10.9
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 
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;
44  size_t position;
45  };
46 
47 }
48 
49 #endif
Key_Length_Specification key_spec() const
Definition: cbc_mac.h:27
size_t output_length() const
Definition: cbc_mac.h:24
unsigned char byte
Definition: types.h:22
RC4_KEY state
Definition: ossl_arc4.cpp:39