Go to the source code of this file.
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 | ldns_sha1_transform (uint32_t state[5], const unsigned char buffer[LDNS_SHA1_BLOCK_LENGTH]) |
| void | ldns_sha1_init (ldns_sha1_ctx *context) |
| void | ldns_sha1_update (ldns_sha1_ctx *context, const unsigned char *data, unsigned int len) |
| void | ldns_sha1_final (unsigned char digest[LDNS_SHA1_DIGEST_LENGTH], ldns_sha1_ctx *context) |
| unsigned char * | ldns_sha1 (unsigned char *data, unsigned int data_len, unsigned char *digest) |
| Convenience function to digest a fixed block of data at once. | |
| #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); |
| void ldns_sha1_transform | ( | uint32_t | state[5], | |
| const unsigned char | buffer[LDNS_SHA1_BLOCK_LENGTH] | |||
| ) |
| void ldns_sha1_init | ( | ldns_sha1_ctx * | context | ) |
Definition at line 106 of file sha1.c.
References ldns_sha1_ctx::count, and ldns_sha1_ctx::state.
| void ldns_sha1_update | ( | ldns_sha1_ctx * | context, | |
| const unsigned char * | data, | |||
| unsigned int | len | |||
| ) |
Definition at line 121 of file sha1.c.
References ldns_sha1_ctx::buffer, ldns_sha1_ctx::count, ldns_sha1_transform(), and ldns_sha1_ctx::state.
| void ldns_sha1_final | ( | unsigned char | digest[LDNS_SHA1_DIGEST_LENGTH], | |
| ldns_sha1_ctx * | context | |||
| ) |
Definition at line 144 of file sha1.c.
References ldns_sha1_ctx::buffer, ldns_sha1_ctx::count, ldns_sha1_transform(), ldns_sha1_update(), and ldns_sha1_ctx::state.
| unsigned char* ldns_sha1 | ( | unsigned char * | data, | |
| unsigned int | data_len, | |||
| unsigned char * | digest | |||
| ) |
Convenience function to digest a fixed block of data at once.
| [in] | data | the data to digest |
| [in] | data_len | the length of data in bytes |
| [out] | digest | the length of data in bytes This pointer MUST have LDNS_SHA1_DIGEST_LENGTH bytes available |
Definition at line 170 of file sha1.c.
References ldns_sha1_final(), ldns_sha1_init(), and ldns_sha1_update().
1.6.1