summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2018-05-20 22:50:27 -0700
committerHerbert Xu <herbert@gondor.apana.org.au>2018-05-31 00:13:37 +0800
commita0e20b9b54001c7d08f5b0248dfa25b5b420ad2a (patch)
treeebeeee6c950980ddb638154d2ad96d546ab626b9 /crypto
parent17880f11398d00451ccfae4d2d889e55a726bf3a (diff)
downloadlinux-rpi3-a0e20b9b54001c7d08f5b0248dfa25b5b420ad2a.tar.gz
linux-rpi3-a0e20b9b54001c7d08f5b0248dfa25b5b420ad2a.tar.bz2
linux-rpi3-a0e20b9b54001c7d08f5b0248dfa25b5b420ad2a.zip
crypto: testmgr - add extra ecb(tnepres) encryption test vectors
None of the four "ecb(tnepres)" decryption test vectors exactly match an encryption test vector with input and result swapped. In preparation for removing the decryption test vectors, add these to the encryption test vectors, so we don't lose any test coverage. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/testmgr.h40
1 files changed, 39 insertions, 1 deletions
diff --git a/crypto/testmgr.h b/crypto/testmgr.h
index 1e265820df29..710033dc62b4 100644
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
@@ -12047,6 +12047,14 @@ static const struct cipher_testvec serpent_enc_tv_template[] = {
};
static const struct cipher_testvec tnepres_enc_tv_template[] = {
+ { /* KeySize=0 */
+ .input = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+ .ilen = 16,
+ .result = "\x41\xcc\x6b\x31\x59\x31\x45\x97"
+ "\x6d\x6f\xbb\x38\x4b\x37\x21\x28",
+ .rlen = 16,
+ },
{ /* KeySize=128, PT=0, I=1 */
.input = "\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00",
@@ -12057,6 +12065,24 @@ static const struct cipher_testvec tnepres_enc_tv_template[] = {
.result = "\x49\xaf\xbf\xad\x9d\x5a\x34\x05"
"\x2c\xd8\xff\xa5\x98\x6b\xd2\xdd",
.rlen = 16,
+ }, { /* KeySize=128 */
+ .key = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+ .klen = 16,
+ .input = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+ .ilen = 16,
+ .result = "\xea\xf4\xd7\xfc\xd8\x01\x34\x47"
+ "\x81\x45\x0b\xfa\x0c\xd6\xad\x6e",
+ .rlen = 16,
+ }, { /* KeySize=128, I=121 */
+ .key = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80",
+ .klen = 16,
+ .input = zeroed_string,
+ .ilen = 16,
+ .result = "\x3d\xda\xbf\xc0\x06\xda\xab\x06"
+ "\x46\x2a\xf4\xef\x81\x54\x4e\x26",
+ .rlen = 16,
}, { /* KeySize=192, PT=0, I=1 */
.key = "\x80\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00"
@@ -12092,7 +12118,19 @@ static const struct cipher_testvec tnepres_enc_tv_template[] = {
.result = "\x5c\xe7\x1c\x70\xd2\x88\x2e\x5b"
"\xb8\x32\xe4\x33\xf8\x9f\x26\xde",
.rlen = 16,
- },
+ }, { /* KeySize=256 */
+ .key = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16\x17"
+ "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
+ .klen = 32,
+ .input = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+ .ilen = 16,
+ .result = "\x64\xa9\x1a\x37\xed\x9f\xe7\x49"
+ "\xa8\x4e\x76\xd6\xf5\x0d\x78\xee",
+ .rlen = 16,
+ }
};