ldns documentation

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

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];
15 } ldns_sha1_ctx;
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 */
ldns_sha1_update
void ldns_sha1_update(ldns_sha1_ctx *context, const unsigned char *data, unsigned int len)
Definition: sha1.c:121
ldns_sha1_ctx::count
uint64_t count
Definition: sha1.h:13
ldns_sha1_ctx
Definition: sha1.h:11
ldns_sha1_transform
void ldns_sha1_transform(uint32_t state[5], const unsigned char buffer[64])
Definition: sha1.c:47
ldns_sha1_final
void ldns_sha1_final(unsigned char digest[20], ldns_sha1_ctx *context)
Definition: sha1.c:144
ldns_sha1
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
ldns_sha1_init
void ldns_sha1_init(ldns_sha1_ctx *context)
Definition: sha1.c:106
LDNS_SHA1_DIGEST_LENGTH
#define LDNS_SHA1_DIGEST_LENGTH
Definition: sha1.h:9
LDNS_SHA1_BLOCK_LENGTH
#define LDNS_SHA1_BLOCK_LENGTH
Definition: sha1.h:8