template<typename T, T t_h0, T t_h1, T t_h2, T t_h3, T t_h4, T t_h5, T t_h6, T t_h7, size_t t_len>
class icl_core::crypt::Sha2Impl< T, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len >
The implementation internals for SHA-2, following the FIPS PUB 180-3 Secure Hash Standard (SHS). The implementation works for 32-bit (SHA-224, SHA-256) and 64-bit (SHA-384, SHA-512) data types. The algorithmic differences in the 64-bit version are captured by a template specialization.
- Template Parameters
-
T | The type of the message words (uint32_t or uint64_t). |
t_h0 | The initial hash value, word 0. |
t_h1 | The initial hash value, word 1. |
t_h2 | The initial hash value, word 2. |
t_h3 | The initial hash value, word 3. |
t_h4 | The initial hash value, word 4. |
t_h5 | The initial hash value, word 5. |
t_h6 | The initial hash value, word 6. |
t_h7 | The initial hash value, word 7. |
t_len | The length, in words, of the message digest. This may be at most 8 (i.e., all eight words of the digest are used). Only the first t_len words of the digest are returned otherwise. |
Definition at line 52 of file Sha2Impl.h.
template<typename T , T t_h0, T t_h1, T t_h2, T t_h3, T t_h4, T t_h5, T t_h6, T t_h7, size_t t_len>
Initializes the internal state.
template<typename T , T t_h0, T t_h1, T t_h2, T t_h3, T t_h4, T t_h5, T t_h6, T t_h7, size_t t_len>
Clears the internal state. A new hash can then be calculated.
template<typename T , T t_h0, T t_h1, T t_h2, T t_h3, T t_h4, T t_h5, T t_h6, T t_h7, size_t t_len>
Returns the message digest as a hex string.
template<typename T , T t_h0, T t_h1, T t_h2, T t_h3, T t_h4, T t_h5, T t_h6, T t_h7, size_t t_len>
Processes the current buffer contents and adds them to the message digest.
template<typename T , T t_h0, T t_h1, T t_h2, T t_h3, T t_h4, T t_h5, T t_h6, T t_h7, size_t t_len>
The message block size in bytes.
Definition at line 56 of file Sha2Impl.h.
template<typename T , T t_h0, T t_h1, T t_h2, T t_h3, T t_h4, T t_h5, T t_h6, T t_h7, size_t t_len>
const size_t icl_core::crypt::Sha2Impl< T, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len >::cMESSAGE_PAD_POSITION = 56 |
|
static |
The position up to which the last block is padded (the remaining bytes hold the message length).
Definition at line 60 of file Sha2Impl.h.
template<typename T , T t_h0, T t_h1, T t_h2, T t_h3, T t_h4, T t_h5, T t_h6, T t_h7, size_t t_len>
The internal message buffer. Stores the data for one message block.
Definition at line 84 of file Sha2Impl.h.
template<typename T , T t_h0, T t_h1, T t_h2, T t_h3, T t_h4, T t_h5, T t_h6, T t_h7, size_t t_len>
The amount of bytes currently stored in the internal buffer.
Definition at line 86 of file Sha2Impl.h.
template<typename T , T t_h0, T t_h1, T t_h2, T t_h3, T t_h4, T t_h5, T t_h6, T t_h7, size_t t_len>
The whole message digest.
Definition at line 78 of file Sha2Impl.h.
template<typename T , T t_h0, T t_h1, T t_h2, T t_h3, T t_h4, T t_h5, T t_h6, T t_h7, size_t t_len>
The size of the message so far, in bytes.
Definition at line 80 of file Sha2Impl.h.