Raven Core  3.0.0
P2P Digital Currency
hmac_sha256.h
Go to the documentation of this file.
1 // Copyright (c) 2014 The Bitcoin Core developers
2 // Copyright (c) 2017-2019 The Raven Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef RAVEN_CRYPTO_HMAC_SHA256_H
7 #define RAVEN_CRYPTO_HMAC_SHA256_H
8 
9 #include "crypto/sha256.h"
10 
11 #include <stdint.h>
12 #include <stdlib.h>
13 
16 {
17 private:
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 // RAVEN_CRYPTO_HMAC_SHA256_H
CSHA256 & Write(const unsigned char *data, size_t len)
Definition: sha256.cpp:202
A hasher class for HMAC-SHA-256.
Definition: hmac_sha256.h:15
CSHA256 inner
Definition: hmac_sha256.h:19
CHMAC_SHA256 & Write(const unsigned char *data, size_t len)
Definition: hmac_sha256.h:25
CHMAC_SHA256(const unsigned char *key, size_t keylen)
Definition: hmac_sha256.cpp:10
CSHA256 outer
Definition: hmac_sha256.h:18
void Finalize(unsigned char hash[OUTPUT_SIZE])
Definition: hmac_sha256.cpp:30
static const size_t OUTPUT_SIZE
Definition: hmac_sha256.h:22
A hasher class for SHA-256.
Definition: sha256.h:14