aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/sha/sha1dgst.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>1999-05-09 10:16:46 +0000
committerBodo Möller <bodo@openssl.org>1999-05-09 10:16:46 +0000
commita0d0c6a61bd9364dd411e1538b65efa9392c8f92 (patch)
treeabac163c78cddb34459a89e32fdb5269d9cf97b7 /crypto/sha/sha1dgst.c
parent303c002898915c5636dfa9d295b9de38db65207a (diff)
downloadopenssl-a0d0c6a61bd9364dd411e1538b65efa9392c8f92.tar.gz
Move variable definitions into the blocks where they are really needed,
so that warnings about unused variables don't appear if those blocks are removed by the C preprocessor. Submitted by: Reviewed by: PR:
Diffstat (limited to 'crypto/sha/sha1dgst.c')
-rw-r--r--crypto/sha/sha1dgst.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/crypto/sha/sha1dgst.c b/crypto/sha/sha1dgst.c
index e867f6972b..de8fa84e24 100644
--- a/crypto/sha/sha1dgst.c
+++ b/crypto/sha/sha1dgst.c
@@ -274,8 +274,6 @@ void SHA1_Update(SHA_CTX *c, const register unsigned char *data,
void SHA1_Transform(SHA_CTX *c, unsigned char *b)
{
SHA_LONG p[SHA_LBLOCK];
- SHA_LONG *q;
- int i;
#if SHA_LONG_LOG2==2
#if defined(B_ENDIAN) || defined(SHA1_ASM)
@@ -285,6 +283,9 @@ void SHA1_Transform(SHA_CTX *c, unsigned char *b)
#else
if (((unsigned long)b%sizeof(SHA_LONG)) == 0)
{
+ SHA_LONG *q;
+ int i;
+
q=p;
for (i=(SHA_LBLOCK/4); i; i--)
{
@@ -302,16 +303,21 @@ void SHA1_Transform(SHA_CTX *c, unsigned char *b)
#endif
#endif
#ifndef SHA_NO_TAIL_CODE /* defined above, see comment */
- q=p;
- for (i=(SHA_LBLOCK/4); i; i--)
{
- SHA_LONG l;
- c2nl(b,l); *(q++)=l;
- c2nl(b,l); *(q++)=l;
- c2nl(b,l); *(q++)=l;
- c2nl(b,l); *(q++)=l;
- }
- sha1_block(c,p,1);
+ SHA_LONG *q;
+ int i;
+
+ q=p;
+ for (i=(SHA_LBLOCK/4); i; i--)
+ {
+ SHA_LONG l;
+ c2nl(b,l); *(q++)=l;
+ c2nl(b,l); *(q++)=l;
+ c2nl(b,l); *(q++)=l;
+ c2nl(b,l); *(q++)=l;
+ }
+ sha1_block(c,p,1);
+ }
#endif
}