Skip to content

Commit 34a1c74

Browse files
committed
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 <[email protected]>
1 parent 8537544 commit 34a1c74

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

crypto/tcrypt.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,12 @@ static void test_aead_speed(const char *algo, int enc, unsigned int secs,
344344
goto out_nosg;
345345
sgout = &sg[9];
346346

347-
tfm = crypto_alloc_aead(algo, 0, 0);
347+
tfm = crypto_alloc_aead(algo, CRYPTO_ALG_AEAD_NEW,
348+
CRYPTO_ALG_AEAD_NEW);
349+
if (PTR_ERR(tfm) == -ENOENT) {
350+
aad_size -= 8;
351+
tfm = crypto_alloc_aead(algo, 0, CRYPTO_ALG_AEAD_NEW);
352+
}
348353

349354
if (IS_ERR(tfm)) {
350355
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)
17781783

17791784
case 211:
17801785
test_aead_speed("rfc4106(gcm(aes))", ENCRYPT, sec,
1781-
NULL, 0, 16, 8, aead_speed_template_20);
1786+
NULL, 0, 16, 16, aead_speed_template_20);
17821787
test_aead_speed("gcm(aes)", ENCRYPT, sec,
17831788
NULL, 0, 16, 8, aead_speed_template_20);
17841789
break;
17851790

17861791
case 212:
17871792
test_aead_speed("rfc4309(ccm(aes))", ENCRYPT, sec,
1788-
NULL, 0, 16, 8, aead_speed_template_19);
1793+
NULL, 0, 16, 16, aead_speed_template_19);
17891794
break;
17901795

17911796
case 300:

0 commit comments

Comments
 (0)