mirror of
https://github.com/torvalds/linux.git
synced 2024-12-26 12:52:30 +00:00
crypto: testmgr - add ARIA testmgr tests
It contains ARIA ecb(aria), cbc(aria), cfb(aria), ctr(aria), and gcm(aria). ecb testvector is from RFC standard. cbc, cfb, and ctr testvectors are from KISA[1], who developed ARIA algorithm. gcm(aria) is from openssl test vector. [1] https://seed.kisa.or.kr/kisa/kcmvp/EgovVerification.do (Korean) Signed-off-by: Taehee Yoo <ap420073@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
e4e712bbbd
commit
01ce31de70
@ -71,7 +71,7 @@ static const char *check[] = {
|
||||
"blowfish", "twofish", "serpent", "sha384", "sha512", "md4", "aes",
|
||||
"cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea",
|
||||
"khazad", "wp512", "wp384", "wp256", "xeta", "fcrypt",
|
||||
"camellia", "seed", "rmd160",
|
||||
"camellia", "seed", "rmd160", "aria",
|
||||
"lzo", "lzo-rle", "cts", "sha3-224", "sha3-256", "sha3-384",
|
||||
"sha3-512", "streebog256", "streebog512",
|
||||
NULL
|
||||
@ -1730,6 +1730,10 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
|
||||
ret += tcrypt_test("polyval");
|
||||
break;
|
||||
|
||||
case 58:
|
||||
ret += tcrypt_test("gcm(aria)");
|
||||
break;
|
||||
|
||||
case 100:
|
||||
ret += tcrypt_test("hmac(md5)");
|
||||
break;
|
||||
@ -1866,6 +1870,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("ecb(aria)");
|
||||
ret += tcrypt_test("cbc(aria)");
|
||||
ret += tcrypt_test("cfb(aria)");
|
||||
ret += tcrypt_test("ctr(aria)");
|
||||
break;
|
||||
case 200:
|
||||
test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0,
|
||||
speed_template_16_24_32);
|
||||
@ -2192,6 +2202,32 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
|
||||
0, speed_template_32);
|
||||
break;
|
||||
|
||||
case 227:
|
||||
test_cipher_speed("ecb(aria)", ENCRYPT, sec, NULL, 0,
|
||||
speed_template_16_24_32);
|
||||
test_cipher_speed("ecb(aria)", DECRYPT, sec, NULL, 0,
|
||||
speed_template_16_24_32);
|
||||
test_cipher_speed("cbc(aria)", ENCRYPT, sec, NULL, 0,
|
||||
speed_template_16_24_32);
|
||||
test_cipher_speed("cbc(aria)", DECRYPT, sec, NULL, 0,
|
||||
speed_template_16_24_32);
|
||||
test_cipher_speed("cfb(aria)", ENCRYPT, sec, NULL, 0,
|
||||
speed_template_16_24_32);
|
||||
test_cipher_speed("cfb(aria)", DECRYPT, sec, NULL, 0,
|
||||
speed_template_16_24_32);
|
||||
test_cipher_speed("ctr(aria)", ENCRYPT, sec, NULL, 0,
|
||||
speed_template_16_24_32);
|
||||
test_cipher_speed("ctr(aria)", DECRYPT, sec, NULL, 0,
|
||||
speed_template_16_24_32);
|
||||
break;
|
||||
|
||||
case 228:
|
||||
test_aead_speed("gcm(aria)", ENCRYPT, sec,
|
||||
NULL, 0, 16, 8, speed_template_16_24_32);
|
||||
test_aead_speed("gcm(aria)", DECRYPT, sec,
|
||||
NULL, 0, 16, 8, speed_template_16_24_32);
|
||||
break;
|
||||
|
||||
case 300:
|
||||
if (alg) {
|
||||
test_hash_speed(alg, sec, generic_hash_speed_template);
|
||||
|
@ -4388,6 +4388,12 @@ static const struct alg_test_desc alg_test_descs[] = {
|
||||
.suite = {
|
||||
.cipher = __VECS(anubis_cbc_tv_template)
|
||||
},
|
||||
}, {
|
||||
.alg = "cbc(aria)",
|
||||
.test = alg_test_skcipher,
|
||||
.suite = {
|
||||
.cipher = __VECS(aria_cbc_tv_template)
|
||||
},
|
||||
}, {
|
||||
.alg = "cbc(blowfish)",
|
||||
.test = alg_test_skcipher,
|
||||
@ -4505,6 +4511,12 @@ static const struct alg_test_desc alg_test_descs[] = {
|
||||
.suite = {
|
||||
.cipher = __VECS(aes_cfb_tv_template)
|
||||
},
|
||||
}, {
|
||||
.alg = "cfb(aria)",
|
||||
.test = alg_test_skcipher,
|
||||
.suite = {
|
||||
.cipher = __VECS(aria_cfb_tv_template)
|
||||
},
|
||||
}, {
|
||||
.alg = "cfb(sm4)",
|
||||
.test = alg_test_skcipher,
|
||||
@ -4574,6 +4586,12 @@ static const struct alg_test_desc alg_test_descs[] = {
|
||||
.suite = {
|
||||
.cipher = __VECS(aes_ctr_tv_template)
|
||||
}
|
||||
}, {
|
||||
.alg = "ctr(aria)",
|
||||
.test = alg_test_skcipher,
|
||||
.suite = {
|
||||
.cipher = __VECS(aria_ctr_tv_template)
|
||||
}
|
||||
}, {
|
||||
.alg = "ctr(blowfish)",
|
||||
.test = alg_test_skcipher,
|
||||
@ -4834,6 +4852,12 @@ static const struct alg_test_desc alg_test_descs[] = {
|
||||
.suite = {
|
||||
.cipher = __VECS(arc4_tv_template)
|
||||
}
|
||||
}, {
|
||||
.alg = "ecb(aria)",
|
||||
.test = alg_test_skcipher,
|
||||
.suite = {
|
||||
.cipher = __VECS(aria_tv_template)
|
||||
}
|
||||
}, {
|
||||
.alg = "ecb(blowfish)",
|
||||
.test = alg_test_skcipher,
|
||||
@ -5050,6 +5074,13 @@ static const struct alg_test_desc alg_test_descs[] = {
|
||||
.suite = {
|
||||
.aead = __VECS(aes_gcm_tv_template)
|
||||
}
|
||||
}, {
|
||||
.alg = "gcm(aria)",
|
||||
.generic_driver = "gcm_base(ctr(aria-generic),ghash-generic)",
|
||||
.test = alg_test_aead,
|
||||
.suite = {
|
||||
.aead = __VECS(aria_gcm_tv_template)
|
||||
}
|
||||
}, {
|
||||
.alg = "gcm(sm4)",
|
||||
.generic_driver = "gcm_base(ctr(sm4-generic),ghash-generic)",
|
||||
|
2860
crypto/testmgr.h
2860
crypto/testmgr.h
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user