#include <stdio.h>#include <string.h>#include "common/h/Types.h"#include "common/h/sha1.h"Go to the source code of this file.
Data Structures | |
| struct | SHA1_CTX |
Defines | |
| #define | rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) |
| #define | blk0(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); |
Functions | |
| void | SHA1Transform (uint32_t state[5], unsigned char buffer[64]) |
| void | SHA1Init (SHA1_CTX *context) |
| void | SHA1Update (SHA1_CTX *context, unsigned char *data, uint32_t len) |
| void | SHA1Final (unsigned char digest[20], SHA1_CTX *context) |
| char * | sha1_file (const char *filename, char *result_ptr) |
| #define blk | ( | i | ) |
| #define blk0 | ( | i | ) |
| #define R0 | ( | v, | |||
| w, | |||||
| x, | |||||
| y, | |||||
| z, | |||||
| i | ) | z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30); |
Definition at line 136 of file sha1.C.
Referenced by SHA1Transform().
| #define R1 | ( | v, | |||
| w, | |||||
| x, | |||||
| y, | |||||
| z, | |||||
| i | ) | z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30); |
Definition at line 137 of file sha1.C.
Referenced by SHA1Transform().
| #define R2 | ( | v, | |||
| w, | |||||
| x, | |||||
| y, | |||||
| z, | |||||
| i | ) | z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30); |
Definition at line 138 of file sha1.C.
Referenced by SHA1Transform().
| #define R3 | ( | v, | |||
| w, | |||||
| x, | |||||
| y, | |||||
| z, | |||||
| i | ) | z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30); |
Definition at line 139 of file sha1.C.
Referenced by SHA1Transform().
| #define R4 | ( | v, | |||
| w, | |||||
| x, | |||||
| y, | |||||
| z, | |||||
| i | ) | z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); |
Definition at line 140 of file sha1.C.
Referenced by SHA1Transform().
| #define rol | ( | value, | |||
| bits | ) | (((value) << (bits)) | ((value) >> (32 - (bits)))) |
| char* sha1_file | ( | const char * | filename, | |
| char * | result_ptr | |||
| ) |
Definition at line 286 of file sha1.C.
References SHA1_DIGEST_LEN, SHA1_STRING_LEN, SHA1Final(), SHA1Init(), and SHA1Update().
Referenced by Dyninst::SerDesBin::writeHeaderPreamble().
| void SHA1Final | ( | unsigned char | digest[20], | |
| SHA1_CTX * | context | |||
| ) |
Definition at line 255 of file sha1.C.
References SHA1_CTX::buffer, SHA1_CTX::count, SHA1Transform(), SHA1Update(), and SHA1_CTX::state.
Referenced by sha1_file().
| void SHA1Init | ( | SHA1_CTX * | context | ) |
Definition at line 213 of file sha1.C.
References SHA1_CTX::count, and SHA1_CTX::state.
Referenced by sha1_file().
| void SHA1Transform | ( | uint32_t | state[5], | |
| unsigned char | buffer[64] | |||
| ) |
Definition at line 158 of file sha1.C.
References R0, R1, R2, R3, and R4.
Referenced by SHA1Final(), and SHA1Update().
Definition at line 227 of file sha1.C.
References SHA1_CTX::buffer, SHA1_CTX::count, SHA1Transform(), and SHA1_CTX::state.
Referenced by sha1_file(), and SHA1Final().
1.6.1