From 140c214ad04a51dab937cda1fe1ea4b9d60fb86d Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 2 Mar 2016 10:54:24 -0800 Subject: md5: use "compiler.h", WORDS_LITTLEENDIAN and make functions static Look for WORDS_LITTLEENDIAN instead of the gcc-specific __BYTE_ORDER. Use our existing "compiler.h" portability layer. Make functions which are not exported static. Signed-off-by: H. Peter Anvin --- md5.h | 9 ++++----- md5c.c | 8 ++++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/md5.h b/md5.h index ea34cda1..fb6ac607 100644 --- a/md5.h +++ b/md5.h @@ -1,6 +1,7 @@ -#ifndef _MD5_H_ -#define _MD5_H_ +#ifndef MD5_H +#define MD5_H +#include "compiler.h" #include #define MD5_HASHBYTES 16 @@ -17,7 +18,5 @@ extern void MD5Update(MD5_CTX *context, unsigned char const *buf, extern void MD5Final(unsigned char digest[MD5_HASHBYTES], MD5_CTX *context); extern void MD5Transform(uint32_t buf[4], uint32_t const in[16]); extern char * MD5End(MD5_CTX *, char *); -extern char * MD5File(const char *, char *); -extern char * MD5Data (const unsigned char *, unsigned int, char *); -#endif /* !_MD5_H_ */ +#endif /* !MD5_H */ diff --git a/md5c.c b/md5c.c index 27162327..5d5c91a3 100644 --- a/md5c.c +++ b/md5c.c @@ -15,18 +15,18 @@ * will fill a supplied 16-byte array with the digest. */ -#include /* for memcpy() */ #include "md5.h" +#include /* for memcpy() */ -#if __BYTE_ORDER == 1234 +#ifdef WORDS_LITTEENDIAN #define byteReverse(buf, len) /* Nothing */ #else -void byteReverse(unsigned char *buf, unsigned longs); +static void byteReverse(unsigned char *buf, unsigned longs); /* * Note: this code is harmless on little-endian machines. */ -void byteReverse(unsigned char *buf, unsigned longs) +static void byteReverse(unsigned char *buf, unsigned longs) { uint32_t t; do { -- cgit v1.2.1