Botan  2.10.0
Crypto and TLS for C++11
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 namespace Botan {
15 
16 /**
17 * HMAC
18 */
19 class BOTAN_PUBLIC_API(2,0) HMAC final : public MessageAuthenticationCode
20  {
21  public:
22  void clear() override;
23  std::string name() const override;
24  MessageAuthenticationCode* clone() const override;
25 
26  size_t output_length() const override;
27 
28  Key_Length_Specification key_spec() const override;
29 
30  /**
31  * @param hash the hash to use for HMACing
32  */
33  explicit HMAC(HashFunction* hash);
34 
35  HMAC(const HMAC&) = delete;
36  HMAC& operator=(const HMAC&) = delete;
37  private:
38  void add_data(const uint8_t[], size_t) override;
39  void final_result(uint8_t[]) override;
40  void key_schedule(const uint8_t[], size_t) override;
41 
42  std::unique_ptr<HashFunction> m_hash;
43  secure_vector<uint8_t> m_ikey, m_okey;
44  size_t m_hash_output_length;
45  size_t m_hash_block_size;
46  };
47 
48 }
49 
50 #endif
BigInt const BigInt const BigInt const std::string & hash
Definition: rfc6979.h:47
size_t * output_length
Definition: ffi.h:277
int(* final)(unsigned char *, CTX *)
char * name
Definition: ffi.h:327
Definition: alg_id.cpp:13
class BOTAN_PUBLIC_API(2, 0) AlgorithmIdentifier final bool BOTAN_PUBLIC_API(2, 0) operator
Name Constraints.
Definition: asn1_obj.h:65