hdac SDK
SDK for hdac blockchain development
hmac_sha256.h
1 // Copyright (c) 2014 The Bitcoin developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_CRYPTO_HMAC_SHA256_H
6 #define BITCOIN_CRYPTO_HMAC_SHA256_H
7 
8 #include "sha256.h"
9 
10 #include <stdint.h>
11 #include <stdlib.h>
12 #include "crypto_global.h"
13 
16 {
17 private:
18  CSHA256 outer;
19  CSHA256 inner;
20 
21 public:
22  static const size_t OUTPUT_SIZE = 32;
23 
24  CHMAC_SHA256(const unsigned char* key, size_t keylen);
25  CHMAC_SHA256& Write(const unsigned char* data, size_t len)
26  {
27  inner.Write(data, len);
28  return *this;
29  }
30  void Finalize(unsigned char hash[OUTPUT_SIZE]);
31 };
32 
33 #endif // BITCOIN_CRYPTO_HMAC_SHA256_H
Definition: hmac_sha256.h:15
Definition: sha256.h:14