summaryrefslogtreecommitdiff
path: root/crypto/tcrypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/tcrypt.c')
-rw-r--r--crypto/tcrypt.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 00149657a4bc..0970f103f691 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -72,8 +72,8 @@ static const char *check[] = {
"cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea",
"khazad", "wp512", "wp384", "wp256", "xeta", "fcrypt",
"camellia", "seed", "rmd160",
- "lzo", "lzo-rle", "cts", "sha3-224", "sha3-256", "sha3-384",
- "sha3-512", "streebog256", "streebog512",
+ "lzo", "lzo-rle", "cts", "zlib", "sha3-224", "sha3-256", "sha3-384",
+ "sha3-512", "streebog256", "streebog512", "rsa",
NULL
};
@@ -259,7 +259,7 @@ static void test_mb_aead_speed(const char *algo, int enc, int secs,
const int *b_size;
const char *key;
const char *e;
- void *assoc;
+ void *assoc, *assoc_out;
char *iv;
int ret;
@@ -385,6 +385,8 @@ static void test_mb_aead_speed(const char *algo, int enc, int secs,
assoc = cur->axbuf[0];
memset(assoc, 0xff, aad_size);
+ assoc_out = cur->axbuf[1];
+ memset(assoc_out, 0xff, aad_size);
sg_init_aead(cur->sg, cur->xbuf,
bs + (enc ? 0 : authsize),
@@ -392,7 +394,7 @@ static void test_mb_aead_speed(const char *algo, int enc, int secs,
sg_init_aead(cur->sgout, cur->xoutbuf,
bs + (enc ? authsize : 0),
- assoc, aad_size);
+ assoc_out, aad_size);
aead_request_set_ad(cur->req, aad_size);
@@ -410,6 +412,9 @@ static void test_mb_aead_speed(const char *algo, int enc, int secs,
ret);
break;
}
+
+ memset(assoc, 0xff, aad_size);
+ memset(assoc_out, 0xff, aad_size);
}
aead_request_set_crypt(cur->req, cur->sg,
@@ -536,7 +541,7 @@ static void test_aead_speed(const char *algo, int enc, unsigned int secs,
struct scatterlist *sg;
struct scatterlist *sgout;
const char *e;
- void *assoc;
+ void *assoc, *assoc_out;
char *iv;
char *xbuf[XBUFSIZE];
char *xoutbuf[XBUFSIZE];
@@ -607,6 +612,8 @@ static void test_aead_speed(const char *algo, int enc, unsigned int secs,
assoc = axbuf[0];
memset(assoc, 0xff, aad_size);
+ assoc_out = axbuf[1];
+ memset(assoc_out, 0xff, aad_size);
if ((*keysize + bs) > TVMEMSIZE * PAGE_SIZE) {
pr_err("template (%u) too big for tvmem (%lu)\n",
@@ -644,7 +651,7 @@ static void test_aead_speed(const char *algo, int enc, unsigned int secs,
assoc, aad_size);
sg_init_aead(sgout, xoutbuf,
- bs + (enc ? authsize : 0), assoc,
+ bs + (enc ? authsize : 0), assoc_out,
aad_size);
aead_request_set_ad(req, aad_size);
@@ -666,6 +673,9 @@ static void test_aead_speed(const char *algo, int enc, unsigned int secs,
ret);
break;
}
+
+ memset(assoc, 0xff, aad_size);
+ memset(assoc_out, 0xff, aad_size);
}
aead_request_set_crypt(req, sg, sgout,
@@ -1983,6 +1993,10 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
ret += tcrypt_test("hmac(streebog512)");
break;
+ case 117:
+ ret += tcrypt_test("rsa");
+ break;
+
case 150:
ret += tcrypt_test("ansi_cprng");
break;
@@ -2059,6 +2073,12 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
ret += tcrypt_test("cfb(sm4)");
ret += tcrypt_test("ctr(sm4)");
break;
+ case 192:
+ ret += tcrypt_test("tls11(hmac(sha1),cbc(aes))");
+ break;
+ case 193:
+ ret += tcrypt_test("tls12(hmac(sha256),cbc(aes))");
+ break;
case 200:
test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0,
speed_template_16_24_32);