|
| | SHA256 ()=default |
| |
| | ~SHA256 () override |
| |
| void | init () override |
| |
| void | add (const uint8_t *data, size_t len) override |
| |
| void | add (const std::string &data) |
| |
| void | calculate () override |
| |
| size_t | get_size () const override |
| | Get the size of the hash in bytes (32 for SHA256)
|
| |
| void | add (const char *data, size_t len) |
| |
| virtual | ~HashBase ()=default |
| |
| void | add (const char *data, size_t len) |
| |
| void | get_bytes (uint8_t *output) |
| | Retrieve the hash as bytes.
|
| |
| void | get_hex (char *output) |
| | Retrieve the hash as hex characters. Output buffer must hold get_size() * 2 + 1 bytes.
|
| |
| bool | equals_bytes (const uint8_t *expected) |
| | Compare the hash against a provided byte-encoded hash.
|
| |
| bool | equals_hex (const char *expected) |
| | Compare the hash against a provided hex-encoded hash.
|
| |
SHA256 hash implementation.
CRITICAL for ESP32 variants (except original) with IDF 5.5.x hardware SHA acceleration:
- The object MUST stay in the same stack frame (no passing to other functions)
- NO Variable Length Arrays (VLAs) in the same function
Note: Alignment is handled automatically via the HashBase::digest_ member.
Example usage: sha256::SHA256 hasher; hasher.init(); hasher.add(data, len); hasher.calculate();
Definition at line 38 of file sha256.h.