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::Sha2< T, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len >
An implementation of SHA-2, following the FIPS PUB 180-3 Secure Hash Standard (SHS).
Instead of instantiating this manually, use the convenience typedefs Sha224, Sha256, Sha384 or Sha512 instead.
Usage example (using Sha256):
sha.process("An example string.");
sha.process("More data for the same digest.");
sha.finalize();
std::cout << sha.getHexDigest() <<
std::endl;
- 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. |
- See also
- Sha224, Sha256, Sha384, Sha512
Definition at line 66 of file Sha2.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>
typedef Sha2Impl<T, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len> icl_core::crypt::Sha2< T, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len >::Impl |
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>
Finalizes 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>
void icl_core::crypt::Sha2< 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.
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 string data.
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 string data.
Definition at line 81 of file Sha2.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>
Sha2& icl_core::crypt::Sha2< T, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len >::process |
( |
const void * |
data, |
|
|
size_t |
size |
|
) |
| |
Processes size bytes from the buffer data.