summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorAntoine Tenart <antoine.tenart@bootlin.com>2018-05-29 14:13:49 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2018-06-22 23:03:05 +0800
commita248ecca7a6077f18322d81ce63a96754634d46d (patch)
treeaeefbae490a234f7c5d27d71e4a559bab9c9c566 /crypto
parenta0e60416032b3fb379b869add8c3d42628a32fbc (diff)
downloadlinux-crypto-a248ecca7a6077f18322d81ce63a96754634d46d.tar.gz
linux-crypto-a248ecca7a6077f18322d81ce63a96754634d46d.zip
crypto: sha512_generic - add a sha384 0-length pre-computed hash
This patch adds the sha384 pre-computed 0-length hash so that device drivers can use it when an hardware engine does not support computing a hash from a 0 length input. Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/sha512_generic.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/crypto/sha512_generic.c b/crypto/sha512_generic.c
index 439723d9..0b805d03 100644
--- a/crypto/sha512_generic.c
+++ b/crypto/sha512_generic.c
@@ -23,6 +23,16 @@
#include <asm/byteorder.h>
#include <asm/unaligned.h>
+const u8 sha384_zero_message_hash[SHA384_DIGEST_SIZE] = {
+ 0x38, 0xb0, 0x60, 0xa7, 0x51, 0xac, 0x96, 0x38,
+ 0x4c, 0xd9, 0x32, 0x7e, 0xb1, 0xb1, 0xe3, 0x6a,
+ 0x21, 0xfd, 0xb7, 0x11, 0x14, 0xbe, 0x07, 0x43,
+ 0x4c, 0x0c, 0xc7, 0xbf, 0x63, 0xf6, 0xe1, 0xda,
+ 0x27, 0x4e, 0xde, 0xbf, 0xe7, 0x6f, 0x65, 0xfb,
+ 0xd5, 0x1a, 0xd2, 0xf1, 0x48, 0x98, 0xb9, 0x5b
+};
+EXPORT_SYMBOL_GPL(sha384_zero_message_hash);
+
const u8 sha512_zero_message_hash[SHA512_DIGEST_SIZE] = {
0xcf, 0x83, 0xe1, 0x35, 0x7e, 0xef, 0xb8, 0xbd,
0xf1, 0x54, 0x28, 0x50, 0xd6, 0x6d, 0x80, 0x07,