#include <Sha2Impl.h>
Public Member Functions | |
void | clear () |
Clears the internal state. A new hash can then be calculated. | |
::icl_core::String | getHexDigest () const |
Returns the message digest as a hex string. | |
Sha2Impl () | |
Initializes the internal state. | |
Static Public Attributes | |
static const size_t | cMESSAGE_BLOCK_SIZE = 128 |
The message block size in bytes. | |
static const size_t | cMESSAGE_PAD_POSITION = 112 |
Protected Member Functions | |
void | finalizeBuffer (size_t size) |
void | processBuffer () |
Protected Attributes | |
uint8_t | m_buffer [cMESSAGE_BLOCK_SIZE] |
size_t | m_buffer_fill |
The amount of bytes currently stored in the internal buffer. | |
uint64_t | m_digest [8] |
The whole message digest. | |
uint64_t | m_message_size |
The size of the message so far, in bytes. |
Template specialization for SHA-2 implementation internals for 64-bit word size.
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 105 of file Sha2Impl.h.
icl_core::crypt::Sha2Impl< uint64_t, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len >::Sha2Impl | ( | ) |
Initializes the internal state.
void icl_core::crypt::Sha2Impl< uint64_t, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len >::clear | ( | ) |
Clears the internal state. A new hash can then be calculated.
void icl_core::crypt::Sha2Impl< uint64_t, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len >::finalizeBuffer | ( | size_t | size | ) | [protected] |
Processes the first size bytes of the current buffer contents and finalizes the digest.
::icl_core::String icl_core::crypt::Sha2Impl< uint64_t, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len >::getHexDigest | ( | ) | const |
Returns the message digest as a hex string.
void icl_core::crypt::Sha2Impl< uint64_t, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len >::processBuffer | ( | ) | [protected] |
Processes the current buffer contents and adds them to the message digest.
const size_t icl_core::crypt::Sha2Impl< uint64_t, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len >::cMESSAGE_BLOCK_SIZE = 128 [static] |
The message block size in bytes.
Definition at line 109 of file Sha2Impl.h.
const size_t icl_core::crypt::Sha2Impl< uint64_t, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len >::cMESSAGE_PAD_POSITION = 112 [static] |
The position up to which the last block is padded (the remaining bytes hold the message length).
Definition at line 113 of file Sha2Impl.h.
uint8_t icl_core::crypt::Sha2Impl< uint64_t, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len >::m_buffer[cMESSAGE_BLOCK_SIZE] [protected] |
The internal message buffer. Stores the data for one message block.
Definition at line 142 of file Sha2Impl.h.
size_t icl_core::crypt::Sha2Impl< uint64_t, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len >::m_buffer_fill [protected] |
The amount of bytes currently stored in the internal buffer.
Definition at line 144 of file Sha2Impl.h.
uint64_t icl_core::crypt::Sha2Impl< uint64_t, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len >::m_digest[8] [protected] |
The whole message digest.
Definition at line 136 of file Sha2Impl.h.
uint64_t icl_core::crypt::Sha2Impl< uint64_t, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len >::m_message_size [protected] |
The size of the message so far, in bytes.
Definition at line 138 of file Sha2Impl.h.