]> err.no Git - linux-2.6/blobdiff - crypto/tcrypt.c
keyspan: use request_firmware()
[linux-2.6] / crypto / tcrypt.c
index 30e75d49f35af2ffd9ad9b63ce57ca3c4e7f91f5..e47f6e02133c155622d477567d88f890489f151f 100644 (file)
@@ -82,9 +82,8 @@ static char *check[] = {
        "des", "md5", "des3_ede", "rot13", "sha1", "sha224", "sha256",
        "blowfish", "twofish", "serpent", "sha384", "sha512", "md4", "aes",
        "cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea",
-       "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea",
        "khazad", "wp512", "wp384", "wp256", "tnepres", "xeta",  "fcrypt",
-       "camellia", "seed", "salsa20", "lzo", NULL
+       "camellia", "seed", "salsa20", "lzo", "cts", NULL
 };
 
 static void hexdump(unsigned char *buf, unsigned int len)
@@ -587,12 +586,6 @@ static void test_cipher(char *algo, int enc,
        j = 0;
        for (i = 0; i < tcount; i++) {
 
-               data = kzalloc(template[i].ilen, GFP_KERNEL);
-               if (!data)
-                       continue;
-
-               memcpy(data, template[i].input, template[i].ilen);
-
                if (template[i].iv)
                        memcpy(iv, template[i].iv, MAX_IVLEN);
                else
@@ -614,10 +607,8 @@ static void test_cipher(char *algo, int enc,
                                printk("setkey() failed flags=%x\n",
                                                crypto_ablkcipher_get_flags(tfm));
 
-                               if (!template[i].fail) {
-                                       kfree(data);
+                               if (!template[i].fail)
                                        goto out;
-                               }
                        }
 
                        temp = 0;
@@ -1328,6 +1319,12 @@ static void do_test(void)
                test_cipher("ecb(seed)", DECRYPT, seed_dec_tv_template,
                            SEED_DEC_TEST_VECTORS);
 
+               //CTS
+               test_cipher("cts(cbc(aes))", ENCRYPT, cts_mode_enc_tv_template,
+                           CTS_MODE_ENC_TEST_VECTORS);
+               test_cipher("cts(cbc(aes))", DECRYPT, cts_mode_dec_tv_template,
+                           CTS_MODE_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);
@@ -1611,6 +1608,13 @@ static void do_test(void)
                          AES_CCM_DEC_TEST_VECTORS);
                break;
 
+       case 38:
+               test_cipher("cts(cbc(aes))", ENCRYPT, cts_mode_enc_tv_template,
+                           CTS_MODE_ENC_TEST_VECTORS);
+               test_cipher("cts(cbc(aes))", DECRYPT, cts_mode_dec_tv_template,
+                           CTS_MODE_DEC_TEST_VECTORS);
+               break;
+
        case 100:
                test_hash("hmac(md5)", hmac_md5_tv_template,
                          HMAC_MD5_TEST_VECTORS);
@@ -1798,7 +1802,7 @@ static void do_test(void)
        }
 }
 
-static int __init init(void)
+static int __init tcrypt_mod_init(void)
 {
        int err = -ENOMEM;
 
@@ -1837,10 +1841,10 @@ static int __init init(void)
  * If an init function is provided, an exit function must also be provided
  * to allow module unload.
  */
-static void __exit fini(void) { }
+static void __exit tcrypt_mod_fini(void) { }
 
-module_init(init);
-module_exit(fini);
+module_init(tcrypt_mod_init);
+module_exit(tcrypt_mod_fini);
 
 module_param(mode, int, 0);
 module_param(sec, uint, 0);