summaryrefslogtreecommitdiff
path: root/source4/lib/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/crypto')
-rw-r--r--source4/lib/crypto/md4.c8
-rw-r--r--source4/lib/crypto/md5.c12
2 files changed, 10 insertions, 10 deletions
diff --git a/source4/lib/crypto/md4.c b/source4/lib/crypto/md4.c
index cc8b9b6841..98fcabf224 100644
--- a/source4/lib/crypto/md4.c
+++ b/source4/lib/crypto/md4.c
@@ -107,7 +107,7 @@ static void mdfour64(struct mdfour_state *s, uint32_t *M)
X[j] = 0;
}
-static void copy64(uint32_t *M, const unsigned char *in)
+static void copy64(uint32_t *M, const uint8_t *in)
{
int i;
@@ -116,7 +116,7 @@ static void copy64(uint32_t *M, const unsigned char *in)
(in[i*4+1]<<8) | (in[i*4+0]<<0);
}
-static void copy4(unsigned char *out, uint32_t x)
+static void copy4(uint8_t *out, uint32_t x)
{
out[0] = x&0xFF;
out[1] = (x>>8)&0xFF;
@@ -125,9 +125,9 @@ static void copy4(unsigned char *out, uint32_t x)
}
/* produce a md4 message digest from data of length n bytes */
-void mdfour(unsigned char *out, const unsigned char *in, int n)
+void mdfour(uint8_t *out, const uint8_t *in, int n)
{
- unsigned char buf[128];
+ uint8_t buf[128];
uint32_t M[16];
uint32_t b = n * 8;
int i;
diff --git a/source4/lib/crypto/md5.c b/source4/lib/crypto/md5.c
index dbb3462bd4..a393fc2532 100644
--- a/source4/lib/crypto/md5.c
+++ b/source4/lib/crypto/md5.c
@@ -27,7 +27,7 @@ static void MD5Transform(uint32_t buf[4], uint32_t const in[16]);
/*
* Note: this code is harmless on little-endian machines.
*/
-static void byteReverse(unsigned char *buf, unsigned longs)
+static void byteReverse(uint8_t *buf, unsigned longs)
{
uint32_t t;
do {
@@ -57,7 +57,7 @@ void MD5Init(struct MD5Context *ctx)
* Update context to reflect the concatenation of another buffer full
* of bytes.
*/
-void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
+void MD5Update(struct MD5Context *ctx, uint8_t const *buf, unsigned len)
{
register uint32_t t;
@@ -73,7 +73,7 @@ void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
/* Handle any leading odd-sized chunks */
if (t) {
- unsigned char *p = (unsigned char *) ctx->in + t;
+ uint8_t *p = (uint8_t *) ctx->in + t;
t = 64 - t;
if (len < t) {
@@ -105,10 +105,10 @@ void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
* Final wrapup - pad to 64-byte boundary with the bit pattern
* 1 0* (64-bit count of bits processed, MSB-first)
*/
-void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
+void MD5Final(uint8_t digest[16], struct MD5Context *ctx)
{
unsigned int count;
- unsigned char *p;
+ uint8_t *p;
/* Compute number of bytes mod 64 */
count = (ctx->bits[0] >> 3) & 0x3F;
@@ -141,7 +141,7 @@ void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
((uint32_t *) ctx->in)[15] = ctx->bits[1];
MD5Transform(ctx->buf, (uint32_t *) ctx->in);
- byteReverse((unsigned char *) ctx->buf, 4);
+ byteReverse((uint8_t *) ctx->buf, 4);
memmove(digest, ctx->buf, 16);
memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
}