Lines Matching +full:aes +full:- +full:gcm
1 // SPDX-License-Identifier: GPL-2.0-or-later
9 * Copyright (c) 2002 Jean-Francois Dive <jef@linuxbe.org>
12 * Updated RFC4106 AES-GCM testing.
91 while (i-- > 0)
94 return -ENOMEM;
109 int np = (buflen + PAGE_SIZE - 1)/PAGE_SIZE;
124 np--;
134 struct crypto_wait *wait = req->base.data;
185 return -ENOMEM;
212 return -ENOMEM;
214 /* Warm-up run. */
232 cycles += end - start;
293 while (i--)
300 while (i--)
307 while (i--)
317 while (i--)
378 assoc = cur->axbuf[0];
381 sg_init_aead(cur->sg, cur->xbuf,
385 sg_init_aead(cur->sgout, cur->xoutbuf,
389 aead_request_set_ad(cur->req, aad_size);
393 aead_request_set_crypt(cur->req,
394 cur->sgout,
395 cur->sg,
397 ret = crypto_aead_encrypt(cur->req);
398 ret = do_one_aead_op(cur->req, ret);
407 aead_request_set_crypt(cur->req, cur->sg,
408 cur->sgout, bs +
482 /* Warm-up run. */
507 cycles += end - start;
525 int ret = -ENOMEM;
649 * reversed (input <-> output) to calculate it
714 struct crypto_wait *wait = req->base.data;
777 /* Warm-up run. */
796 cycles += end - start;
818 /* Warm-up run. */
853 cycles += end - start;
1002 return -ENOMEM;
1029 return -ENOMEM;
1031 /* Warm-up run. */
1049 cycles += end - start;
1091 while (i--)
1101 while (i--)
1164 sg_init_table(cur->sg, pages);
1167 sg_set_buf(cur->sg + p, cur->xbuf[p],
1169 memset(cur->xbuf[p], 0xff, PAGE_SIZE);
1171 k -= PAGE_SIZE;
1174 sg_set_buf(cur->sg + p, cur->xbuf[p], k);
1175 memset(cur->xbuf[p], 0xff, k);
1177 skcipher_request_set_crypt(cur->req, cur->sg,
1178 cur->sg, bs, iv);
1216 struct crypto_wait *wait = req->base.data;
1253 /* Warm-up run. */
1282 cycles += end - start;
1376 PAGE_SIZE - *keysize);
1377 k -= PAGE_SIZE;
1383 k -= PAGE_SIZE;
1446 /* non-fips algs return -EINVAL or -ECANCELED in fips mode */
1447 if (fips_enabled && (ret == -EINVAL || ret == -ECANCELED))
1462 ret = -ENOENT;
1521 ret = min(ret, tcrypt_test("ecb(aes)"));
1522 ret = min(ret, tcrypt_test("cbc(aes)"));
1523 ret = min(ret, tcrypt_test("lrw(aes)"));
1524 ret = min(ret, tcrypt_test("xts(aes)"));
1525 ret = min(ret, tcrypt_test("ctr(aes)"));
1526 ret = min(ret, tcrypt_test("rfc3686(ctr(aes))"));
1527 ret = min(ret, tcrypt_test("xctr(aes)"));
1618 ret = min(ret, tcrypt_test("gcm(aes)"));
1626 ret = min(ret, tcrypt_test("ccm(aes)"));
1630 ret = min(ret, tcrypt_test("cts(cbc(aes))"));
1642 ret = min(ret, tcrypt_test("blake2b-512"));
1650 ret = min(ret, tcrypt_test("rfc4309(ccm(aes))"));
1662 ret = min(ret, tcrypt_test("sha3-224"));
1666 ret = min(ret, tcrypt_test("sha3-256"));
1670 ret = min(ret, tcrypt_test("sha3-384"));
1674 ret = min(ret, tcrypt_test("sha3-512"));
1690 ret = min(ret, tcrypt_test("gcm(sm4)"));
1702 ret = min(ret, tcrypt_test("gcm(aria)"));
1734 ret = min(ret, tcrypt_test("xcbc(aes)"));
1742 ret = min(ret, tcrypt_test("hmac(sha3-224)"));
1746 ret = min(ret, tcrypt_test("hmac(sha3-256)"));
1750 ret = min(ret, tcrypt_test("hmac(sha3-384)"));
1754 ret = min(ret, tcrypt_test("hmac(sha3-512)"));
1770 ret = min(ret, tcrypt_test("rfc4106(gcm(aes))"));
1774 ret = min(ret, tcrypt_test("rfc4543(gcm(aes))"));
1778 ret = min(ret, tcrypt_test("cmac(aes)"));
1786 ret = min(ret, tcrypt_test("authenc(hmac(sha1),cbc(aes))"));
1854 test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0,
1856 test_cipher_speed("ecb(aes)", DECRYPT, sec, NULL, 0,
1858 test_cipher_speed("cbc(aes)", ENCRYPT, sec, NULL, 0,
1860 test_cipher_speed("cbc(aes)", DECRYPT, sec, NULL, 0,
1862 test_cipher_speed("lrw(aes)", ENCRYPT, sec, NULL, 0,
1864 test_cipher_speed("lrw(aes)", DECRYPT, sec, NULL, 0,
1866 test_cipher_speed("xts(aes)", ENCRYPT, sec, NULL, 0,
1868 test_cipher_speed("xts(aes)", DECRYPT, sec, NULL, 0,
1870 test_cipher_speed("cts(cbc(aes))", ENCRYPT, sec, NULL, 0,
1872 test_cipher_speed("cts(cbc(aes))", DECRYPT, sec, NULL, 0,
1874 test_cipher_speed("ctr(aes)", ENCRYPT, sec, NULL, 0,
1876 test_cipher_speed("ctr(aes)", DECRYPT, sec, NULL, 0,
2040 test_aead_speed("rfc4106(gcm(aes))", ENCRYPT, sec,
2042 test_aead_speed("gcm(aes)", ENCRYPT, sec,
2044 test_aead_speed("rfc4106(gcm(aes))", DECRYPT, sec,
2046 test_aead_speed("gcm(aes)", DECRYPT, sec,
2051 test_aead_speed("rfc4309(ccm(aes))", ENCRYPT, sec,
2053 test_aead_speed("rfc4309(ccm(aes))", DECRYPT, sec,
2070 test_mb_aead_speed("rfc4106(gcm(aes))", ENCRYPT, sec, NULL,
2072 test_mb_aead_speed("gcm(aes)", ENCRYPT, sec, NULL, 0, 16, 8,
2074 test_mb_aead_speed("rfc4106(gcm(aes))", DECRYPT, sec, NULL,
2076 test_mb_aead_speed("gcm(aes)", DECRYPT, sec, NULL, 0, 16, 8,
2081 test_mb_aead_speed("rfc4309(ccm(aes))", ENCRYPT, sec, NULL, 0,
2083 test_mb_aead_speed("rfc4309(ccm(aes))", DECRYPT, sec, NULL, 0,
2120 test_cipher_speed("adiantum(xchacha12,aes)", ENCRYPT, sec, NULL,
2122 test_cipher_speed("adiantum(xchacha12,aes)", DECRYPT, sec, NULL,
2124 test_cipher_speed("adiantum(xchacha20,aes)", ENCRYPT, sec, NULL,
2126 test_cipher_speed("adiantum(xchacha20,aes)", DECRYPT, sec, NULL,
2131 test_acipher_speed("essiv(cbc(aes),sha256)",
2134 test_acipher_speed("essiv(cbc(aes),sha256)",
2147 test_aead_speed("gcm(sm4)", ENCRYPT, sec,
2149 test_aead_speed("gcm(sm4)", DECRYPT, sec,
2161 test_mb_aead_speed("gcm(sm4)", ENCRYPT, sec, NULL, 0, 16, 8,
2163 test_mb_aead_speed("gcm(sm4)", DECRYPT, sec, NULL, 0, 16, 8,
2175 test_cipher_speed("hctr2(aes)", ENCRYPT, sec, NULL,
2195 test_aead_speed("gcm(aria)", ENCRYPT, sec,
2197 test_aead_speed("gcm(aria)", DECRYPT, sec,
2202 test_mb_aead_speed("gcm(aria)", ENCRYPT, sec, NULL, 0, 16, 8,
2204 test_mb_aead_speed("gcm(aria)", DECRYPT, sec, NULL, 0, 16, 8,
2263 test_hash_speed("blake2b-512", sec, generic_hash_speed_template);
2284 test_hash_speed("sha3-224", sec, generic_hash_speed_template);
2288 test_hash_speed("sha3-256", sec, generic_hash_speed_template);
2292 test_hash_speed("sha3-384", sec, generic_hash_speed_template);
2296 test_hash_speed("sha3-512", sec, generic_hash_speed_template);
2371 test_ahash_speed("blake2b-512", sec, generic_hash_speed_template);
2375 test_ahash_speed("sha3-224", sec, generic_hash_speed_template);
2379 test_ahash_speed("sha3-256", sec, generic_hash_speed_template);
2383 test_ahash_speed("sha3-384", sec, generic_hash_speed_template);
2387 test_ahash_speed("sha3-512", sec, generic_hash_speed_template);
2398 test_acipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0,
2400 test_acipher_speed("ecb(aes)", DECRYPT, sec, NULL, 0,
2402 test_acipher_speed("cbc(aes)", ENCRYPT, sec, NULL, 0,
2404 test_acipher_speed("cbc(aes)", DECRYPT, sec, NULL, 0,
2406 test_acipher_speed("lrw(aes)", ENCRYPT, sec, NULL, 0,
2408 test_acipher_speed("lrw(aes)", DECRYPT, sec, NULL, 0,
2410 test_acipher_speed("xts(aes)", ENCRYPT, sec, NULL, 0,
2412 test_acipher_speed("xts(aes)", DECRYPT, sec, NULL, 0,
2414 test_acipher_speed("cts(cbc(aes))", ENCRYPT, sec, NULL, 0,
2416 test_acipher_speed("cts(cbc(aes))", DECRYPT, sec, NULL, 0,
2418 test_acipher_speed("ctr(aes)", ENCRYPT, sec, NULL, 0,
2420 test_acipher_speed("ctr(aes)", DECRYPT, sec, NULL, 0,
2422 test_acipher_speed("rfc3686(ctr(aes))", ENCRYPT, sec, NULL, 0,
2424 test_acipher_speed("rfc3686(ctr(aes))", DECRYPT, sec, NULL, 0,
2621 test_mb_skcipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0,
2623 test_mb_skcipher_speed("ecb(aes)", DECRYPT, sec, NULL, 0,
2625 test_mb_skcipher_speed("cbc(aes)", ENCRYPT, sec, NULL, 0,
2627 test_mb_skcipher_speed("cbc(aes)", DECRYPT, sec, NULL, 0,
2629 test_mb_skcipher_speed("lrw(aes)", ENCRYPT, sec, NULL, 0,
2631 test_mb_skcipher_speed("lrw(aes)", DECRYPT, sec, NULL, 0,
2633 test_mb_skcipher_speed("xts(aes)", ENCRYPT, sec, NULL, 0,
2635 test_mb_skcipher_speed("xts(aes)", DECRYPT, sec, NULL, 0,
2637 test_mb_skcipher_speed("cts(cbc(aes))", ENCRYPT, sec, NULL, 0,
2639 test_mb_skcipher_speed("cts(cbc(aes))", DECRYPT, sec, NULL, 0,
2641 test_mb_skcipher_speed("ctr(aes)", ENCRYPT, sec, NULL, 0,
2643 test_mb_skcipher_speed("ctr(aes)", DECRYPT, sec, NULL, 0,
2645 test_mb_skcipher_speed("rfc3686(ctr(aes))", ENCRYPT, sec, NULL,
2647 test_mb_skcipher_speed("rfc3686(ctr(aes))", DECRYPT, sec, NULL,
2822 int err = -ENOMEM;
2840 /* We intentionaly return -EAGAIN to prevent keeping the module,
2845 * -- mludvig
2848 err = -EAGAIN;