Mana
|
Go to the source code of this file.
Classes | |
class | SHA256Context |
An sha 256 context, used by original m_opersha256. More... | |
Macros | |
#define | SHA256_BLOCK_SIZE (512 / 8) |
#define | SHA256_DIGEST_SIZE (256 / 8) |
#define | SHFR(x, n) (x >> n) |
#define | ROTR(x, n) ((x >> n) | (x << ((sizeof(x) << 3) - n))) |
#define | ROTL(x, n) ((x << n) | (x >> ((sizeof(x) << 3) - n))) |
#define | CH(x, y, z) ((x & y) ^ (~x & z)) |
#define | MAJ(x, y, z) ((x & y) ^ (x & z) ^ (y & z)) |
#define | SHA256_F1(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22)) |
#define | SHA256_F2(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25)) |
#define | SHA256_F3(x) (ROTR(x, 7) ^ ROTR(x, 18) ^ SHFR(x, 3)) |
#define | SHA256_F4(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ SHFR(x, 10)) |
#define | UNPACK32(x, str) |
#define | PACK32(str, x) |
#define | SHA256_SCR(i) |
Typedefs | |
using | uint8_t = unsigned char |
using | uint32_t = unsigned int |
Functions | |
void | SHA256Init (SHA256Context *ctx) |
void | SHA256Transform (SHA256Context *ctx, unsigned char *message, unsigned int block_nb) |
void | SHA256Update (SHA256Context *ctx, unsigned char *message, unsigned int len) |
void | SHA256Final (SHA256Context *ctx, unsigned char *digest) |
std::string | SHA256Hash (const char *src, int len) |
std::string | sha256 (const std::string &string) |
Returns the SHA-256 hash for the given string. | |
Variables | |
const unsigned int | sha256_h0 [8] |
uint32_t | sha256_k [64] |
#define CH | ( | x, | |
y, | |||
z | |||
) | ((x & y) ^ (~x & z)) |
Definition at line 102 of file sha256.cpp.
#define MAJ | ( | x, | |
y, | |||
z | |||
) | ((x & y) ^ (x & z) ^ (y & z)) |
Definition at line 103 of file sha256.cpp.
#define PACK32 | ( | str, | |
x | |||
) |
#define ROTL | ( | x, | |
n | |||
) | ((x << n) | (x >> ((sizeof(x) << 3) - n))) |
Definition at line 101 of file sha256.cpp.
#define ROTR | ( | x, | |
n | |||
) | ((x >> n) | (x << ((sizeof(x) << 3) - n))) |
Definition at line 100 of file sha256.cpp.
#define SHA256_BLOCK_SIZE (512 / 8) |
Definition at line 85 of file sha256.cpp.
#define SHA256_DIGEST_SIZE (256 / 8) |
Definition at line 97 of file sha256.cpp.
Definition at line 105 of file sha256.cpp.
Definition at line 106 of file sha256.cpp.
Definition at line 107 of file sha256.cpp.
Definition at line 108 of file sha256.cpp.
#define SHA256_SCR | ( | i | ) |
Definition at line 128 of file sha256.cpp.
#define SHFR | ( | x, | |
n | |||
) | (x >> n) |
Definition at line 99 of file sha256.cpp.
#define UNPACK32 | ( | x, | |
str | |||
) |
using uint32_t = unsigned int |
Definition at line 82 of file sha256.cpp.
using uint8_t = unsigned char |
Definition at line 81 of file sha256.cpp.
std::string sha256 | ( | const std::string & | string | ) |
Returns the SHA-256 hash for the given string.
string | the string to create the SHA-256 hash for |
Definition at line 276 of file sha256.cpp.
void SHA256Final | ( | SHA256Context * | ctx, |
unsigned char * | digest | ||
) |
Definition at line 244 of file sha256.cpp.
std::string SHA256Hash | ( | const char * | src, |
int | len | ||
) |
Definition at line 257 of file sha256.cpp.
void SHA256Init | ( | SHA256Context * | ctx | ) |
Definition at line 160 of file sha256.cpp.
void SHA256Transform | ( | SHA256Context * | ctx, |
unsigned char * | message, | ||
unsigned int | block_nb | ||
) |
Definition at line 168 of file sha256.cpp.
void SHA256Update | ( | SHA256Context * | ctx, |
unsigned char * | message, | ||
unsigned int | len | ||
) |
Definition at line 204 of file sha256.cpp.
const unsigned int sha256_h0[8] |
Definition at line 134 of file sha256.cpp.
uint32_t sha256_k[64] |
Definition at line 140 of file sha256.cpp.