#include <limits.h>#include "sha2.cpp"Go to the source code of this file.
Classes | |
| struct | sha256_ctx |
| struct | sha512_ctx |
| struct | sha2_ctx |
Defines | |
| #define | sfx_lo(x, y) x##y |
| #define | sfx_hi(x, y) sfx_lo(x,y) |
| #define | n_u32(p) sfx_hi(0x##p,s_u32) |
| #define | n_u64(p) sfx_hi(0x##p,s_u64) |
| #define | SHA256_DIGEST_SIZE 32 |
| #define | SHA384_DIGEST_SIZE 48 |
| #define | SHA512_DIGEST_SIZE 64 |
| #define | SHA256_BLOCK_SIZE 64 |
| #define | SHA384_BLOCK_SIZE 128 |
| #define | SHA512_BLOCK_SIZE 128 |
| #define | SHA2_DIGEST_SIZE SHA256_DIGEST_SIZE |
| #define | SHA2_MAX_DIGEST_SIZE SHA512_DIGEST_SIZE |
| #define | SHA2_GOOD 0 |
| #define | SHA2_BAD 1 |
| #define | sha384_hash sha512_hash |
Typedefs | |
| typedef sha512_ctx | sha384_ctx |
Functions | |
| void | sha256_compile (sha256_ctx ctx[1]) |
| void | sha512_compile (sha512_ctx ctx[1]) |
| void | sha256_begin (sha256_ctx ctx[1]) |
| void | sha256_hash (const unsigned char data[], unsigned long len, sha256_ctx ctx[1]) |
| void | sha256_end (unsigned char hval[], sha256_ctx ctx[1]) |
| void | sha256 (unsigned char hval[], const unsigned char data[], unsigned long len) |
| void | sha384_begin (sha384_ctx ctx[1]) |
| void | sha384_end (unsigned char hval[], sha384_ctx ctx[1]) |
| void | sha384 (unsigned char hval[], const unsigned char data[], unsigned long len) |
| void | sha512_begin (sha512_ctx ctx[1]) |
| void | sha512_hash (const unsigned char data[], unsigned long len, sha512_ctx ctx[1]) |
| void | sha512_end (unsigned char hval[], sha512_ctx ctx[1]) |
| void | sha512 (unsigned char hval[], const unsigned char data[], unsigned long len) |
| int | sha2_begin (unsigned long size, sha2_ctx ctx[1]) |
| void | sha2_hash (const unsigned char data[], unsigned long len, sha2_ctx ctx[1]) |
| void | sha2_end (unsigned char hval[], sha2_ctx ctx[1]) |
| int | sha2 (unsigned char hval[], unsigned long size, const unsigned char data[], unsigned long len) |
| #define SHA256_BLOCK_SIZE 64 |
| #define SHA256_DIGEST_SIZE 32 |
| #define SHA384_DIGEST_SIZE 48 |
| #define sha384_hash sha512_hash |
| #define SHA512_BLOCK_SIZE 128 |
| #define SHA512_DIGEST_SIZE 64 |
| typedef sha512_ctx sha384_ctx |
| int sha2 | ( | unsigned char | hval[], | |
| unsigned long | size, | |||
| const unsigned char | data[], | |||
| unsigned long | len | |||
| ) |
Definition at line 536 of file sha2.cpp.
References SHA2_BAD, sha2_begin(), sha2_end(), SHA2_GOOD, and sha2_hash().
Referenced by vmsHash::Hash_SHA2().
| void sha256 | ( | unsigned char | hval[], | |
| const unsigned char | data[], | |||
| unsigned long | len | |||
| ) |
Definition at line 252 of file sha2.cpp.
References sha256_begin(), sha256_end(), and sha256_hash().
| void sha256_begin | ( | sha256_ctx | ctx[1] | ) |
Definition at line 157 of file sha2.cpp.
References sha256_ctx::count, sha256_ctx::hash, and i256.
Referenced by sha256().
| void sha256_compile | ( | sha256_ctx | ctx[1] | ) |
Definition at line 163 of file sha2.cpp.
References h2_cycle, and sha256_ctx::hash.
Referenced by sha256_end(), and sha256_hash().
| void sha256_end | ( | unsigned char | hval[], | |
| sha256_ctx | ctx[1] | |||
| ) |
Definition at line 209 of file sha2.cpp.
References b1, bsw_32, sha256_ctx::count, sha256_ctx::hash, m1, SHA256_BLOCK_SIZE, sha256_compile(), SHA256_DIGEST_SIZE, SHA256_MASK, and sha256_ctx::wbuf.
Referenced by sha256(), and sha2_end().
| void sha256_hash | ( | const unsigned char | data[], | |
| unsigned long | len, | |||
| sha256_ctx | ctx[1] | |||
| ) |
Definition at line 180 of file sha2.cpp.
References bsw_32, sha256_ctx::count, pos(), SHA256_BLOCK_SIZE, sha256_compile(), SHA256_MASK, and sha256_ctx::wbuf.
Referenced by sha256(), and sha2_hash().
| int sha2_begin | ( | unsigned long | size, | |
| sha2_ctx | ctx[1] | |||
| ) |
| void sha2_end | ( | unsigned char | hval[], | |
| sha2_ctx | ctx[1] | |||
| ) |
Definition at line 526 of file sha2.cpp.
References CTX_256, CTX_384, CTX_512, sha256_end(), sha2_ctx::sha2_len, SHA384_DIGEST_SIZE, SHA512_DIGEST_SIZE, and sha_end().
Referenced by vmsHash::Hash_SHA2(), and sha2().
| void sha2_hash | ( | const unsigned char | data[], | |
| unsigned long | len, | |||
| sha2_ctx | ctx[1] | |||
| ) |
Definition at line 516 of file sha2.cpp.
References CTX_256, CTX_384, CTX_512, sha256_hash(), sha2_ctx::sha2_len, sha384_hash, and sha512_hash().
Referenced by vmsHash::Hash_SHA2(), and sha2().
| void sha384 | ( | unsigned char | hval[], | |
| const unsigned char | data[], | |||
| unsigned long | len | |||
| ) |
| void sha384_begin | ( | sha384_ctx | ctx[1] | ) |
Definition at line 443 of file sha2.cpp.
References sha512_ctx::count, sha512_ctx::hash, and i384.
Referenced by sha384().
| void sha384_end | ( | unsigned char | hval[], | |
| sha384_ctx | ctx[1] | |||
| ) |
Definition at line 449 of file sha2.cpp.
References SHA384_DIGEST_SIZE, and sha_end().
Referenced by sha384().
| void sha512 | ( | unsigned char | hval[], | |
| const unsigned char | data[], | |||
| unsigned long | len | |||
| ) |
Definition at line 483 of file sha2.cpp.
References sha512_begin(), sha512_end(), and sha512_hash().
| void sha512_begin | ( | sha512_ctx | ctx[1] | ) |
Definition at line 472 of file sha2.cpp.
References sha512_ctx::count, sha512_ctx::hash, and i512.
Referenced by sha512().
| void sha512_compile | ( | sha512_ctx | ctx[1] | ) |
Definition at line 334 of file sha2.cpp.
References h5_cycle, and sha512_ctx::hash.
Referenced by sha512_hash(), and sha_end().
| void sha512_end | ( | unsigned char | hval[], | |
| sha512_ctx | ctx[1] | |||
| ) |
Definition at line 478 of file sha2.cpp.
References SHA512_DIGEST_SIZE, and sha_end().
Referenced by sha512().
| void sha512_hash | ( | const unsigned char | data[], | |
| unsigned long | len, | |||
| sha512_ctx | ctx[1] | |||
| ) |
Definition at line 352 of file sha2.cpp.
References bsw_64, sha512_ctx::count, pos(), SHA512_BLOCK_SIZE, sha512_compile(), SHA512_MASK, and sha512_ctx::wbuf.
Referenced by sha2_hash(), and sha512().
1.5.6