X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=crypto%2Ftcrypt.c;h=d741c63af42c501f357eb9d666de461265d9c6e8;hb=5f48b338cd28f4095697a174d7e3e72084aca893;hp=f0aed0106adb1cbf7068f93277857a8bd725e174;hpb=2d56d3c43cc97ae48586745556f5a5b564d61582;p=powerpc.git diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index f0aed0106a..d741c63af4 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c @@ -78,7 +78,7 @@ static char *check[] = { "twofish", "serpent", "sha384", "sha512", "md4", "aes", "cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea", "khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt", - "camellia", NULL + "camellia", "seed", NULL }; static void hexdump(unsigned char *buf, unsigned int len) @@ -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, @@ -691,7 +691,7 @@ static int test_hash_cycles(struct hash_desc *desc, char *p, int blen, if (ret) goto out; } - crypto_hash_final(desc, out); + ret = crypto_hash_final(desc, out); if (ret) goto out; } @@ -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, @@ -1029,6 +1033,12 @@ static void do_test(void) camellia_cbc_dec_tv_template, CAMELLIA_CBC_DEC_TEST_VECTORS); + //SEED + test_cipher("ecb(seed)", ENCRYPT, seed_enc_tv_template, + SEED_ENC_TEST_VECTORS); + test_cipher("ecb(seed)", DECRYPT, seed_dec_tv_template, + SEED_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); @@ -1132,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: @@ -1307,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: