crypto: testmgr - skip AEAD encryption test vectors with novrfy set
authorEric Biggers <ebiggers@google.com>
Sun, 13 Jan 2019 23:32:24 +0000 (15:32 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 18 Jan 2019 10:43:44 +0000 (18:43 +0800)
In preparation for unifying the AEAD encryption and decryption test
vectors, skip AEAD test vectors with the 'novrfy' (verification failure
expected) flag set when testing encryption rather than decryption.
These test vectors only make sense for decryption.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/testmgr.c

index fd31cfa872fb38182f670f3ea996d63de08d1adc..09f2f0f582bf72a8bb72927ed2cd57b74f0e8bd5 100644 (file)
@@ -671,6 +671,8 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
        for (i = 0, j = 0; i < tcount; i++) {
                if (template[i].np)
                        continue;
+               if (enc && template[i].novrfy)
+                       continue;
 
                j++;
 
@@ -787,6 +789,9 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
                if (!template[i].np)
                        continue;
 
+               if (enc && template[i].novrfy)
+                       continue;
+
                j++;
 
                if (template[i].iv)