ldns  1.7.0
sha1.h
Go to the documentation of this file.
1 #ifndef LDNS_SHA1_H
2 #define LDNS_SHA1_H
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 #define LDNS_SHA1_BLOCK_LENGTH 64
9 #define LDNS_SHA1_DIGEST_LENGTH 20
10 
11 typedef struct {
12  uint32_t state[5];
13  uint64_t count;
14  unsigned char buffer[LDNS_SHA1_BLOCK_LENGTH];
16 
17 void ldns_sha1_init(ldns_sha1_ctx * context);
18 void ldns_sha1_transform(uint32_t state[5], const unsigned char buffer[LDNS_SHA1_BLOCK_LENGTH]);
19 void ldns_sha1_update(ldns_sha1_ctx *context, const unsigned char *data, unsigned int len);
20 void ldns_sha1_final(unsigned char digest[LDNS_SHA1_DIGEST_LENGTH], ldns_sha1_ctx *context);
21 
32 unsigned char *ldns_sha1(unsigned char *data, unsigned int data_len, unsigned char *digest);
33 
34 #ifdef __cplusplus
35 }
36 #endif
37 
38 #endif /* LDNS_SHA1_H */
void ldns_sha1_update(ldns_sha1_ctx *context, const unsigned char *data, unsigned int len)
Definition: sha1.c:121
uint64_t count
Definition: sha1.h:13
void ldns_sha1_transform(uint32_t state[5], const unsigned char buffer[64])
Definition: sha1.c:47
void ldns_sha1_final(unsigned char digest[20], ldns_sha1_ctx *context)
Definition: sha1.c:144
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.
Definition: sha1.c:170
void ldns_sha1_init(ldns_sha1_ctx *context)
Definition: sha1.c:106
#define LDNS_SHA1_DIGEST_LENGTH
Definition: sha1.h:9
#define LDNS_SHA1_BLOCK_LENGTH
Definition: sha1.h:8