summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2018-05-19 22:07:42 -0700
committerHerbert Xu <herbert@gondor.apana.org.au>2018-05-27 00:12:10 +0800
commitc3a8de4edeb5329fd78e71dd60b6c8b4038ee515 (patch)
treeecdd9d54580d03899efd4f6aace80b3ad96f4001 /crypto
parent8906a4bb5917d1093e67aa3a0d3a164c71b766dd (diff)
downloadlinux-crypto-c3a8de4edeb5329fd78e71dd60b6c8b4038ee515.tar.gz
linux-crypto-c3a8de4edeb5329fd78e71dd60b6c8b4038ee515.zip
crypto: testmgr - add more unkeyed crc32 and crc32c test vectors
crc32c has an unkeyed test vector but crc32 did not. Add the crc32c one (which uses an empty input) to crc32 too, and also add a new one to both that uses a nonempty input. These test vectors verify that crc32 and crc32c implementations use the correct default initial state. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r--crypto/testmgr.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/crypto/testmgr.h b/crypto/testmgr.h
index 816e3eb1..9350f984 100644
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
@@ -42293,6 +42293,15 @@ static const struct hash_testvec michael_mic_tv_template[] = {
*/
static const struct hash_testvec crc32_tv_template[] = {
{
+ .psize = 0,
+ .digest = "\x00\x00\x00\x00",
+ },
+ {
+ .plaintext = "abcdefg",
+ .psize = 7,
+ .digest = "\xd8\xb5\x46\xac",
+ },
+ {
.key = "\x87\xa9\xcb\xed",
.ksize = 4,
.psize = 0,
@@ -42729,6 +42738,11 @@ static const struct hash_testvec crc32c_tv_template[] = {
.digest = "\x00\x00\x00\x00",
},
{
+ .plaintext = "abcdefg",
+ .psize = 7,
+ .digest = "\x41\xf4\x27\xe6",
+ },
+ {
.key = "\x87\xa9\xcb\xed",
.ksize = 4,
.psize = 0,