#include <string.h>
#include "sha1.h"
#include "byte.h"
Go to the source code of this file.
|
#define | rol(value, bits) |
#define | blk0(i) |
#define | blk(i) |
#define | R0(v, w, x, y, z, i) |
#define | R1(v, w, x, y, z, i) |
#define | R2(v, w, x, y, z, i) |
#define | R3(v, w, x, y, z, i) |
#define | R4(v, w, x, y, z, i) |
◆ blk
Value: (block->l[i&15] =
rol(block->l[(i+13)&15]^block->l[(i+8)&15] \
^block->l[(i+2)&15]^block->l[i&15],1))
Definition at line 35 of file sha1.c.
◆ blk0
Value: (block->l[i] = (
rol(block->l[i],24) & 0xFF00FF00) \
| (
rol(block->l[i],8) & 0x00FF00FF))
Definition at line 30 of file sha1.c.
◆ R0
#define R0 |
( |
| v, |
|
|
| w, |
|
|
| x, |
|
|
| y, |
|
|
| z, |
|
|
| i ) |
Value:z+=((w&(x^y))^y)+
blk0(i)+0x5A827999+
rol(v,5);w=
rol(w,30);
void z(char *, char *, int, int, int, int)
Definition at line 39 of file sha1.c.
◆ R1
#define R1 |
( |
| v, |
|
|
| w, |
|
|
| x, |
|
|
| y, |
|
|
| z, |
|
|
| i ) |
Value:z+=((w&(x^y))^y)+
blk(i)+0x5A827999+
rol(v,5);w=
rol(w,30);
Definition at line 40 of file sha1.c.
◆ R2
#define R2 |
( |
| v, |
|
|
| w, |
|
|
| x, |
|
|
| y, |
|
|
| z, |
|
|
| i ) |
Value:z+=(w^x^y)+
blk(i)+0x6ED9EBA1+
rol(v,5);w=
rol(w,30);
Definition at line 41 of file sha1.c.
◆ R3
#define R3 |
( |
| v, |
|
|
| w, |
|
|
| x, |
|
|
| y, |
|
|
| z, |
|
|
| i ) |
Value:z+=(((w|x)&y)|(w&x))+
blk(i)+0x8F1BBCDC+
rol(v,5);w=
rol(w,30);
Definition at line 42 of file sha1.c.
◆ R4
#define R4 |
( |
| v, |
|
|
| w, |
|
|
| x, |
|
|
| y, |
|
|
| z, |
|
|
| i ) |
Value:z+=(w^x^y)+
blk(i)+0xCA62C1D6+
rol(v,5);w=
rol(w,30);
Definition at line 43 of file sha1.c.
◆ rol
#define rol |
( |
| value, |
|
|
| bits ) |
Value:(((value) << (bits)) | ((value) >> (32 - (bits))))
Definition at line 24 of file sha1.c.
◆ sha1_final()
void sha1_final |
( |
uint8_t | digest[SHA1_DIGESTSIZE], |
|
|
sha1_ctx * | context ) |
◆ sha1_hash()
void sha1_hash |
( |
char * | hash, |
|
|
const char * | str, |
|
|
uint32_t | len ) |
◆ sha1_init()
◆ sha1_transform()
void sha1_transform |
( |
uint32_t | state[5], |
|
|
const uint8_t | buffer[SHA1_BLOCKSIZE] ) |
◆ sha1_update()
void sha1_update |
( |
sha1_ctx * | context, |
|
|
const uint8_t * | data, |
|
|
uint32_t | len ) |