Botan 3.6.1
Crypto and TLS for C&
x919_mac.h
Go to the documentation of this file.
1/*
2* ANSI X9.19 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_ANSI_X919_MAC_H_
9#define BOTAN_ANSI_X919_MAC_H_
10
11#include <botan/block_cipher.h>
12#include <botan/mac.h>
13
14namespace Botan {
15
16/**
17* DES/3DES-based MAC from ANSI X9.19
18*/
20 public:
21 void clear() override;
22 std::string name() const override;
23
24 size_t output_length() const override { return 8; }
25
26 std::unique_ptr<MessageAuthenticationCode> new_object() const override;
27
28 Key_Length_Specification key_spec() const override { return Key_Length_Specification(8, 16, 8); }
29
30 bool has_keying_material() const override;
31
33
34 ANSI_X919_MAC(const ANSI_X919_MAC&) = delete;
36
37 private:
38 void add_data(std::span<const uint8_t>) override;
39 void final_result(std::span<uint8_t>) override;
40 void key_schedule(std::span<const uint8_t>) override;
41
42 std::unique_ptr<BlockCipher> m_des1, m_des2;
44 size_t m_position;
45};
46
47} // namespace Botan
48
49#endif
size_t output_length() const override
Definition x919_mac.h:24
std::unique_ptr< MessageAuthenticationCode > new_object() const override
Definition x919_mac.cpp:87
Key_Length_Specification key_spec() const override
Definition x919_mac.h:28
std::string name() const override
Definition x919_mac.cpp:83
ANSI_X919_MAC & operator=(const ANSI_X919_MAC &)=delete
bool has_keying_material() const override
Definition x919_mac.cpp:54
void clear() override
Definition x919_mac.cpp:76
ANSI_X919_MAC(const ANSI_X919_MAC &)=delete
int(* final)(unsigned char *, CTX *)
std::vector< T, secure_allocator< T > > secure_vector
Definition secmem.h:61