Strophe
0.9
XMPP client library
|
SHA-1 hash. More...
Macros | |
#define | SHA1HANDSOFF |
#define | rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) |
#define | blk0(i) (block->l[i] = host_to_be(block->l[i])) |
#define | blk(i) |
#define | R0(v, w, x, y, z, i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30); |
#define | R1(v, w, x, y, z, i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30); |
#define | R2(v, w, x, y, z, i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30); |
#define | R3(v, w, x, y, z, i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30); |
#define | R4(v, w, x, y, z, i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); |
#define | le_to_be(i) ((rol((i),24) & 0xFF00FF00) | (rol((i),8) & 0x00FF00FF)) |
Functions | |
static uint32_t | host_to_be (uint32_t i) |
static void | SHA1_Transform (uint32_t state[5], const uint8_t buffer[64]) |
void | crypto_SHA1_Init (SHA1_CTX *context) |
void | crypto_SHA1_Update (SHA1_CTX *context, const uint8_t *data, const size_t len) |
void | crypto_SHA1_Final (SHA1_CTX *context, uint8_t *digest) |
void | crypto_SHA1 (const uint8_t *data, size_t len, uint8_t *digest) |
SHA-1 hash.
#define SHA1HANDSOFF |
#define rol | ( | value, | |
bits | |||
) | (((value) << (bits)) | ((value) >> (32 - (bits)))) |
#define blk0 | ( | i | ) | (block->l[i] = host_to_be(block->l[i])) |
#define blk | ( | i | ) |
#define R0 | ( | v, | |
w, | |||
x, | |||
y, | |||
z, | |||
i | |||
) | z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30); |
#define R1 | ( | v, | |
w, | |||
x, | |||
y, | |||
z, | |||
i | |||
) | z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30); |
#define R2 | ( | v, | |
w, | |||
x, | |||
y, | |||
z, | |||
i | |||
) | z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30); |
#define R3 | ( | v, | |
w, | |||
x, | |||
y, | |||
z, | |||
i | |||
) | z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30); |
#define R4 | ( | v, | |
w, | |||
x, | |||
y, | |||
z, | |||
i | |||
) | z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); |
#define le_to_be | ( | i | ) | ((rol((i),24) & 0xFF00FF00) | (rol((i),8) & 0x00FF00FF)) |
|
static |
|
static |
void crypto_SHA1_Init | ( | SHA1_CTX * | context | ) |
void crypto_SHA1_Update | ( | SHA1_CTX * | context, |
const uint8_t * | data, | ||
const size_t | len | ||
) |
void crypto_SHA1_Final | ( | SHA1_CTX * | context, |
uint8_t * | digest | ||
) |
void crypto_SHA1 | ( | const uint8_t * | data, |
size_t | len, | ||
uint8_t * | digest | ||
) |