#include "sha1.h"
#include <string.h>
Go to the source code of this file.
|
| #define | BCOUNT (ctxt->c.b64[0] / 8) |
| |
| #define | COUNT (ctxt->count) |
| |
| #define | F0(b, c, d) (((b) & (c)) | ((~(b)) & (d))) |
| |
| #define | F1(b, c, d) (((b) ^ (c)) ^ (d)) |
| |
| #define | F2(b, c, d) (((b) & (c)) | ((b) & (d)) | ((c) & (d))) |
| |
| #define | F3(b, c, d) (((b) ^ (c)) ^ (d)) |
| |
| #define | H(n) (ctxt->h.b32[(n)]) |
| |
| #define | K(t) _K[(t) / 20] |
| |
| #define | PUTBYTE(x) |
| |
| #define | PUTPAD(x) |
| |
| #define | S(n, x) (((x) << (n)) | ((x) >> (32 - (n)))) |
| |
| #define | W(n) (ctxt->m.b32[(n)]) |
| |
|
| static uint32_t | _K [] = {0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6} |
| |
◆ BCOUNT
| #define BCOUNT (ctxt->c.b64[0] / 8) |
◆ COUNT
| #define COUNT (ctxt->count) |
◆ F0
| #define F0 |
( |
|
b, |
|
|
|
c, |
|
|
|
d |
|
) |
| (((b) & (c)) | ((~(b)) & (d))) |
◆ F1
| #define F1 |
( |
|
b, |
|
|
|
c, |
|
|
|
d |
|
) |
| (((b) ^ (c)) ^ (d)) |
◆ F2
| #define F2 |
( |
|
b, |
|
|
|
c, |
|
|
|
d |
|
) |
| (((b) & (c)) | ((b) & (d)) | ((c) & (d))) |
◆ F3
| #define F3 |
( |
|
b, |
|
|
|
c, |
|
|
|
d |
|
) |
| (((b) ^ (c)) ^ (d)) |
| #define H |
( |
|
n | ) |
(ctxt->h.b32[(n)]) |
| #define K |
( |
|
t | ) |
_K[(t) / 20] |
◆ PUTBYTE
Value:do { \
ctxt->m.b8[(
COUNT % 64)] = (
x); \
COUNT++; \
COUNT %= 64; \
ctxt->c.b64[0] += 8; \
sha1_step(ctxt); \
} while (0)
Definition at line 57 of file sha1.c.
◆ PUTPAD
Value:do { \
ctxt->m.b8[(
COUNT % 64)] = (
x); \
COUNT++; \
COUNT %= 64; \
sha1_step(ctxt); \
} while (0)
Definition at line 67 of file sha1.c.
| #define S |
( |
|
n, |
|
|
|
x |
|
) |
| (((x) << (n)) | ((x) >> (32 - (n)))) |
| #define W |
( |
|
n | ) |
(ctxt->m.b32[(n)]) |
◆ sha1_init()
◆ sha1_loop()
| void sha1_loop |
( |
struct sha1_ctxt * |
ctxt, |
|
|
const uint8_t * |
input0, |
|
|
size_t |
len |
|
) |
| |
◆ sha1_pad()
◆ sha1_result()
◆ sha1_step()
◆ _K
| uint32_t _K[] = {0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6} |
|
static |