Botan  1.10.9
mac.h
Go to the documentation of this file.
1 /*
2 * Base class for message authentiction codes
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7 
8 #ifndef BOTAN_MESSAGE_AUTH_CODE_BASE_H__
9 #define BOTAN_MESSAGE_AUTH_CODE_BASE_H__
10 
11 #include <botan/buf_comp.h>
12 #include <botan/sym_algo.h>
13 #include <string>
14 
15 namespace Botan {
16 
17 /**
18 * This class represents Message Authentication Code (MAC) objects.
19 */
21  public SymmetricAlgorithm
22  {
23  public:
24  /**
25  * Verify a MAC.
26  * @param in the MAC to verify as a byte array
27  * @param length the length of param in
28  * @return true if the MAC is valid, false otherwise
29  */
30  virtual bool verify_mac(const byte in[], size_t length);
31 
32  /**
33  * Get a new object representing the same algorithm as *this
34  */
35  virtual MessageAuthenticationCode* clone() const = 0;
36 
37  /**
38  * Get the name of this algorithm.
39  * @return name of this algorithm
40  */
41  virtual std::string name() const = 0;
42  };
43 
44 }
45 
46 #endif
unsigned char byte
Definition: types.h:22