提交 01ce31de 编写于 作者: T Taehee Yoo 提交者: Herbert Xu

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: NTaehee Yoo <ap420073@gmail.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 e4e712bb
...@@ -71,7 +71,7 @@ static const char *check[] = { ...@@ -71,7 +71,7 @@ static const char *check[] = {
"blowfish", "twofish", "serpent", "sha384", "sha512", "md4", "aes", "blowfish", "twofish", "serpent", "sha384", "sha512", "md4", "aes",
"cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea", "cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea",
"khazad", "wp512", "wp384", "wp256", "xeta", "fcrypt", "khazad", "wp512", "wp384", "wp256", "xeta", "fcrypt",
"camellia", "seed", "rmd160", "camellia", "seed", "rmd160", "aria",
"lzo", "lzo-rle", "cts", "sha3-224", "sha3-256", "sha3-384", "lzo", "lzo-rle", "cts", "sha3-224", "sha3-256", "sha3-384",
"sha3-512", "streebog256", "streebog512", "sha3-512", "streebog256", "streebog512",
NULL NULL
...@@ -1730,6 +1730,10 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) ...@@ -1730,6 +1730,10 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
ret += tcrypt_test("polyval"); ret += tcrypt_test("polyval");
break; break;
case 58:
ret += tcrypt_test("gcm(aria)");
break;
case 100: case 100:
ret += tcrypt_test("hmac(md5)"); ret += tcrypt_test("hmac(md5)");
break; break;
...@@ -1866,6 +1870,12 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) ...@@ -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("cfb(sm4)");
ret += tcrypt_test("ctr(sm4)"); ret += tcrypt_test("ctr(sm4)");
break; 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: case 200:
test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0, test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0,
speed_template_16_24_32); 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) ...@@ -2192,6 +2202,32 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
0, speed_template_32); 0, speed_template_32);
break; 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: case 300:
if (alg) { if (alg) {
test_hash_speed(alg, sec, generic_hash_speed_template); test_hash_speed(alg, sec, generic_hash_speed_template);
......
...@@ -4388,6 +4388,12 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -4388,6 +4388,12 @@ static const struct alg_test_desc alg_test_descs[] = {
.suite = { .suite = {
.cipher = __VECS(anubis_cbc_tv_template) .cipher = __VECS(anubis_cbc_tv_template)
}, },
}, {
.alg = "cbc(aria)",
.test = alg_test_skcipher,
.suite = {
.cipher = __VECS(aria_cbc_tv_template)
},
}, { }, {
.alg = "cbc(blowfish)", .alg = "cbc(blowfish)",
.test = alg_test_skcipher, .test = alg_test_skcipher,
...@@ -4505,6 +4511,12 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -4505,6 +4511,12 @@ static const struct alg_test_desc alg_test_descs[] = {
.suite = { .suite = {
.cipher = __VECS(aes_cfb_tv_template) .cipher = __VECS(aes_cfb_tv_template)
}, },
}, {
.alg = "cfb(aria)",
.test = alg_test_skcipher,
.suite = {
.cipher = __VECS(aria_cfb_tv_template)
},
}, { }, {
.alg = "cfb(sm4)", .alg = "cfb(sm4)",
.test = alg_test_skcipher, .test = alg_test_skcipher,
...@@ -4574,6 +4586,12 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -4574,6 +4586,12 @@ static const struct alg_test_desc alg_test_descs[] = {
.suite = { .suite = {
.cipher = __VECS(aes_ctr_tv_template) .cipher = __VECS(aes_ctr_tv_template)
} }
}, {
.alg = "ctr(aria)",
.test = alg_test_skcipher,
.suite = {
.cipher = __VECS(aria_ctr_tv_template)
}
}, { }, {
.alg = "ctr(blowfish)", .alg = "ctr(blowfish)",
.test = alg_test_skcipher, .test = alg_test_skcipher,
...@@ -4834,6 +4852,12 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -4834,6 +4852,12 @@ static const struct alg_test_desc alg_test_descs[] = {
.suite = { .suite = {
.cipher = __VECS(arc4_tv_template) .cipher = __VECS(arc4_tv_template)
} }
}, {
.alg = "ecb(aria)",
.test = alg_test_skcipher,
.suite = {
.cipher = __VECS(aria_tv_template)
}
}, { }, {
.alg = "ecb(blowfish)", .alg = "ecb(blowfish)",
.test = alg_test_skcipher, .test = alg_test_skcipher,
...@@ -5050,6 +5074,13 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -5050,6 +5074,13 @@ static const struct alg_test_desc alg_test_descs[] = {
.suite = { .suite = {
.aead = __VECS(aes_gcm_tv_template) .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)", .alg = "gcm(sm4)",
.generic_driver = "gcm_base(ctr(sm4-generic),ghash-generic)", .generic_driver = "gcm_base(ctr(sm4-generic),ghash-generic)",
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册