Commit d31de187 authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Herbert Xu

crypto: testmgr - add/enhance test cases for CRC-T10DIF

The existing test cases only exercise a small slice of the various
possible code paths through the x86 SSE/PCLMULQDQ implementation,
and the upcoming ports of it for arm64. So add one that exceeds 256
bytes in size, and convert another to a chunked test.
Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 7e4c7f17
...@@ -1334,36 +1334,50 @@ static struct hash_testvec rmd320_tv_template[] = { ...@@ -1334,36 +1334,50 @@ static struct hash_testvec rmd320_tv_template[] = {
} }
}; };
#define CRCT10DIF_TEST_VECTORS 3 #define CRCT10DIF_TEST_VECTORS ARRAY_SIZE(crct10dif_tv_template)
static struct hash_testvec crct10dif_tv_template[] = { static struct hash_testvec crct10dif_tv_template[] = {
{ {
.plaintext = "abc", .plaintext = "abc",
.psize = 3, .psize = 3,
#ifdef __LITTLE_ENDIAN .digest = (u8 *)(u16 []){ 0x443b },
.digest = "\x3b\x44", }, {
#else .plaintext = "1234567890123456789012345678901234567890"
.digest = "\x44\x3b", "123456789012345678901234567890123456789",
#endif .psize = 79,
}, { .digest = (u8 *)(u16 []){ 0x4b70 },
.plaintext = "1234567890123456789012345678901234567890" .np = 2,
"123456789012345678901234567890123456789", .tap = { 63, 16 },
.psize = 79, }, {
#ifdef __LITTLE_ENDIAN .plaintext = "abcdddddddddddddddddddddddddddddddddddddddd"
.digest = "\x70\x4b", "ddddddddddddd",
#else .psize = 56,
.digest = "\x4b\x70", .digest = (u8 *)(u16 []){ 0x9ce3 },
#endif .np = 8,
}, { .tap = { 1, 2, 28, 7, 6, 5, 4, 3 },
.plaintext = }, {
"abcddddddddddddddddddddddddddddddddddddddddddddddddddddd", .plaintext = "1234567890123456789012345678901234567890"
.psize = 56, "1234567890123456789012345678901234567890"
#ifdef __LITTLE_ENDIAN "1234567890123456789012345678901234567890"
.digest = "\xe3\x9c", "1234567890123456789012345678901234567890"
#else "1234567890123456789012345678901234567890"
.digest = "\x9c\xe3", "1234567890123456789012345678901234567890"
#endif "1234567890123456789012345678901234567890"
.np = 2, "123456789012345678901234567890123456789",
.tap = { 28, 28 } .psize = 319,
.digest = (u8 *)(u16 []){ 0x44c6 },
}, {
.plaintext = "1234567890123456789012345678901234567890"
"1234567890123456789012345678901234567890"
"1234567890123456789012345678901234567890"
"1234567890123456789012345678901234567890"
"1234567890123456789012345678901234567890"
"1234567890123456789012345678901234567890"
"1234567890123456789012345678901234567890"
"123456789012345678901234567890123456789",
.psize = 319,
.digest = (u8 *)(u16 []){ 0x44c6 },
.np = 4,
.tap = { 1, 255, 57, 6 },
} }
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment