Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
icl_core::crypt::Sha2Impl< uint64_t, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len > Class Template Reference

#include <Sha2Impl.h>

Public Member Functions

void clear ()
 Clears the internal state. A new hash can then be calculated. More...
 
::icl_core::String getHexDigest () const
 Returns the message digest as a hex string. More...
 
 Sha2Impl ()
 Initializes the internal state. More...
 

Static Public Attributes

static const size_t cMESSAGE_BLOCK_SIZE = 128
 The message block size in bytes. More...
 
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. More...
 
uint64_t m_digest [8]
 The whole message digest. More...
 
uint64_t m_message_size
 The size of the message so far, in bytes. More...
 

Detailed Description

template<uint64_t t_h0, uint64_t t_h1, uint64_t t_h2, uint64_t t_h3, uint64_t t_h4, uint64_t t_h5, uint64_t t_h6, uint64_t t_h7, size_t t_len>
class icl_core::crypt::Sha2Impl< uint64_t, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len >

Template specialization for SHA-2 implementation internals for 64-bit word size.

Template Parameters
t_h0The initial hash value, word 0.
t_h1The initial hash value, word 1.
t_h2The initial hash value, word 2.
t_h3The initial hash value, word 3.
t_h4The initial hash value, word 4.
t_h5The initial hash value, word 5.
t_h6The initial hash value, word 6.
t_h7The initial hash value, word 7.
t_lenThe 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.

Constructor & Destructor Documentation

template<uint64_t t_h0, uint64_t t_h1, uint64_t t_h2, uint64_t t_h3, uint64_t t_h4, uint64_t t_h5, uint64_t t_h6, uint64_t t_h7, size_t t_len>
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.

Member Function Documentation

template<uint64_t t_h0, uint64_t t_h1, uint64_t t_h2, uint64_t t_h3, uint64_t t_h4, uint64_t t_h5, uint64_t t_h6, uint64_t t_h7, size_t t_len>
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.

template<uint64_t t_h0, uint64_t t_h1, uint64_t t_h2, uint64_t t_h3, uint64_t t_h4, uint64_t t_h5, uint64_t t_h6, uint64_t t_h7, size_t t_len>
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.

template<uint64_t t_h0, uint64_t t_h1, uint64_t t_h2, uint64_t t_h3, uint64_t t_h4, uint64_t t_h5, uint64_t t_h6, uint64_t t_h7, size_t t_len>
::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.

template<uint64_t t_h0, uint64_t t_h1, uint64_t t_h2, uint64_t t_h3, uint64_t t_h4, uint64_t t_h5, uint64_t t_h6, uint64_t t_h7, size_t t_len>
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.

Member Data Documentation

template<uint64_t t_h0, uint64_t t_h1, uint64_t t_h2, uint64_t t_h3, uint64_t t_h4, uint64_t t_h5, uint64_t t_h6, uint64_t t_h7, size_t t_len>
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.

template<uint64_t t_h0, uint64_t t_h1, uint64_t t_h2, uint64_t t_h3, uint64_t t_h4, uint64_t t_h5, uint64_t t_h6, uint64_t t_h7, size_t t_len>
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.

template<uint64_t t_h0, uint64_t t_h1, uint64_t t_h2, uint64_t t_h3, uint64_t t_h4, uint64_t t_h5, uint64_t t_h6, uint64_t t_h7, size_t t_len>
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.

template<uint64_t t_h0, uint64_t t_h1, uint64_t t_h2, uint64_t t_h3, uint64_t t_h4, uint64_t t_h5, uint64_t t_h6, uint64_t t_h7, size_t t_len>
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.

template<uint64_t t_h0, uint64_t t_h1, uint64_t t_h2, uint64_t t_h3, uint64_t t_h4, uint64_t t_h5, uint64_t t_h6, uint64_t t_h7, size_t t_len>
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.

template<uint64_t t_h0, uint64_t t_h1, uint64_t t_h2, uint64_t t_h3, uint64_t t_h4, uint64_t t_h5, uint64_t t_h6, uint64_t t_h7, size_t t_len>
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.


The documentation for this class was generated from the following file:


fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:59