diff options
author | Jan200101 <sentrycraft123@gmail.com> | 2022-06-16 22:43:56 +0200 |
---|---|---|
committer | Jan200101 <sentrycraft123@gmail.com> | 2022-06-16 22:43:56 +0200 |
commit | 10bed2d13e6d670f4ed0f18e564f1e6790f2d812 (patch) | |
tree | 1f702032b39c6c854d6d8977b8d04d34e6e18f85 /src/hash | |
parent | e249a716e8c2d53ea843cf66ffcee75f184c0b6d (diff) | |
download | OFQT-10bed2d13e6d670f4ed0f18e564f1e6790f2d812.tar.gz OFQT-10bed2d13e6d670f4ed0f18e564f1e6790f2d812.zip |
Change MD5 function signatures, make libtvn static, not object
this solves a problem on x86_64 Windows where the MD5 functions
were included within ntdll.
STATIC libraries have better defined behavior than static ones,
and we do not compile the same thing multiple times since we use
it as a libary.
Diffstat (limited to 'src/hash')
-rw-r--r-- | src/hash/md5/md5.h | 8 | ||||
-rw-r--r-- | src/hash/md5/md5c.c | 20 |
2 files changed, 15 insertions, 13 deletions
diff --git a/src/hash/md5/md5.h b/src/hash/md5/md5.h index 11b3ddd..d41b8fb 100644 --- a/src/hash/md5/md5.h +++ b/src/hash/md5/md5.h @@ -21,6 +21,8 @@ without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. + +Functions signatures changed as to not conflict with other libraries */ #include "global.h" @@ -32,7 +34,7 @@ typedef struct { unsigned char buffer[64]; /* input buffer */ } MD5_CTX; -void MD5Init PROTO_LIST ((MD5_CTX *)); -void MD5Update PROTO_LIST +void MD5_Init PROTO_LIST ((MD5_CTX *)); +void MD5_Update PROTO_LIST ((MD5_CTX *, unsigned char *, unsigned int)); -void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *)); +void MD5_Final PROTO_LIST ((unsigned char [16], MD5_CTX *)); diff --git a/src/hash/md5/md5c.c b/src/hash/md5/md5c.c index 3682361..a102cb9 100644 --- a/src/hash/md5/md5c.c +++ b/src/hash/md5/md5c.c @@ -26,7 +26,7 @@ documentation and/or software. #include "global.h" #include "md5.h" -/* Constants for MD5Transform routine. +/* Constants for MD5_Transform routine. */ #define S11 7 #define S12 12 @@ -45,7 +45,7 @@ documentation and/or software. #define S43 15 #define S44 21 -static void MD5Transform PROTO_LIST ((UINT4 [4], unsigned char [64])); +static void MD5_Transform PROTO_LIST ((UINT4 [4], unsigned char [64])); static void Encode PROTO_LIST ((unsigned char *, UINT4 *, unsigned int)); static void Decode PROTO_LIST @@ -96,7 +96,7 @@ Rotation is separate from addition to prevent recomputation. /* MD5 initialization. Begins an MD5 operation, writing a new context. */ -void MD5Init (context) +void MD5_Init (context) MD5_CTX *context; /* context */ { context->count[0] = context->count[1] = 0; @@ -112,7 +112,7 @@ MD5_CTX *context; /* context */ operation, processing another message block, and updating the context. */ -void MD5Update (context, input, inputLen) +void MD5_Update (context, input, inputLen) MD5_CTX *context; /* context */ unsigned char *input; /* input block */ unsigned int inputLen; /* length of input block */ @@ -135,10 +135,10 @@ unsigned int inputLen; /* length of input block */ if (inputLen >= partLen) { MD5_memcpy ((POINTER)&context->buffer[index], (POINTER)input, partLen); - MD5Transform (context->state, context->buffer); + MD5_Transform (context->state, context->buffer); for (i = partLen; i + 63 < inputLen; i += 64) - MD5Transform (context->state, &input[i]); + MD5_Transform (context->state, &input[i]); index = 0; } @@ -154,7 +154,7 @@ unsigned int inputLen; /* length of input block */ /* MD5 finalization. Ends an MD5 message-digest operation, writing the the message digest and zeroizing the context. */ -void MD5Final (digest, context) +void MD5_Final (digest, context) unsigned char digest[16]; /* message digest */ MD5_CTX *context; /* context */ { @@ -168,10 +168,10 @@ MD5_CTX *context; /* context */ */ index = (unsigned int)((context->count[0] >> 3) & 0x3f); padLen = (index < 56) ? (56 - index) : (120 - index); - MD5Update (context, PADDING, padLen); + MD5_Update (context, PADDING, padLen); /* Append length (before padding) */ - MD5Update (context, bits, 8); + MD5_Update (context, bits, 8); /* Store state in digest */ Encode (digest, context->state, 16); @@ -183,7 +183,7 @@ MD5_CTX *context; /* context */ /* MD5 basic transformation. Transforms state based on block. */ -static void MD5Transform (state, block) +static void MD5_Transform (state, block) UINT4 state[4]; unsigned char block[64]; { |