ESPHome
2024.10.2
|
#include <hmac_md5.h>
Public Member Functions | |
HmacMD5 ()=default | |
~HmacMD5 ()=default | |
void | init (const uint8_t *key, size_t len) |
Initialize a new MD5 digest computation. More... | |
void | init (const char *key, size_t len) |
void | init (const std::string &key) |
void | add (const uint8_t *data, size_t len) |
Add bytes of data for the digest. More... | |
void | add (const char *data, size_t len) |
void | calculate () |
Compute the digest, based on the provided data. More... | |
void | get_bytes (uint8_t *output) |
Retrieve the HMAC-MD5 digest as bytes. More... | |
void | get_hex (char *output) |
Retrieve the HMAC-MD5 digest as hex characters. More... | |
bool | equals_bytes (const uint8_t *expected) |
Compare the digest against a provided byte-encoded digest (16 bytes). More... | |
bool | equals_hex (const char *expected) |
Compare the digest against a provided hex-encoded digest (32 bytes). More... | |
Protected Attributes | |
md5::MD5Digest | ihash_ |
md5::MD5Digest | ohash_ |
Definition at line 11 of file hmac_md5.h.
|
default |
|
default |
void esphome::hmac_md5::HmacMD5::add | ( | const uint8_t * | data, |
size_t | len | ||
) |
Add bytes of data for the digest.
Definition at line 36 of file hmac_md5.cpp.
|
inline |
Definition at line 23 of file hmac_md5.h.
void esphome::hmac_md5::HmacMD5::calculate | ( | ) |
Compute the digest, based on the provided data.
Definition at line 38 of file hmac_md5.cpp.
bool esphome::hmac_md5::HmacMD5::equals_bytes | ( | const uint8_t * | expected | ) |
Compare the digest against a provided byte-encoded digest (16 bytes).
Definition at line 52 of file hmac_md5.cpp.
bool esphome::hmac_md5::HmacMD5::equals_hex | ( | const char * | expected | ) |
Compare the digest against a provided hex-encoded digest (32 bytes).
Definition at line 54 of file hmac_md5.cpp.
void esphome::hmac_md5::HmacMD5::get_bytes | ( | uint8_t * | output | ) |
Retrieve the HMAC-MD5 digest as bytes.
The output must be able to hold 16 bytes or more.
Definition at line 48 of file hmac_md5.cpp.
void esphome::hmac_md5::HmacMD5::get_hex | ( | char * | output | ) |
Retrieve the HMAC-MD5 digest as hex characters.
The output must be able to hold 32 bytes or more.
Definition at line 50 of file hmac_md5.cpp.
void esphome::hmac_md5::HmacMD5::init | ( | const uint8_t * | key, |
size_t | len | ||
) |
Initialize a new MD5 digest computation.
Definition at line 9 of file hmac_md5.cpp.
|
inline |
Definition at line 18 of file hmac_md5.h.
|
inline |
Definition at line 19 of file hmac_md5.h.
|
protected |
Definition at line 43 of file hmac_md5.h.
|
protected |
Definition at line 44 of file hmac_md5.h.