summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-07-09 07:17:26 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2015-07-14 14:56:46 +0800
commit34a1c740ea87b5077d1060448a05db14f5f29960 (patch)
treebad61ecfeb5af01f2b41c678f8efe2843cbf6d40 /crypto
parent8537544679272b77b8bca1e02263bee4bbea14e6 (diff)
downloadop-kernel-dev-34a1c740ea87b5077d1060448a05db14f5f29960.zip
op-kernel-dev-34a1c740ea87b5077d1060448a05db14f5f29960.tar.gz
crypto: tcrypt - Add support for new IV convention
This patch allows the AEAD speed tests to cope with the new seqiv calling convention as well as the old one. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/tcrypt.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 3603c7c..73ed4f2 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -344,7 +344,12 @@ static void test_aead_speed(const char *algo, int enc, unsigned int secs,
goto out_nosg;
sgout = &sg[9];
- tfm = crypto_alloc_aead(algo, 0, 0);
+ tfm = crypto_alloc_aead(algo, CRYPTO_ALG_AEAD_NEW,
+ CRYPTO_ALG_AEAD_NEW);
+ if (PTR_ERR(tfm) == -ENOENT) {
+ aad_size -= 8;
+ tfm = crypto_alloc_aead(algo, 0, CRYPTO_ALG_AEAD_NEW);
+ }
if (IS_ERR(tfm)) {
pr_err("alg: aead: Failed to load transform for %s: %ld\n", algo,
@@ -1778,14 +1783,14 @@ static int do_test(const char *alg, u32 type, u32 mask, int m)
case 211:
test_aead_speed("rfc4106(gcm(aes))", ENCRYPT, sec,
- NULL, 0, 16, 8, aead_speed_template_20);
+ NULL, 0, 16, 16, aead_speed_template_20);
test_aead_speed("gcm(aes)", ENCRYPT, sec,
NULL, 0, 16, 8, aead_speed_template_20);
break;
case 212:
test_aead_speed("rfc4309(ccm(aes))", ENCRYPT, sec,
- NULL, 0, 16, 8, aead_speed_template_19);
+ NULL, 0, 16, 16, aead_speed_template_19);
break;
case 300:
OpenPOWER on IntegriCloud