Module Name:src
Committed By: joerg
Date: Sun Jun 14 14:18:35 UTC 2009
Modified Files:
src/crypto/dist/openssl/crypto/evp: m_sha1.c
Log Message:
Don't take short cuts and use the SHA224 functions to compute SHA224.
At least for Final it makes a difference in some situation.
To generate a diff of this commit:
cvs rdiff -u -r1.1.1.5 -r1.2 src/crypto/dist/openssl/crypto/evp/m_sha1.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/crypto/dist/openssl/crypto/evp/m_sha1.c
diff -u src/crypto/dist/openssl/crypto/evp/m_sha1.c:1.1.1.5 src/crypto/dist/openssl/crypto/evp/m_sha1.c:1.2
--- src/crypto/dist/openssl/crypto/evp/m_sha1.c:1.1.1.5 Fri May 9 21:34:29 2008
+++ src/crypto/dist/openssl/crypto/evp/m_sha1.c Sun Jun 14 14:18:35 2009
@@ -104,13 +104,12 @@
{ return SHA224_Init(ctx->md_data); }
static int init256(EVP_MD_CTX *ctx)
{ return SHA256_Init(ctx->md_data); }
-/*
- * Even though there're separate SHA224_[Update|Final], we call
- * SHA256 functions even in SHA224 context. This is what happens
- * there anyway, so we can spare few CPU cycles:-)
- */
+static int update224(EVP_MD_CTX *ctx,const void *data,size_t count)
+ { return SHA224_Update(ctx->md_data,data,count); }
static int update256(EVP_MD_CTX *ctx,const void *data,size_t count)
{ return SHA256_Update(ctx->md_data,data,count); }
+static int final224(EVP_MD_CTX *ctx,unsigned char *md)
+ { return SHA224_Final(md,ctx->md_data); }
static int final256(EVP_MD_CTX *ctx,unsigned char *md)
{ return SHA256_Final(md,ctx->md_data); }