[CRYPTO] fcrypt: Add FCrypt from RxRPC
[linux-2.6-block.git] / crypto / tcrypt.c
index d671e8942b1f7d2c774a46a56aada52bf76dca39..57882c2c5f71f2a85d035283486f2ef556cf630a 100644 (file)
@@ -12,6 +12,7 @@
  * Software Foundation; either version 2 of the License, or (at your option)
  * any later version.
  *
+ * 2006-12-07 Added SHA384 HMAC and SHA512 HMAC tests
  * 2004-08-09 Added cipher speed tests (Reyk Floeter <reyk@vantronix.net>)
  * 2003-09-14 Rewritten by Kartikey Mahendra Bhatt
  *
@@ -71,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",
+       NULL
 };
 
 static void hexdump(unsigned char *buf, unsigned int len)
@@ -964,6 +966,12 @@ 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);
+
                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);
@@ -980,6 +988,10 @@ static void do_test(void)
                          HMAC_SHA1_TEST_VECTORS);
                test_hash("hmac(sha256)", hmac_sha256_tv_template,
                          HMAC_SHA256_TEST_VECTORS);
+               test_hash("hmac(sha384)", hmac_sha384_tv_template,
+                         HMAC_SHA384_TEST_VECTORS);
+               test_hash("hmac(sha512)", hmac_sha512_tv_template,
+                         HMAC_SHA512_TEST_VECTORS);
 
                test_hash("xcbc(aes)", aes_xcbc128_tv_template,
                          XCBC_AES_TEST_VECTORS);
@@ -1177,6 +1189,13 @@ 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 100:
                test_hash("hmac(md5)", hmac_md5_tv_template,
                          HMAC_MD5_TEST_VECTORS);
@@ -1192,6 +1211,16 @@ static void do_test(void)
                          HMAC_SHA256_TEST_VECTORS);
                break;
 
+       case 103:
+               test_hash("hmac(sha384)", hmac_sha384_tv_template,
+                         HMAC_SHA384_TEST_VECTORS);
+               break;
+
+       case 104:
+               test_hash("hmac(sha512)", hmac_sha512_tv_template,
+                         HMAC_SHA512_TEST_VECTORS);
+               break;
+
 
        case 200:
                test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0,