Main Page
Related Pages
Data Structures
Files
File List
Globals
ldns
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 */
Generated on Thu Jan 10 2013 15:51:27 for ldns by
1.8.1.1