Botan 2.19.5 Crypto and TLS for C&

hmac.h
Go to the documentation of this file.
1/*
2* HMAC
3* (C) 1999-2007,2014 Jack Lloyd
4*
5* Botan is released under the Simplified BSD License (see license.txt)
6*/
7
8#ifndef BOTAN_HMAC_H_
9#define BOTAN_HMAC_H_
10
11#include <botan/mac.h>
12#include <botan/hash.h>
13
14 BOTAN_FUTURE_INTERNAL_HEADER(hmac.h)
15
16namespace Botan {
17
18/**
19* HMAC
20*/
21 class BOTAN_PUBLIC_API(2,0) HMAC final : public MessageAuthenticationCode
22 {
23 public:
24 void clear() override;
25 std::string name() const override;
26 MessageAuthenticationCode* clone() const override;
27
28 size_t output_length() const override;
29
30 Key_Length_Specification key_spec() const override;
31
32 /**
33 * @param hash the hash to use for HMACing
34 */
35 explicit HMAC(HashFunction* hash);
36
37 HMAC(const HMAC&) = delete;
38 HMAC& operator=(const HMAC&) = delete;
39 private:
40 void add_data(const uint8_t[], size_t) override;
41 void final_result(uint8_t[]) override;
42 void key_schedule(const uint8_t[], size_t) override;
43
44 std::unique_ptr<HashFunction> m_hash;
45 secure_vector<uint8_t> m_ikey, m_okey;
46 size_t m_hash_output_length;
47 size_t m_hash_block_size;
48 };
49
50}
51
52#endif
Botan::Buffered_Computation::output_length
virtual size_t output_length() const =0
Botan::HMAC
Definition: hmac.h:22
Botan::HMAC::HMAC
HMAC(const HMAC &)=delete
Botan::HMAC::operator=
HMAC & operator=(const HMAC &)=delete
Botan::HashFunction
Definition: hash.h:21
Botan::Key_Length_Specification
Definition: sym_algo.h:20
Botan::MessageAuthenticationCode
Definition: mac.h:23
Botan::MessageAuthenticationCode::clone
virtual MessageAuthenticationCode * clone() const =0
Botan::SymmetricAlgorithm::name
virtual std::string name() const =0
Botan::SymmetricAlgorithm::clear
virtual void clear()=0
Botan::SymmetricAlgorithm::key_spec
virtual Key_Length_Specification key_spec() const =0
final
int(* final)(unsigned char *, CTX *)
Definition: commoncrypto_hash.cpp:29
BOTAN_PUBLIC_API
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
BOTAN_FUTURE_INTERNAL_HEADER
#define BOTAN_FUTURE_INTERNAL_HEADER(hdr)
Definition: compiler.h:136
Botan
Definition: alg_id.cpp:13
Botan::secure_vector
std::vector< T, secure_allocator< T > > secure_vector
Definition: secmem.h:65
hash
MechanismType hash
Definition: p11_mechanism.cpp:64