serial: PL011: clear pending interrupts
[linux-flexiantxendom0.git] / crypto / testmgr.c
index 5c8aaa0..e91c1eb 100644 (file)
@@ -6,6 +6,13 @@
  * Copyright (c) 2007 Nokia Siemens Networks
  * Copyright (c) 2008 Herbert Xu <herbert@gondor.apana.org.au>
  *
+ * Updated RFC4106 AES-GCM testing.
+ *    Authors: Aidan O'Mahony (aidan.o.mahony@intel.com)
+ *             Adrian Hoban <adrian.hoban@intel.com>
+ *             Gabriele Paoloni <gabriele.paoloni@intel.com>
+ *             Tadeusz Struk (tadeusz.struk@intel.com)
+ *    Copyright (c) 2010, Intel Corporation.
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
 #include <crypto/rng.h>
 
 #include "internal.h"
+
+#ifdef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS
+
+/* a perfect nop */
+int alg_test(const char *driver, const char *alg, u32 type, u32 mask)
+{
+       return 0;
+}
+
+#else
+
 #include "testmgr.h"
 
 /*
@@ -1738,6 +1756,36 @@ static const struct alg_test_desc alg_test_descs[] = {
                        }
                }
        }, {
+               .alg = "ctr(blowfish)",
+               .test = alg_test_skcipher,
+               .suite = {
+                       .cipher = {
+                               .enc = {
+                                       .vecs = bf_ctr_enc_tv_template,
+                                       .count = BF_CTR_ENC_TEST_VECTORS
+                               },
+                               .dec = {
+                                       .vecs = bf_ctr_dec_tv_template,
+                                       .count = BF_CTR_DEC_TEST_VECTORS
+                               }
+                       }
+               }
+       }, {
+               .alg = "ctr(twofish)",
+               .test = alg_test_skcipher,
+               .suite = {
+                       .cipher = {
+                               .enc = {
+                                       .vecs = tf_ctr_enc_tv_template,
+                                       .count = TF_CTR_ENC_TEST_VECTORS
+                               },
+                               .dec = {
+                                       .vecs = tf_ctr_dec_tv_template,
+                                       .count = TF_CTR_DEC_TEST_VECTORS
+                               }
+                       }
+               }
+       }, {
                .alg = "cts(cbc(aes))",
                .test = alg_test_skcipher,
                .suite = {
@@ -2059,6 +2107,7 @@ static const struct alg_test_desc alg_test_descs[] = {
        }, {
                .alg = "ghash",
                .test = alg_test_hash,
+               .fips_allowed = 1,
                .suite = {
                        .hash = {
                                .vecs = ghash_tv_template,
@@ -2200,6 +2249,22 @@ static const struct alg_test_desc alg_test_descs[] = {
                        }
                }
        }, {
+               .alg = "ofb(aes)",
+               .test = alg_test_skcipher,
+               .fips_allowed = 1,
+               .suite = {
+                       .cipher = {
+                               .enc = {
+                                       .vecs = aes_ofb_enc_tv_template,
+                                       .count = AES_OFB_ENC_TEST_VECTORS
+                               },
+                               .dec = {
+                                       .vecs = aes_ofb_dec_tv_template,
+                                       .count = AES_OFB_DEC_TEST_VECTORS
+                               }
+                       }
+               }
+       }, {
                .alg = "pcbc(fcrypt)",
                .test = alg_test_skcipher,
                .suite = {
@@ -2231,6 +2296,23 @@ static const struct alg_test_desc alg_test_descs[] = {
                        }
                }
        }, {
+               .alg = "rfc4106(gcm(aes))",
+               .test = alg_test_aead,
+               .suite = {
+                       .aead = {
+                               .enc = {
+                                       .vecs = aes_gcm_rfc4106_enc_tv_template,
+                                       .count = AES_GCM_4106_ENC_TEST_VECTORS
+                               },
+                               .dec = {
+                                       .vecs = aes_gcm_rfc4106_dec_tv_template,
+                                       .count = AES_GCM_4106_DEC_TEST_VECTORS
+                               }
+                       }
+               }
+       }, {
+
+
                .alg = "rfc4309(ccm(aes))",
                .test = alg_test_aead,
                .fips_allowed = 1,
@@ -2418,6 +2500,7 @@ static const struct alg_test_desc alg_test_descs[] = {
        }, {
                .alg = "xts(aes)",
                .test = alg_test_skcipher,
+               .fips_allowed = 1,
                .suite = {
                        .cipher = {
                                .enc = {
@@ -2530,4 +2613,7 @@ notest:
 non_fips_alg:
        return -EINVAL;
 }
+
+#endif /* CONFIG_CRYPTO_MANAGER_DISABLE_TESTS */
+
 EXPORT_SYMBOL_GPL(alg_test);