8 #define LDNS_SHA1_BLOCK_LENGTH 64
9 #define LDNS_SHA1_DIGEST_LENGTH 20
14 unsigned char buffer[LDNS_SHA1_BLOCK_LENGTH];
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);
23 * Convenience function to digest a fixed block of data at once.
25 * \param[in] data the data to digest
26 * \param[in] data_len the length of data in bytes
27 * \param[out] digest the length of data in bytes
28 * This pointer MUST have LDNS_SHA1_DIGEST_LENGTH bytes
30 * \return the SHA1 digest of the given data
32 unsigned char *ldns_sha1(unsigned char *data, unsigned int data_len, unsigned char *digest);
38 #endif /* LDNS_SHA1_H */