Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
[firefly-linux-kernel-4.4.55.git] / crypto / tcrypt.c
index de6435ea9bf81ad3f14f4f44d1580a697a5bd516..d741c63af42c501f357eb9d666de461265d9c6e8 100644 (file)
@@ -317,7 +317,7 @@ static void test_cipher(char *algo, int enc,
                                goto out;
                        }
 
-                       q = kmap(sg[0].page) + sg[0].offset;
+                       q = kmap(sg_page(&sg[0])) + sg[0].offset;
                        hexdump(q, cipher_tv[i].rlen);
 
                        printk("%s\n",
@@ -390,7 +390,7 @@ static void test_cipher(char *algo, int enc,
                        temp = 0;
                        for (k = 0; k < cipher_tv[i].np; k++) {
                                printk("page %u\n", k);
-                               q = kmap(sg[k].page) + sg[k].offset;
+                               q = kmap(sg_page(&sg[k])) + sg[k].offset;
                                hexdump(q, cipher_tv[i].tap[k]);
                                printk("%s\n",
                                        memcmp(q, cipher_tv[i].result + temp,
@@ -955,6 +955,10 @@ static void do_test(void)
                            AES_LRW_ENC_TEST_VECTORS);
                test_cipher("lrw(aes)", DECRYPT, aes_lrw_dec_tv_template,
                            AES_LRW_DEC_TEST_VECTORS);
+               test_cipher("xts(aes)", ENCRYPT, aes_xts_enc_tv_template,
+                           AES_XTS_ENC_TEST_VECTORS);
+               test_cipher("xts(aes)", DECRYPT, aes_xts_dec_tv_template,
+                           AES_XTS_DEC_TEST_VECTORS);
 
                //CAST5
                test_cipher("ecb(cast5)", ENCRYPT, cast5_enc_tv_template,
@@ -1138,6 +1142,10 @@ static void do_test(void)
                            AES_LRW_ENC_TEST_VECTORS);
                test_cipher("lrw(aes)", DECRYPT, aes_lrw_dec_tv_template,
                            AES_LRW_DEC_TEST_VECTORS);
+               test_cipher("xts(aes)", ENCRYPT, aes_xts_enc_tv_template,
+                           AES_XTS_ENC_TEST_VECTORS);
+               test_cipher("xts(aes)", DECRYPT, aes_xts_dec_tv_template,
+                           AES_XTS_DEC_TEST_VECTORS);
                break;
 
        case 11:
@@ -1313,6 +1321,10 @@ static void do_test(void)
                                  aes_lrw_speed_template);
                test_cipher_speed("lrw(aes)", DECRYPT, sec, NULL, 0,
                                  aes_lrw_speed_template);
+               test_cipher_speed("xts(aes)", ENCRYPT, sec, NULL, 0,
+                                 aes_xts_speed_template);
+               test_cipher_speed("xts(aes)", DECRYPT, sec, NULL, 0,
+                                 aes_xts_speed_template);
                break;
 
        case 201: