From e047735b66c85a80cd1e46edc15083faff960603 Mon Sep 17 00:00:00 2001 From: rasky Date: Fri, 24 Sep 2010 13:55:50 +0000 Subject: [PATCH] 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 --- bertos/sec/hash/md5.c | 2 +- bertos/sec/hash/sha1.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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]); -- 2.25.1