diff options
author | Cristian Stoica <cristian.stoica@freescale.com> | 2014-03-12 13:15:51 (GMT) |
---|---|---|
committer | Jose Rivera <German.Rivera@freescale.com> | 2014-03-28 13:41:02 (GMT) |
commit | 8df6f07de1e252f9ffa45cacd667fe0af41d71c1 (patch) | |
tree | 16cf862cfb38ea682aa0f82e7cfc3b33732297e2 /crypto | |
parent | a64f733483ca7205f93d3e7c7eb5a60186e81bad (diff) | |
download | linux-fsl-qoriq-8df6f07de1e252f9ffa45cacd667fe0af41d71c1.tar.xz |
crypto: testmgr - code clean-up on TLS tests
Change-Id: Ic1248e27fabf787434dabd1303e0bdfdd78732b6
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
Reviewed-on: http://git.am.freescale.net:8181/10083
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Horia Ioan Geanta Neag <horia.geanta@freescale.com>
Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
(cherry picked from commit d076de0815bfd49181d8d660349ccc1f69e27932)
Reviewed-on: http://git.am.freescale.net:8181/10382
Reviewed-by: Mircea Pop <mircea.pop@freescale.com>
Reviewed-by: Alexandru Porosanu <alexandru.porosanu@freescale.com>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/testmgr.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 6221c54..c8bfd5f 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c @@ -845,21 +845,14 @@ static int __test_tls(struct crypto_aead *tfm, int enc, sg = kmalloc(sizeof(*sg) * 8 * (diff_dst ? 3 : 2), GFP_KERNEL); if (!sg) goto out_nosg; - asg = &sg[8]; - sgout = &asg[8]; - if (diff_dst) - d = "-ddst"; - else - d = ""; + asg = sg + 8; + sgout = sg + 16; - if (enc == ENCRYPT) - e = "encryption"; - else - e = "decryption"; + d = diff_dst ? "-ddst" : ""; + e = enc ? "encryption" : "decryption"; init_completion(&result.completion); - req = aead_request_alloc(tfm, GFP_KERNEL); if (!req) { pr_err("alg: tls%s: Failed to allocate request for %s\n", @@ -898,8 +891,6 @@ static int __test_tls(struct crypto_aead *tfm, int enc, if (ret) continue; - output = diff_dst ? xoutbuf[0] : input; - /* Allocate enough space in the input and output scatterlists. * They must accomodate the result for in-place encryption and * different-place decryption @@ -915,7 +906,6 @@ static int __test_tls(struct crypto_aead *tfm, int enc, } sg_init_one(&asg[0], assoc, template[i].alen); - aead_request_set_assoc(req, asg, template[i].alen); aead_request_set_crypt(req, sg, (diff_dst) ? sgout : sg, template[i].ilen, iv); |