aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/tcrypt.c
diff options
context:
space:
mode:
authorNoriaki TAKAMIYA <takamiya@po.ntts.co.jp>2007-01-24 05:48:19 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2007-02-06 17:21:04 -0500
commit02ab5a7056bd8441ba6ae8ba8662d4296c202ecb (patch)
tree082be6135a568adf899590ba00ea7ac14537f8b6 /crypto/tcrypt.c
parentd64beac050914de6fe6565741b39905ecd5994b7 (diff)
[CRYPTO] camellia: added the testing code of Camellia cipher
This patch adds the code of Camellia code for testing module. Signed-off-by: Noriaki TAKAMIYA <takamiya@po.ntts.co.jp> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/tcrypt.c')
-rw-r--r--crypto/tcrypt.c42
1 files changed, 41 insertions, 1 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 8c8e2f95dc7e..f5e9da319ece 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -73,7 +73,7 @@ static char *check[] = {
73 "twofish", "serpent", "sha384", "sha512", "md4", "aes", "cast6", 73 "twofish", "serpent", "sha384", "sha512", "md4", "aes", "cast6",
74 "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea", 74 "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea",
75 "khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt", 75 "khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt",
76 NULL 76 "camellia", NULL
77}; 77};
78 78
79static void hexdump(unsigned char *buf, unsigned int len) 79static void hexdump(unsigned char *buf, unsigned int len)
@@ -972,6 +972,20 @@ static void do_test(void)
972 test_cipher("pcbc(fcrypt)", DECRYPT, fcrypt_pcbc_dec_tv_template, 972 test_cipher("pcbc(fcrypt)", DECRYPT, fcrypt_pcbc_dec_tv_template,
973 FCRYPT_DEC_TEST_VECTORS); 973 FCRYPT_DEC_TEST_VECTORS);
974 974
975 //CAMELLIA
976 test_cipher("ecb(camellia)", ENCRYPT,
977 camellia_enc_tv_template,
978 CAMELLIA_ENC_TEST_VECTORS);
979 test_cipher("ecb(camellia)", DECRYPT,
980 camellia_dec_tv_template,
981 CAMELLIA_DEC_TEST_VECTORS);
982 test_cipher("cbc(camellia)", ENCRYPT,
983 camellia_cbc_enc_tv_template,
984 CAMELLIA_CBC_ENC_TEST_VECTORS);
985 test_cipher("cbc(camellia)", DECRYPT,
986 camellia_cbc_dec_tv_template,
987 CAMELLIA_CBC_DEC_TEST_VECTORS);
988
975 test_hash("sha384", sha384_tv_template, SHA384_TEST_VECTORS); 989 test_hash("sha384", sha384_tv_template, SHA384_TEST_VECTORS);
976 test_hash("sha512", sha512_tv_template, SHA512_TEST_VECTORS); 990 test_hash("sha512", sha512_tv_template, SHA512_TEST_VECTORS);
977 test_hash("wp512", wp512_tv_template, WP512_TEST_VECTORS); 991 test_hash("wp512", wp512_tv_template, WP512_TEST_VECTORS);
@@ -1196,6 +1210,21 @@ static void do_test(void)
1196 FCRYPT_DEC_TEST_VECTORS); 1210 FCRYPT_DEC_TEST_VECTORS);
1197 break; 1211 break;
1198 1212
1213 case 32:
1214 test_cipher("ecb(camellia)", ENCRYPT,
1215 camellia_enc_tv_template,
1216 CAMELLIA_ENC_TEST_VECTORS);
1217 test_cipher("ecb(camellia)", DECRYPT,
1218 camellia_dec_tv_template,
1219 CAMELLIA_DEC_TEST_VECTORS);
1220 test_cipher("cbc(camellia)", ENCRYPT,
1221 camellia_cbc_enc_tv_template,
1222 CAMELLIA_CBC_ENC_TEST_VECTORS);
1223 test_cipher("cbc(camellia)", DECRYPT,
1224 camellia_cbc_dec_tv_template,
1225 CAMELLIA_CBC_DEC_TEST_VECTORS);
1226 break;
1227
1199 case 100: 1228 case 100:
1200 test_hash("hmac(md5)", hmac_md5_tv_template, 1229 test_hash("hmac(md5)", hmac_md5_tv_template,
1201 HMAC_MD5_TEST_VECTORS); 1230 HMAC_MD5_TEST_VECTORS);
@@ -1289,6 +1318,17 @@ static void do_test(void)
1289 des_speed_template); 1318 des_speed_template);
1290 break; 1319 break;
1291 1320
1321 case 205:
1322 test_cipher_speed("ecb(camellia)", ENCRYPT, sec, NULL, 0,
1323 camellia_speed_template);
1324 test_cipher_speed("ecb(camellia)", DECRYPT, sec, NULL, 0,
1325 camellia_speed_template);
1326 test_cipher_speed("cbc(camellia)", ENCRYPT, sec, NULL, 0,
1327 camellia_speed_template);
1328 test_cipher_speed("cbc(camellia)", DECRYPT, sec, NULL, 0,
1329 camellia_speed_template);
1330 break;
1331
1292 case 300: 1332 case 300:
1293 /* fall through */ 1333 /* fall through */
1294 1334