Changeset View
Changeset View
Standalone View
Standalone View
contrib/ldns/ldns/sha1.h
#ifndef LDNS_SHA1_H | #ifndef LDNS_SHA1_H | ||||
#define LDNS_SHA1_H | #define LDNS_SHA1_H | ||||
#include <stdint.h> /* uint32_t and friends */ | |||||
#include <stddef.h> /* size_t and NULL */ | |||||
#if LDNS_BUILD_CONFIG_HAVE_INTTYPES_H | |||||
# include <inttypes.h> | |||||
#endif | |||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
extern "C" { | extern "C" { | ||||
#endif | #endif | ||||
#define LDNS_SHA1_BLOCK_LENGTH 64 | #define LDNS_SHA1_BLOCK_LENGTH 64 | ||||
#define LDNS_SHA1_DIGEST_LENGTH 20 | #define LDNS_SHA1_DIGEST_LENGTH 20 | ||||
typedef struct { | typedef struct { | ||||
Show All 12 Lines | |||||
* | * | ||||
* \param[in] data the data to digest | * \param[in] data the data to digest | ||||
* \param[in] data_len the length of data in bytes | * \param[in] data_len the length of data in bytes | ||||
* \param[out] digest the length of data in bytes | * \param[out] digest the length of data in bytes | ||||
* This pointer MUST have LDNS_SHA1_DIGEST_LENGTH bytes | * This pointer MUST have LDNS_SHA1_DIGEST_LENGTH bytes | ||||
* available | * available | ||||
* \return the SHA1 digest of the given data | * \return the SHA1 digest of the given data | ||||
*/ | */ | ||||
unsigned char *ldns_sha1(unsigned char *data, unsigned int data_len, unsigned char *digest); | unsigned char *ldns_sha1(const unsigned char *data, unsigned int data_len, unsigned char *digest); | ||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
} | } | ||||
#endif | #endif | ||||
#endif /* LDNS_SHA1_H */ | #endif /* LDNS_SHA1_H */ |