X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fsec%2Fhash%2Fmd5.c;h=306bacc029da9aa2fd84b1dadb71bced17d0b263;hb=f248bd5d8be37c741ef62386d82e4975723e09c3;hp=54413267e29a0f561936cf97786943561114240d;hpb=32a5cc64743e4667ae47f88525ee6d0162fcd4d0;p=bertos.git diff --git a/bertos/sec/hash/md5.c b/bertos/sec/hash/md5.c index 54413267..306bacc0 100644 --- a/bertos/sec/hash/md5.c +++ b/bertos/sec/hash/md5.c @@ -37,7 +37,7 @@ static void byteReverse(uint32_t *buf, unsigned longs) static void MD5_begin(Hash *h) { MD5_Context *ctx = (MD5_Context *)h; - + ctx->buf[0] = 0x67452301; ctx->buf[1] = 0xefcdab89; ctx->buf[2] = 0x98badcfe; @@ -94,7 +94,7 @@ static void MD5_update(Hash *h, const void* vbuf, size_t len) * Final wrapup - pad to 64-byte boundary with the bit pattern * 1 0* (64-bit count of bits processed, MSB-first) */ -uint8_t* MD5_final(struct Hash *h) +static uint8_t* MD5_final(struct Hash *h) { MD5_Context *ctx = (MD5_Context *)h; unsigned count; @@ -136,7 +136,7 @@ uint8_t* MD5_final(struct Hash *h) PURGE(ctx->in); PURGE(ctx->bits); - return ctx->buf; + return (uint8_t *)ctx->buf; } @@ -248,5 +248,5 @@ void MD5_init(MD5_Context *ctx) ctx->h.update = MD5_update; ctx->h.final = MD5_final; ctx->h.digest_len = 16; - ctx->h.block_len = 16; + ctx->h.block_len = 64; }