diff --git a/src/sha1.c b/src/sha1.c index ec4cb6c..9c0ea9c 100644 --- a/src/sha1.c +++ b/src/sha1.c @@ -102,7 +102,7 @@ A million repetitions of "a" #include "sha1.h" -void SHA1_Transform(uint32_t state[5], const uint8_t buffer[64]); +static void SHA1_Transform(uint32_t state[5], const uint8_t buffer[64]); #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) @@ -140,7 +140,7 @@ void SHAPrintContext(SHA1_CTX *context, char *msg){ #endif /* VERBOSE */ /* Hash a single 512-bit block. This is the core of the algorithm. */ -void SHA1_Transform(uint32_t state[5], const uint8_t buffer[64]) +static void SHA1_Transform(uint32_t state[5], const uint8_t buffer[64]) { uint32_t a, b, c, d, e; typedef union { diff --git a/src/sha1.h b/src/sha1.h index b637f66..349e851 100644 --- a/src/sha1.h +++ b/src/sha1.h @@ -20,6 +20,11 @@ typedef struct { #define SHA1_DIGEST_SIZE 20 +/* prevent name collisions with libcrypto */ +#define SHA1_Init xmpp_SHA1_Init +#define SHA1_Update xmpp_SHA1_Update +#define SHA1_Final xmpp_SHA1_Final + void SHA1_Init(SHA1_CTX* context); void SHA1_Update(SHA1_CTX* context, const uint8_t* data, const size_t len); void SHA1_Final(SHA1_CTX* context, uint8_t digest[SHA1_DIGEST_SIZE]);