sha1.h File Reference

Go to the source code of this file.

Data Structures

struct  ldns_sha1_ctx




void ldns_sha1_init (ldns_sha1_ctx *context)
void ldns_sha1_transform (uint32_t state[5], const unsigned char buffer[64])
void ldns_sha1_update (ldns_sha1_ctx *context, const unsigned char *data, unsigned int len)
void ldns_sha1_final (unsigned char digest[20], 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. More...

Macro Definition Documentation


Definition at line 8 of file sha1.h.


Definition at line 9 of file sha1.h.

Function Documentation

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_transform ( uint32_t  state[5],
const unsigned char  buffer[64] 

Definition at line 47 of file sha1.c.

References LDNS_SHA1_BLOCK_LENGTH, R0, R1, R2, R3, and R4.

void ldns_sha1_update ( ldns_sha1_ctx context,
const unsigned char *  data,
unsigned int  len 
void ldns_sha1_final ( unsigned char  digest[20],
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.

[in]datathe data to digest
[in]data_lenthe length of data in bytes
[out]digestthe length of data in bytes This pointer MUST have LDNS_SHA1_DIGEST_LENGTH bytes available
the SHA1 digest of the given data

Definition at line 170 of file sha1.c.

References ldns_sha1_final(), ldns_sha1_init(), and ldns_sha1_update().