Public Types | Public Member Functions | Protected Member Functions
icl_core::crypt::Sha2< T, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len > Class Template Reference

#include <Sha2.h>

Inheritance diagram for icl_core::crypt::Sha2< T, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef Sha2Impl< T, t_h0,
t_h1, t_h2, t_h3, t_h4, t_h5,
t_h6, t_h7, t_len > 
Impl

Public Member Functions

Sha2finalize ()
 Finalizes the message digest.
Sha2process (const char *data)
 Processes the string data.
Sha2process (const ::icl_core::String &data)
 Processes the string data.
Sha2process (const void *data, size_t size)
 Processes size bytes from the buffer data.
 Sha2 ()
 Initializes the internal state.

Protected Member Functions

void finalizeBuffer (size_t size)

Detailed Description

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):

  Sha256 sha;
  sha.process("An example string.");
  sha.process("More data for the same digest.");
  sha.finalize();
  std::cout << sha.getHexDigest() << std::endl;
Template Parameters:
TThe type of the message words (uint32_t or uint64_t).
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.
See also:
Sha224, Sha256, Sha384, Sha512

Definition at line 66 of file Sha2.h.


Member Typedef Documentation

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

Definition at line 69 of file Sha2.h.


Constructor & Destructor Documentation

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>
icl_core::crypt::Sha2< T, t_h0, t_h1, t_h2, t_h3, t_h4, t_h5, t_h6, t_h7, t_len >::Sha2 ( )

Initializes the internal state.


Member Function Documentation

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 >::finalize ( )

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>
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 char *  data)

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>
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 ::icl_core::String data) [inline]

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.


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


fzi_icl_core
Author(s):
autogenerated on Tue Aug 8 2017 02:28:05