]> err.no Git - linux-2.6/blobdiff - crypto/tcrypt.c
Pull c2 into release branch
[linux-2.6] / crypto / tcrypt.c
index ff489423b2cff394bdff9a3a741bcb0fd267138f..f5e9da319ece70cf6823a94947c3ee4f08273d89 100644 (file)
@@ -72,7 +72,8 @@ static char *check[] = {
        "des", "md5", "des3_ede", "rot13", "sha1", "sha256", "blowfish",
        "twofish", "serpent", "sha384", "sha512", "md4", "aes", "cast6",
        "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea",
-       "khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", NULL
+       "khazad", "wp512", "wp384", "wp256", "tnepres", "xeta",  "fcrypt",
+       "camellia", NULL
 };
 
 static void hexdump(unsigned char *buf, unsigned int len)
@@ -766,7 +767,7 @@ static void test_deflate(void)
        memcpy(tvmem, deflate_comp_tv_template, tsize);
        tv = (void *)tvmem;
 
-       tfm = crypto_alloc_tfm("deflate", 0);
+       tfm = crypto_alloc_comp("deflate", 0, CRYPTO_ALG_ASYNC);
        if (tfm == NULL) {
                printk("failed to load transform for deflate\n");
                return;
@@ -965,6 +966,26 @@ static void do_test(void)
                test_cipher("ecb(xeta)", DECRYPT, xeta_dec_tv_template,
                            XETA_DEC_TEST_VECTORS);
 
+               //FCrypt
+               test_cipher("pcbc(fcrypt)", ENCRYPT, fcrypt_pcbc_enc_tv_template,
+                           FCRYPT_ENC_TEST_VECTORS);
+               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);
@@ -1182,6 +1203,28 @@ static void do_test(void)
                            XETA_DEC_TEST_VECTORS);
                break;
 
+       case 31:
+               test_cipher("pcbc(fcrypt)", ENCRYPT, fcrypt_pcbc_enc_tv_template,
+                           FCRYPT_ENC_TEST_VECTORS);
+               test_cipher("pcbc(fcrypt)", DECRYPT, fcrypt_pcbc_dec_tv_template,
+                           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);
@@ -1275,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 */