crypto: sha512 - Fix byte counter overflow in SHA-512
authorKent Yoder <key@linux.vnet.ibm.com>
Thu, 5 Apr 2012 12:34:20 +0000 (20:34 +0800)
committerVarun Wadekar <vwadekar@nvidia.com>
Wed, 25 Apr 2012 06:52:17 +0000 (11:52 +0530)
commit26233c9fe50f300c840a9d050067704b27083405
tree3c5e7857670a39e73d86c21839d9152844727f4c
parentfe7095dee86b1b488b08782793e5609ce3b03915
crypto: sha512 - Fix byte counter overflow in SHA-512

The current code only increments the upper 64 bits of the SHA-512 byte
counter when the number of bytes hashed happens to hit 2^64 exactly.

This patch increments the upper 64 bits whenever the lower 64 bits
overflows.

Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>
Cc: stable@kernel.org
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/sha512_generic.c