summaryrefslogtreecommitdiff
path: root/crypto/tcrypt.c
diff options
context:
space:
mode:
authorNoriaki TAKAMIYA <takamiya@po.ntts.co.jp>2007-01-24 21:48:19 +1100
committerHerbert Xu <herbert@gondor.apana.org.au>2007-02-07 09:21:04 +1100
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[] = {
"twofish", "serpent", "sha384", "sha512", "md4", "aes", "cast6",
"arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea",
"khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt",
- NULL
+ "camellia", NULL
};
static void hexdump(unsigned char *buf, unsigned int len)
@@ -972,6 +972,20 @@ static void do_test(void)
test_cipher("pcbc(fcrypt)", DECRYPT, fcrypt_pcbc_dec_tv_template,
FCRYPT_DEC_TEST_VECTORS);
+ //CAMELLIA
+ test_cipher("ecb(camellia)", ENCRYPT,
+ camellia_enc_tv_template,
+ CAMELLIA_ENC_TEST_VECTORS);
+ test_cipher("ecb(camellia)", DECRYPT,
+ camellia_dec_tv_template,
+ CAMELLIA_DEC_TEST_VECTORS);
+ test_cipher("cbc(camellia)", ENCRYPT,
+ camellia_cbc_enc_tv_template,
+ CAMELLIA_CBC_ENC_TEST_VECTORS);
+ test_cipher("cbc(camellia)", DECRYPT,
+ camellia_cbc_dec_tv_template,
+ CAMELLIA_CBC_DEC_TEST_VECTORS);
+
test_hash("sha384", sha384_tv_template, SHA384_TEST_VECTORS);
test_hash("sha512", sha512_tv_template, SHA512_TEST_VECTORS);
test_hash("wp512", wp512_tv_template, WP512_TEST_VECTORS);
@@ -1196,6 +1210,21 @@ static void do_test(void)
FCRYPT_DEC_TEST_VECTORS);
break;
+ case 32:
+ test_cipher("ecb(camellia)", ENCRYPT,
+ camellia_enc_tv_template,
+ CAMELLIA_ENC_TEST_VECTORS);
+ test_cipher("ecb(camellia)", DECRYPT,
+ camellia_dec_tv_template,
+ CAMELLIA_DEC_TEST_VECTORS);
+ test_cipher("cbc(camellia)", ENCRYPT,
+ camellia_cbc_enc_tv_template,
+ CAMELLIA_CBC_ENC_TEST_VECTORS);
+ test_cipher("cbc(camellia)", DECRYPT,
+ camellia_cbc_dec_tv_template,
+ CAMELLIA_CBC_DEC_TEST_VECTORS);
+ break;
+
case 100:
test_hash("hmac(md5)", hmac_md5_tv_template,
HMAC_MD5_TEST_VECTORS);
@@ -1289,6 +1318,17 @@ static void do_test(void)
des_speed_template);
break;
+ case 205:
+ test_cipher_speed("ecb(camellia)", ENCRYPT, sec, NULL, 0,
+ camellia_speed_template);
+ test_cipher_speed("ecb(camellia)", DECRYPT, sec, NULL, 0,
+ camellia_speed_template);
+ test_cipher_speed("cbc(camellia)", ENCRYPT, sec, NULL, 0,
+ camellia_speed_template);
+ test_cipher_speed("cbc(camellia)", DECRYPT, sec, NULL, 0,
+ camellia_speed_template);
+ break;
+
case 300:
/* fall through */