sha512: fix bad hardcoded constant in sha512_final()
[project/usign.git] / sha512.c
index 68a9e65db8f85d72e14a044dd23d257fdce326fd..d06d65b653d4ebee110521eb7dc9d7d0ed3df5b0 100644 (file)
--- a/sha512.c
+++ b/sha512.c
@@ -232,7 +232,7 @@ void sha512_final(struct sha512_state *s, uint8_t *hash)
                memset(&s->partial[last_size], 0,
                       SHA512_BLOCK_SIZE - last_size);
 
-       if (last_size > 110) {
+       if (last_size > (SHA512_BLOCK_SIZE - 16)) {
                sha512_block(s, s->partial);
                memset(s->partial, 0, sizeof(s->partial));
        }