Botan: src/mac/mac.h Source File

Botan 1.10.16

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 */
20 class BOTAN_DLL MessageAuthenticationCode : public Buffered_Computation,
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
Botan::Buffered_Computation
Definition: buf_comp.h:20
Botan::MessageAuthenticationCode
Definition: mac.h:20
Botan::byte
unsigned char byte
Definition: types.h:22
Botan::SymmetricAlgorithm
Definition: sym_algo.h:22
Botan
Definition: algo_base.h:14