X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2FMD5.c;h=268e708ebd88554ebe4155c6c83602b2f0173fc6;hp=7107b40cbafdc59e09e5345110899a780c0c26c4;hb=6feed80959ad2c11f0427bf0e5a30aab8abd7083;hpb=c9d4eeb03932fcb193df379346314d6e8e3d7418 diff --git a/lib/MD5.c b/lib/MD5.c index 7107b40..268e708 100644 --- a/lib/MD5.c +++ b/lib/MD5.c @@ -30,6 +30,10 @@ * SUCH DAMAGE. */ +#include "../config.h" + +#include + #ifndef _NETINET6_MD5_H_ #define _NETINET6_MD5_H_ @@ -65,10 +69,10 @@ typedef struct { u_int8_t md5_buf[MD5_BUFLEN]; } md5_ctxt; -extern void md5_init(md5_ctxt *); -extern void md5_loop(md5_ctxt *, const u_int8_t *, u_int); -extern void md5_pad(md5_ctxt *); -extern void md5_result(u_int8_t *, md5_ctxt *); +static void md5_init(md5_ctxt *); +static void md5_loop(md5_ctxt *, const u_int8_t *, u_int); +static void md5_pad(md5_ctxt *); +static void md5_result(u_int8_t *, md5_ctxt *); /* compatibility */ #define MD5_CTX md5_ctxt @@ -118,13 +122,27 @@ do { \ * UNIX password */ +#ifndef HAVE_BCOPY +void bcopy(const void*src, void*dest, int len) +{ + memcpy(dest, src, len); +} +#endif + +#ifndef HAVE_BZERO +void bzero(void*mem, int len) +{ + memset(mem, 0, len); +} +#endif + #define MD4_SIZE 16 #define MD5_SIZE 16 static char itoa64[] = /* 0 ... 63 => ascii - 64 */ "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; -void +static void _crypt_to64(char *s, u_long v, int n) { while (--n >= 0) { @@ -366,7 +384,7 @@ static const u_int8_t md5_paddat[MD5_BUFLEN] = { static void md5_calc(u_int8_t *, md5_ctxt *); -void md5_init(ctxt) +static void md5_init(ctxt) md5_ctxt *ctxt; { ctxt->md5_n = 0; @@ -378,7 +396,7 @@ void md5_init(ctxt) bzero(ctxt->md5_buf, sizeof(ctxt->md5_buf)); } -void md5_loop(ctxt, input, len) +static void md5_loop(ctxt, input, len) md5_ctxt *ctxt; const u_int8_t *input; u_int len; /* number of bytes */ @@ -406,7 +424,7 @@ void md5_loop(ctxt, input, len) } } -void md5_pad(ctxt) +static void md5_pad(ctxt) md5_ctxt *ctxt; { u_int gap; @@ -445,7 +463,7 @@ void md5_pad(ctxt) md5_calc(ctxt->md5_buf, ctxt); } -void md5_result(digest, ctxt) +static void md5_result(digest, ctxt) u_int8_t *digest; md5_ctxt *ctxt; {