esp8266ndn
NDN Arduino library for ESP8266 and more
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
null.hpp
Go to the documentation of this file.
1#ifndef NDNPH_PORT_SHA256_NULL_HPP
2#define NDNPH_PORT_SHA256_NULL_HPP
3
4#include "../../core/common.hpp"
5
6namespace ndnph {
7namespace port_sha256_null {
8
10class Sha256 {
11public:
13 void update(const uint8_t*, size_t) {}
14
19 bool final(uint8_t[NDNPH_SHA256_LEN]) {
20 return false;
21 }
22};
23
26public:
28 explicit HmacSha256(const uint8_t* key, size_t keyLen) {
29 (void)key;
30 (void)keyLen;
31 }
32
34 void update(const uint8_t*, size_t) {}
35
41 bool final(uint8_t result[NDNPH_SHA256_LEN]) {
42 (void)result;
43 return false;
44 }
45};
46
47} // namespace port_sha256_null
48
49#ifdef NDNPH_PORT_SHA256_NULL
50namespace port {
51using Sha256 = port_sha256_null::Sha256;
52using HmacSha256 = port_sha256_null::HmacSha256;
53} // namespace port
54#endif
55
56} // namespace ndnph
57
58#endif // NDNPH_PORT_SHA256_NULL_HPP
Stub HMAC-SHA256 algorithm implementation.
Definition null.hpp:25
void update(const uint8_t *, size_t)
Append bytes into hash state.
Definition null.hpp:34
HmacSha256(const uint8_t *key, size_t keyLen)
Start HMAC operation and set key.
Definition null.hpp:28
Stub SHA256 algorithm implementation.
Definition null.hpp:10
void update(const uint8_t *, size_t)
Append bytes into hash state.
Definition null.hpp:13
#define NDNPH_SHA256_LEN
SHA256 digest length.
Definition common.hpp:34
Definition fs.hpp:33