From: rasky Date: Fri, 24 Sep 2010 13:55:50 +0000 (+0000) Subject: SEC: Fix digest len and block len reported by algorithms. X-Git-Tag: 2.6.0~101 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=e047735b66c85a80cd1e46edc15083faff960603;p=bertos.git SEC: Fix digest len and block len reported by algorithms. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4300 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/sec/hash/md5.c b/bertos/sec/hash/md5.c index 54413267..f139cd6e 100644 --- a/bertos/sec/hash/md5.c +++ b/bertos/sec/hash/md5.c @@ -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; } diff --git a/bertos/sec/hash/sha1.c b/bertos/sec/hash/sha1.c index 0f0aba50..6f195a5b 100644 --- a/bertos/sec/hash/sha1.c +++ b/bertos/sec/hash/sha1.c @@ -54,8 +54,8 @@ #include #include -#define SHA1_BLOCK_LEN 16 -#define SHA1_DIGEST_LEN 16 +#define SHA1_BLOCK_LEN 64 +#define SHA1_DIGEST_LEN 20 static void SHA1Transform(uint32_t state[5], const uint8_t buffer[64]);