Crypto++ 8.9
Free C++ class library of cryptographic schemes
Public Member Functions | Static Public Member Functions | List of all members
SHA256 Class Reference

SHA-256 message digest. More...

#include <sha.h>

+ Inheritance diagram for SHA256:

Public Member Functions

std::string AlgorithmProvider () const
 
- Public Member Functions inherited from IteratedHashWithStaticTransform< word32, BigEndian, 64, 32, SHA256, 32, true >
unsigned int DigestSize () const
 Provides the digest size of the hash.
 
- Public Member Functions inherited from ClonableImpl< DERIVED, BASE >
ClonableClone () const
 Create a copy of this object.
 

Static Public Member Functions

static void InitState (HashWordType *state)
 Initialize state array.
 
static void Transform (HashWordType *digest, const HashWordType *data)
 Operate the hash.
 
static const char * StaticAlgorithmName ()
 The algorithm name.
 

Additional Inherited Members

- Static Public Attributes inherited from IteratedHashWithStaticTransform< word32, BigEndian, 64, 32, SHA256, 32, true >
static const int DIGESTSIZE
 

Detailed Description

SHA-256 message digest.

See also
SHA-256
Since
SHA2 since Crypto++ 4.0, ARMv8 SHA since Crypto++ 6.0, Intel SHA since Crypto++ 6.0, Power8 SHA since Crypto++ 6.1

Definition at line 64 of file sha.h.

Member Function Documentation

◆ InitState()

static void SHA256::InitState ( HashWordType * state)
static

Initialize state array.

Parameters
statethe state of the hash

InitState sets a state array to SHA256 initial values

Hashes which derive from IteratedHashWithStaticTransform provide static member functions InitState and Transform. External classes, like SEAL and MDC, can initialize state with a user provided key and operate the hash on the data with the user supplied state.

Note
On Intel platforms the state array must be 16-byte aligned for SSE2.

◆ Transform()

static void SHA256::Transform ( HashWordType * digest,
const HashWordType * data )
static

Operate the hash.

Parameters
digestthe state of the hash
datathe data to be digested

Transform operates the hash on data. When the call is invoked digest holds initial state. Upon return digest holds the hash or updated state.

Hashes which derive from IteratedHashWithStaticTransform provide static member functions InitState and Transform. External classes, like SEAL and MDC, can initialize state with a user provided key and operate the hash on the data with the user supplied state.

Note
On Intel platforms the state array and data must be 16-byte aligned for SSE2.

◆ StaticAlgorithmName()

static const char * SHA256::StaticAlgorithmName ( )
inlinestatic

The algorithm name.

Returns
C-style string "SHA-256"

Definition at line 90 of file sha.h.


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