Botan 2.13.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

cbc_mac.h
Go to the documentation of this file.
1 /*
2 * CBC-MAC
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
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 BOTAN_FUTURE_INTERNAL_HEADER(cbc_mac.h)
15
16 namespace Botan {
17
18 /**
19 * CBC-MAC
20 */
21 class BOTAN_PUBLIC_API(2,0) CBC_MAC final : public MessageAuthenticationCode
22 {
23 public:
24 std::string name() const override;
25 MessageAuthenticationCode* clone() const override;
26 size_t output_length() const override { return m_cipher->block_size(); }
27 void clear() override;
28
29 Key_Length_Specification key_spec() const override
30 {
31 return m_cipher->key_spec();
32 }
33
34 /**
35 * @param cipher the block cipher to use
36 */
37 explicit CBC_MAC(BlockCipher* cipher);
38 private:
39 void add_data(const uint8_t[], size_t) override;
40 void final_result(uint8_t[]) override;
41 void key_schedule(const uint8_t[], size_t) override;
42
43 std::unique_ptr<BlockCipher> m_cipher;
44 secure_vector<uint8_t> m_state;
45 size_t m_position = 0;
46 };
47
48 }
49
50 #endif
m_cipher
CCCryptorRef m_cipher
Definition: commoncrypto_mode.cpp:50
Botan::CBC_MAC
Definition: cbc_mac.h:21
Botan::Key_Length_Specification
Definition: key_spec.h:18
final
int(* final)(unsigned char *, CTX *)
Definition: commoncrypto_hash.cpp:28
BOTAN_PUBLIC_API
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
Botan::MessageAuthenticationCode
Definition: mac.h:21
Botan::secure_vector
std::vector< T, secure_allocator< T >> secure_vector
Definition: secmem.h:65
Botan::SymmetricAlgorithm::name
virtual std::string name() const =0
Botan::SymmetricAlgorithm::clear
virtual void clear()=0
Botan
Definition: alg_id.cpp:13
Botan::CBC_MAC::key_spec
Key_Length_Specification key_spec() const override
Definition: cbc_mac.h:29
Botan::MessageAuthenticationCode::clone
virtual MessageAuthenticationCode * clone() const =0
Botan::CBC_MAC::output_length
size_t output_length() const override
Definition: cbc_mac.h:26
BOTAN_FUTURE_INTERNAL_HEADER
#define BOTAN_FUTURE_INTERNAL_HEADER(hdr)
Definition: compiler.h:139
Botan::BlockCipher
Definition: block_cipher.h:21