#include "Util/sha1.H"
#include <string.h>
Go to the source code of this file.
Defines | |
#define | GET_UINT32(n, b, i) |
#define | PUT_UINT32(n, b, i) |
#define | S(x, n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n))) |
#define | R(t) |
#define | P(a, b, c, d, e, x) |
#define | F(x, y, z) (z ^ (x & (y ^ z))) |
#define | K 0x5A827999 |
#define | F(x, y, z) (x ^ y ^ z) |
#define | K 0x6ED9EBA1 |
#define | F(x, y, z) ((x & y) | (z & (x | y))) |
#define | K 0x8F1BBCDC |
#define | F(x, y, z) (x ^ y ^ z) |
#define | K 0xCA62C1D6 |
Typedefs | |
typedef byte | uint8 |
Functions | |
void | sha1_starts (sha1_context *ctx) |
void | sha1_process (sha1_context *ctx, const uint8 data[64]) |
void | sha1_update (sha1_context *ctx, const uint8 *input, uint32 length) |
void | sha1_finish (sha1_context *ctx, uint8 digest[20]) |
Variables | |
static uint8 | sha1_padding [64] |
general sha1 (160-bit) message-digest implementation
Definition in file sha1.C.
#define GET_UINT32 | ( | n, | |||
b, | |||||
i | ) |
#define P | ( | a, | |||
b, | |||||
c, | |||||
d, | |||||
e, | |||||
x | ) |
{ \ e += S(a,5) + F(b,c,d) + K + x; b = S(b,30); \ }
#define PUT_UINT32 | ( | n, | |||
b, | |||||
i | ) |
#define R | ( | t | ) |
( \ temp = W[(t - 3) & 0x0F] ^ W[(t - 8) & 0x0F] ^ \ W[(t - 14) & 0x0F] ^ W[ t & 0x0F], \ ( W[t & 0x0F] = S(temp,1) ) \ )