]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - crypto/testmgr.c
Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6
[karo-tx-linux.git] / crypto / testmgr.c
index 38e23be315a0b27f2763fd371727133e26b65a96..5c9d5a5e7b65182ed1f78b5c0332c5c9b2a328c1 100644 (file)
@@ -1941,6 +1941,7 @@ static int test_akcipher_one(struct crypto_akcipher *tfm,
        if (err)
                goto free_req;
 
+       err = -ENOMEM;
        out_len_max = crypto_akcipher_maxsize(tfm);
        outbuf_enc = kzalloc(out_len_max, GFP_KERNEL);
        if (!outbuf_enc)
@@ -2033,6 +2034,8 @@ free_xbuf:
 static int test_akcipher(struct crypto_akcipher *tfm, const char *alg,
                         struct akcipher_testvec *vecs, unsigned int tcount)
 {
+       const char *algo =
+               crypto_tfm_alg_driver_name(crypto_akcipher_tfm(tfm));
        int ret, i;
 
        for (i = 0; i < tcount; i++) {
@@ -2040,8 +2043,8 @@ static int test_akcipher(struct crypto_akcipher *tfm, const char *alg,
                if (!ret)
                        continue;
 
-               pr_err("alg: akcipher: test failed on vector %d, err=%d\n",
-                      i + 1, ret);
+               pr_err("alg: akcipher: test %d failed for %s, err=%d\n",
+                      i + 1, algo, ret);
                return ret;
        }
        return 0;
@@ -3399,6 +3402,46 @@ static const struct alg_test_desc alg_test_descs[] = {
                                .count = HMAC_SHA256_TEST_VECTORS
                        }
                }
+       }, {
+               .alg = "hmac(sha3-224)",
+               .test = alg_test_hash,
+               .fips_allowed = 1,
+               .suite = {
+                       .hash = {
+                               .vecs = hmac_sha3_224_tv_template,
+                               .count = HMAC_SHA3_224_TEST_VECTORS
+                       }
+               }
+       }, {
+               .alg = "hmac(sha3-256)",
+               .test = alg_test_hash,
+               .fips_allowed = 1,
+               .suite = {
+                       .hash = {
+                               .vecs = hmac_sha3_256_tv_template,
+                               .count = HMAC_SHA3_256_TEST_VECTORS
+                       }
+               }
+       }, {
+               .alg = "hmac(sha3-384)",
+               .test = alg_test_hash,
+               .fips_allowed = 1,
+               .suite = {
+                       .hash = {
+                               .vecs = hmac_sha3_384_tv_template,
+                               .count = HMAC_SHA3_384_TEST_VECTORS
+                       }
+               }
+       }, {
+               .alg = "hmac(sha3-512)",
+               .test = alg_test_hash,
+               .fips_allowed = 1,
+               .suite = {
+                       .hash = {
+                               .vecs = hmac_sha3_512_tv_template,
+                               .count = HMAC_SHA3_512_TEST_VECTORS
+                       }
+               }
        }, {
                .alg = "hmac(sha384)",
                .test = alg_test_hash,