]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - crypto/testmgr.h
xfrm: state: simplify rcu_read_unlock handling in two spots
[mirror_ubuntu-artful-kernel.git] / crypto / testmgr.h
index acb6bbff781a2d3be030d69109912efe5e6b865f..9b656be7f52f9dab558a9667d3787fc9ddcf64a8 100644 (file)
@@ -59,6 +59,7 @@ struct hash_testvec {
  * @tap:       How to distribute data in @np SGs
  * @also_non_np:       if set to 1, the test will be also done without
  *                     splitting data in @np SGs
+ * @fips_skip: Skip the test vector in FIPS mode
  */
 
 struct cipher_testvec {
@@ -75,6 +76,7 @@ struct cipher_testvec {
        unsigned char klen;
        unsigned short ilen;
        unsigned short rlen;
+       bool fips_skip;
 };
 
 struct aead_testvec {
@@ -1332,36 +1334,50 @@ static struct hash_testvec rmd320_tv_template[] = {
        }
 };
 
-#define CRCT10DIF_TEST_VECTORS 3
+#define CRCT10DIF_TEST_VECTORS ARRAY_SIZE(crct10dif_tv_template)
 static struct hash_testvec crct10dif_tv_template[] = {
        {
-               .plaintext = "abc",
-               .psize  = 3,
-#ifdef __LITTLE_ENDIAN
-               .digest = "\x3b\x44",
-#else
-               .digest = "\x44\x3b",
-#endif
-       }, {
-               .plaintext = "1234567890123456789012345678901234567890"
-                            "123456789012345678901234567890123456789",
-               .psize  = 79,
-#ifdef __LITTLE_ENDIAN
-               .digest = "\x70\x4b",
-#else
-               .digest = "\x4b\x70",
-#endif
-       }, {
-               .plaintext =
-               "abcddddddddddddddddddddddddddddddddddddddddddddddddddddd",
-               .psize  = 56,
-#ifdef __LITTLE_ENDIAN
-               .digest = "\xe3\x9c",
-#else
-               .digest = "\x9c\xe3",
-#endif
-               .np     = 2,
-               .tap    = { 28, 28 }
+               .plaintext      = "abc",
+               .psize          = 3,
+               .digest         = (u8 *)(u16 []){ 0x443b },
+       }, {
+               .plaintext      = "1234567890123456789012345678901234567890"
+                                 "123456789012345678901234567890123456789",
+               .psize          = 79,
+               .digest         = (u8 *)(u16 []){ 0x4b70 },
+               .np             = 2,
+               .tap            = { 63, 16 },
+       }, {
+               .plaintext      = "abcdddddddddddddddddddddddddddddddddddddddd"
+                                 "ddddddddddddd",
+               .psize          = 56,
+               .digest         = (u8 *)(u16 []){ 0x9ce3 },
+               .np             = 8,
+               .tap            = { 1, 2, 28, 7, 6, 5, 4, 3 },
+       }, {
+               .plaintext      = "1234567890123456789012345678901234567890"
+                                 "1234567890123456789012345678901234567890"
+                                 "1234567890123456789012345678901234567890"
+                                 "1234567890123456789012345678901234567890"
+                                 "1234567890123456789012345678901234567890"
+                                 "1234567890123456789012345678901234567890"
+                                 "1234567890123456789012345678901234567890"
+                                 "123456789012345678901234567890123456789",
+               .psize          = 319,
+               .digest         = (u8 *)(u16 []){ 0x44c6 },
+       }, {
+               .plaintext      = "1234567890123456789012345678901234567890"
+                                 "1234567890123456789012345678901234567890"
+                                 "1234567890123456789012345678901234567890"
+                                 "1234567890123456789012345678901234567890"
+                                 "1234567890123456789012345678901234567890"
+                                 "1234567890123456789012345678901234567890"
+                                 "1234567890123456789012345678901234567890"
+                                 "123456789012345678901234567890123456789",
+               .psize          = 319,
+               .digest         = (u8 *)(u16 []){ 0x44c6 },
+               .np             = 4,
+               .tap            = { 1, 255, 57, 6 },
        }
 };
 
@@ -18224,6 +18240,7 @@ static struct cipher_testvec aes_xts_enc_tv_template[] = {
                          "\x00\x00\x00\x00\x00\x00\x00\x00"
                          "\x00\x00\x00\x00\x00\x00\x00\x00",
                .klen   = 32,
+               .fips_skip = 1,
                .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
                          "\x00\x00\x00\x00\x00\x00\x00\x00",
                .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
@@ -18566,6 +18583,7 @@ static struct cipher_testvec aes_xts_dec_tv_template[] = {
                          "\x00\x00\x00\x00\x00\x00\x00\x00"
                          "\x00\x00\x00\x00\x00\x00\x00\x00",
                .klen   = 32,
+               .fips_skip = 1,
                .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
                          "\x00\x00\x00\x00\x00\x00\x00\x00",
                .input = "\x91\x7c\xf6\x9e\xbd\x68\xb2\xec"