diff options
Diffstat (limited to 'crypto/sha/sha512.c')
-rw-r--r-- | crypto/sha/sha512.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crypto/sha/sha512.c b/crypto/sha/sha512.c index f934c74414..c58cc1b44b 100644 --- a/crypto/sha/sha512.c +++ b/crypto/sha/sha512.c @@ -107,9 +107,11 @@ int SHA512_Final(unsigned char *md, SHA512_CTX *c) p[n] = 0x80; /* There always is a room for one */ n++; - if (n > (sizeof(c->u) - 16)) - memset(p + n, 0, sizeof(c->u) - n), n = 0, - sha512_block_data_order(c, p, 1); + if (n > (sizeof(c->u) - 16)) { + memset(p + n, 0, sizeof(c->u) - n); + n = 0; + sha512_block_data_order(c, p, 1); + } memset(p + n, 0, sizeof(c->u) - 16 - n); #ifdef B_ENDIAN |