summaryrefslogtreecommitdiff
path: root/arch/x86/crypto/sha512-mb/sha512_mb.c
diff options
context:
space:
mode:
authorGreg Tucker <greg.b.tucker@intel.com>2016-11-15 02:11:44 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2016-11-17 18:35:00 +0300
commit7a0b86b1b964d31604eb216a5648906b38470bba (patch)
treed7a59bb859af973ff732205aaa600f314e3e1028 /arch/x86/crypto/sha512-mb/sha512_mb.c
parent75aa0a7cafe951538c7cb7c5ed457a3371ec5bcd (diff)
downloadlinux-7a0b86b1b964d31604eb216a5648906b38470bba.tar.xz
crypto: sha-mb - Fix total_len for correct hash when larger than 512MB
Current multi-buffer hash implementations have a restriction on the total length of a hash job to 512MB. Hashing larger buffers will result in an incorrect hash. This extends the limit to 2^62 - 1. Signed-off-by: Greg Tucker <greg.b.tucker@intel.com> Acked-by: Tim Chen <tim.c.chen@linux.intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/x86/crypto/sha512-mb/sha512_mb.c')
-rw-r--r--arch/x86/crypto/sha512-mb/sha512_mb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/crypto/sha512-mb/sha512_mb.c b/arch/x86/crypto/sha512-mb/sha512_mb.c
index d210174a52b0..9c1bb6d58141 100644
--- a/arch/x86/crypto/sha512-mb/sha512_mb.c
+++ b/arch/x86/crypto/sha512-mb/sha512_mb.c
@@ -117,7 +117,7 @@ inline void sha512_init_digest(uint64_t *digest)
}
inline uint32_t sha512_pad(uint8_t padblock[SHA512_BLOCK_SIZE * 2],
- uint32_t total_len)
+ uint64_t total_len)
{
uint32_t i = total_len & (SHA512_BLOCK_SIZE - 1);