Macros | |
#define | GET_UINT32(n, b, i) |
#define | PUT_UINT32(n, b, i) |
#define | SHR(x, n) (((x) & 0xFFFFFFFF) >> (n)) |
#define | ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n)))) |
#define | S0(x) (ROTR(x, 7) ^ ROTR(x, 18) ^ SHR(x, 3)) |
#define | S1(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ SHR(x, 10)) |
#define | S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22)) |
#define | S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25)) |
#define | F0(x, y, z) (((x) & (y)) | ((z) & ((x) | (y)))) |
#define | F1(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) |
#define | R(t) (W[t] = S1(W[(t) - 2]) + W[(t) - 7] + S0(W[(t) - 15]) + W[(t) - 16]) |
#define | P(a, b, c, d, e, f, g, h, x, K) |
#define | SHA_STEP 2 |
Functions | |
void | sha256_start (context_sha256_T *ctx) |
void | sha256_update (context_sha256_T *ctx, const char_u *input, size_t length) |
void | sha256_finish (context_sha256_T *ctx, char_u digest[SHA256_SUM_SIZE]) |
const char * | sha256_bytes (const uint8_t *restrict buf, size_t buf_len, const uint8_t *restrict salt, size_t salt_len) |
bool | sha256_self_test (void) |
FIPS-180-2 compliant SHA-256 implementation GPL by Christophe Devine, applies to older version. Modified for md5deep, in public domain. Modified For Vim, Mohsin Ahmed, http://www.cs.albany.edu/~mosh Mohsin Ahmed states this work is distributed under the VIM License or GPL, at your choice.
Vim specific notes: sha256_self_test() is implicitly called once.
#define F0 | ( | x, | |
y, | |||
z | |||
) | (((x) & (y)) | ((z) & ((x) | (y)))) |
#define F1 | ( | x, | |
y, | |||
z | |||
) | ((z) ^ ((x) & ((y) ^ (z)))) |
#define P | ( | a, | |
b, | |||
c, | |||
d, | |||
e, | |||
f, | |||
g, | |||
h, | |||
x, | |||
K | |||
) |
#define SHA_STEP 2 |
const char* sha256_bytes | ( | const uint8_t *restrict | buf, |
size_t | buf_len, | ||
const uint8_t *restrict | salt, | ||
size_t | salt_len | ||
) |
Gets the hex digest of the buffer.
buf | |
buf_len | |
salt | |
salt_len |
void sha256_finish | ( | context_sha256_T * | ctx, |
char_u | digest[SHA256_SUM_SIZE] | ||
) |
Perform a test on the SHA256 algorithm.
void sha256_start | ( | context_sha256_T * | ctx | ) |
void sha256_update | ( | context_sha256_T * | ctx, |
const char_u * | input, | ||
size_t | length | ||
) |