#include <sha2.h>
Definition at line 72 of file sha2.h.
| enum sha2::SHA_TYPE |
| sha2::sha2 | ( | ) | [inline] |
Definition at line 85 of file sha2.h.
References enuSHA_NONE, m_boolEnded, m_boolIsBigEndian, m_chrHexHash, m_chrRawHash, m_digest, m_Type, SHA512_DIGESTC_LENGTH, and SHA512_DIGESTC_STRING_LENGTH.
| bool sha2::IsBigEndian | ( | ) | [inline] |
| const char* sha2::GetTypeString | ( | ) | [inline] |
| void sha2::Init | ( | SHA_TYPE | type | ) |
Definition at line 559 of file sha2.cpp.
References ctx, enuSHA1, enuSHA224, enuSHA256, enuSHA384, enuSHA512, m_boolEnded, m_Type, MEMCPY_BCOPY(), MEMSET_BZERO(), sha1_initial_hash_value, sha224_initial_hash_value, sha256_initial_hash_value, sha384_initial_hash_value, sha512_initial_hash_value, and sha2::SHA_CTX::state.
Referenced by GetHash().
| void sha2::Update | ( | const sha_byte * | data, | |
| size_t | len | |||
| ) |
| void sha2::End | ( | ) |
Definition at line 586 of file sha2.cpp.
References ctx, enuSHA1, enuSHA224, enuSHA256, enuSHA384, enuSHA512, m_boolEnded, m_boolIsBigEndian, m_chrHexHash, m_digest, m_strHash, m_Type, MEMCPY_BCOPY(), SHA1_DIGESTC_LENGTH, SHA224_DIGESTC_LENGTH, SHA256_DIGESTC_LENGTH, SHA256_Internal_Last(), SHA384_DIGESTC_LENGTH, SHA512_DIGESTC_LENGTH, SHA512_Internal_Last(), sha_hex_digits, and sha2::SHA_CTX::state.
Referenced by GetHash().
| const char * sha2::HexHash | ( | ) |
| const string & sha2::StringHash | ( | ) |
| const char * sha2::RawHash | ( | int & | length | ) |
Definition at line 663 of file sha2.cpp.
References enuSHA1, enuSHA224, enuSHA256, enuSHA384, enuSHA512, m_boolEnded, m_digest, m_Type, SHA1_DIGESTC_LENGTH, SHA224_DIGESTC_LENGTH, SHA256_DIGESTC_LENGTH, SHA384_DIGESTC_LENGTH, and SHA512_DIGESTC_LENGTH.
| void sha2::SHA256_Internal_Last | ( | bool | isSha1 = false |
) | [private] |
Definition at line 419 of file sha2.cpp.
References sha2::SHA_CTX::bitcount, sha2::SHA_CTX::buffer, ctx, m_boolIsBigEndian, MEMSET_BZERO(), REVERSE64(), SHA1_Internal_Transform(), and SHA256_Internal_Transform().
Referenced by End().
| void sha2::SHA512_Internal_Last | ( | ) | [private] |
Definition at line 447 of file sha2.cpp.
References sha2::SHA_CTX::bitcount, sha2::SHA_CTX::buffer, ctx, m_boolIsBigEndian, MEMSET_BZERO(), REVERSE64(), and SHA512_Internal_Transform().
Referenced by End().
| void sha2::SHA1_Internal_Transform | ( | const sha_word32 * | data | ) | [private] |
Definition at line 221 of file sha2.cpp.
References sha2::SHA_CTX::buffer, Ch(), ctx, K1_0_TO_19, K1_20_TO_39, K1_40_TO_59, K1_60_TO_79, m_boolIsBigEndian, Maj(), Parity(), REVERSE32(), ROTL32(), and sha2::SHA_CTX::state.
Referenced by SHA256_Internal_Last(), and SHA32bit_Update().
| void sha2::SHA256_Internal_Transform | ( | const sha_word32 * | data | ) | [private] |
* SHA-256: ********************************************************
Definition at line 272 of file sha2.cpp.
References sha2::SHA_CTX::buffer, Ch(), ctx, K256, m_boolIsBigEndian, Maj(), REVERSE32(), sigma0_256(), Sigma0_256(), sigma1_256(), Sigma1_256(), and sha2::SHA_CTX::state.
Referenced by SHA256_Internal_Last(), and SHA32bit_Update().
| void sha2::SHA512_Internal_Transform | ( | const sha_word64 * | data | ) | [private] |
Definition at line 343 of file sha2.cpp.
References sha2::SHA_CTX::buffer, Ch(), ctx, K512, m_boolIsBigEndian, Maj(), REVERSE64(), sigma0_512(), Sigma0_512(), sigma1_512(), Sigma1_512(), and sha2::SHA_CTX::state.
Referenced by SHA512_Internal_Last(), and SHA64bit_Update().
| void sha2::SHA32bit_Update | ( | const sha_byte * | data, | |
| size_t | len, | |||
| bool | isSha1 = false | |||
| ) | [private] |
Definition at line 480 of file sha2.cpp.
References sha2::SHA_CTX::bitcount, sha2::SHA_CTX::buffer, ctx, MEMCPY_BCOPY(), SHA1_Internal_Transform(), and SHA256_Internal_Transform().
Referenced by Update().
| void sha2::SHA64bit_Update | ( | const sha_byte * | data, | |
| size_t | len | |||
| ) | [private] |
Definition at line 516 of file sha2.cpp.
References ADDINC128(), sha2::SHA_CTX::bitcount, sha2::SHA_CTX::buffer, ctx, MEMCPY_BCOPY(), and SHA512_Internal_Transform().
Referenced by Update().
| void sha2::MEMSET_BZERO | ( | void * | p, | |
| size_t | l | |||
| ) | [inline, private] |
Definition at line 162 of file sha2.h.
Referenced by Init(), SHA256_Internal_Last(), and SHA512_Internal_Last().
| void sha2::MEMCPY_BCOPY | ( | void * | d, | |
| const void * | s, | |||
| size_t | l | |||
| ) | [inline, private] |
Definition at line 163 of file sha2.h.
Referenced by End(), Init(), SHA32bit_Update(), and SHA64bit_Update().
| void sha2::ADDINC128 | ( | sha_word64 * | w, | |
| sha_word32 | n | |||
| ) | [inline, private] |
| sha_word32 sha2::SHR | ( | sha_word32 | b, | |
| sha_word32 | x | |||
| ) | [inline, private] |
Definition at line 174 of file sha2.h.
Referenced by sigma0_256(), sigma0_512(), sigma1_256(), and sigma1_512().
| sha_word64 sha2::SHR | ( | sha_word64 | b, | |
| sha_word64 | x | |||
| ) | [inline, private] |
| sha_word32 sha2::ROTR32 | ( | sha_word32 | b, | |
| sha_word32 | x | |||
| ) | [inline, private] |
Definition at line 177 of file sha2.h.
Referenced by sigma0_256(), Sigma0_256(), sigma1_256(), and Sigma1_256().
| sha_word64 sha2::ROTR64 | ( | sha_word64 | b, | |
| sha_word64 | x | |||
| ) | [inline, private] |
Definition at line 179 of file sha2.h.
Referenced by sigma0_512(), Sigma0_512(), sigma1_512(), and Sigma1_512().
| sha_word32 sha2::ROTL32 | ( | sha_word32 | b, | |
| sha_word32 | x | |||
| ) | [inline, private] |
| sha_word32 sha2::Ch | ( | sha_word32 | x, | |
| sha_word32 | y, | |||
| sha_word32 | z | |||
| ) | [inline, private] |
Definition at line 184 of file sha2.h.
Referenced by SHA1_Internal_Transform(), SHA256_Internal_Transform(), and SHA512_Internal_Transform().
| sha_word64 sha2::Ch | ( | sha_word64 | x, | |
| sha_word64 | y, | |||
| sha_word64 | z | |||
| ) | [inline, private] |
| sha_word32 sha2::Maj | ( | sha_word32 | x, | |
| sha_word32 | y, | |||
| sha_word32 | z | |||
| ) | [inline, private] |
Definition at line 186 of file sha2.h.
Referenced by SHA1_Internal_Transform(), SHA256_Internal_Transform(), and SHA512_Internal_Transform().
| sha_word64 sha2::Maj | ( | sha_word64 | x, | |
| sha_word64 | y, | |||
| sha_word64 | z | |||
| ) | [inline, private] |
| sha_word32 sha2::Parity | ( | sha_word32 | x, | |
| sha_word32 | y, | |||
| sha_word32 | z | |||
| ) | [inline, private] |
| sha_word32 sha2::Sigma0_256 | ( | sha_word32 | x | ) | [inline, private] |
Definition at line 193 of file sha2.h.
References ROTR32().
Referenced by SHA256_Internal_Transform().
| sha_word32 sha2::Sigma1_256 | ( | sha_word32 | x | ) | [inline, private] |
Definition at line 194 of file sha2.h.
References ROTR32().
Referenced by SHA256_Internal_Transform().
| sha_word32 sha2::sigma0_256 | ( | sha_word32 | x | ) | [inline, private] |
Definition at line 195 of file sha2.h.
References ROTR32(), and SHR().
Referenced by SHA256_Internal_Transform().
| sha_word32 sha2::sigma1_256 | ( | sha_word32 | x | ) | [inline, private] |
Definition at line 196 of file sha2.h.
References ROTR32(), and SHR().
Referenced by SHA256_Internal_Transform().
| sha_word64 sha2::Sigma0_512 | ( | sha_word64 | x | ) | [inline, private] |
Definition at line 199 of file sha2.h.
References ROTR64().
Referenced by SHA512_Internal_Transform().
| sha_word64 sha2::Sigma1_512 | ( | sha_word64 | x | ) | [inline, private] |
Definition at line 200 of file sha2.h.
References ROTR64().
Referenced by SHA512_Internal_Transform().
| sha_word64 sha2::sigma0_512 | ( | sha_word64 | x | ) | [inline, private] |
Definition at line 201 of file sha2.h.
References ROTR64(), and SHR().
Referenced by SHA512_Internal_Transform().
| sha_word64 sha2::sigma1_512 | ( | sha_word64 | x | ) | [inline, private] |
Definition at line 202 of file sha2.h.
References ROTR64(), and SHR().
Referenced by SHA512_Internal_Transform().
| void sha2::REVERSE32 | ( | sha_word32 | w, | |
| sha_word32 & | x | |||
| ) | [inline, private] |
Definition at line 204 of file sha2.h.
Referenced by SHA1_Internal_Transform(), and SHA256_Internal_Transform().
| void sha2::REVERSE64 | ( | sha_word64 | w, | |
| sha_word64 & | x | |||
| ) | [inline, private] |
Definition at line 217 of file sha2.h.
Referenced by SHA256_Internal_Last(), SHA512_Internal_Last(), and SHA512_Internal_Transform().
SHA_TYPE sha2::m_Type [private] |
Definition at line 136 of file sha2.h.
Referenced by End(), GetEnumType(), GetTypeString(), Init(), RawHash(), sha2(), and Update().
std::string sha2::m_strHash [private] |
bool sha2::m_boolEnded [private] |
bool sha2::m_boolIsBigEndian [private] |
Definition at line 138 of file sha2.h.
Referenced by End(), IsBigEndian(), SHA1_Internal_Transform(), sha2(), SHA256_Internal_Last(), SHA256_Internal_Transform(), SHA512_Internal_Last(), and SHA512_Internal_Transform().
char sha2::m_chrRawHash[SHA512_DIGESTC_LENGTH] [private] |
char sha2::m_chrHexHash[SHA512_DIGESTC_STRING_LENGTH] [private] |
sha_byte sha2::m_digest[SHA512_DIGESTC_LENGTH] [private] |
struct sha2::SHA_CTX sha2::ctx [private] |
1.5.3