Botan 1.10.17
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
14namespace Botan {
15
16/**
17* CBC-MAC
18*/
19class BOTAN_DLL CBC_MAC : public MessageAuthenticationCode
20 {
21 public:
22 std::string name() 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
CBC_MAC(BlockCipher *cipher)
Definition cbc_mac.cpp:91
Key_Length_Specification key_spec() const
Definition cbc_mac.h:27
size_t output_length() const
Definition cbc_mac.h:24
std::string name() const
Definition cbc_mac.cpp:75
MessageAuthenticationCode * clone() const
Definition cbc_mac.cpp:83