X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=crypto%2Ftcrypt.c;h=24141fb6f5cba0639ae25ccca4d42a79bcd4d032;hb=d52b3815a52456dcf1a45fbc344e23bb643b2bda;hp=18d489c8b935f3834fdf72743d1e1ef0e2acd457;hpb=df3d80f5a5c74168be42788364d13cf6c83c7b9c;p=mv-sheeva.git diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 18d489c8b93..24141fb6f5c 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c @@ -139,7 +139,7 @@ static void test_hash(char *algo, struct hash_testvec *template, printk("test %u:\n", i + 1); memset(result, 0, 64); - sg_set_buf(&sg[0], hash_tv[i].plaintext, hash_tv[i].psize); + sg_init_one(&sg[0], hash_tv[i].plaintext, hash_tv[i].psize); if (hash_tv[i].ksize) { ret = crypto_hash_setkey(tfm, hash_tv[i].key, @@ -176,6 +176,7 @@ static void test_hash(char *algo, struct hash_testvec *template, memset(result, 0, 64); temp = 0; + sg_init_table(sg, hash_tv[i].np); for (k = 0; k < hash_tv[i].np; k++) { memcpy(&xbuf[IDX[k]], hash_tv[i].plaintext + temp, @@ -289,8 +290,8 @@ static void test_cipher(char *algo, int enc, goto out; } - sg_set_buf(&sg[0], cipher_tv[i].input, - cipher_tv[i].ilen); + sg_init_one(&sg[0], cipher_tv[i].input, + cipher_tv[i].ilen); ablkcipher_request_set_crypt(req, sg, sg, cipher_tv[i].ilen, @@ -317,7 +318,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", @@ -353,6 +354,7 @@ static void test_cipher(char *algo, int enc, } temp = 0; + sg_init_table(sg, cipher_tv[i].np); for (k = 0; k < cipher_tv[i].np; k++) { memcpy(&xbuf[IDX[k]], cipher_tv[i].input + temp, @@ -390,7 +392,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, @@ -414,7 +416,7 @@ static int test_cipher_jiffies(struct blkcipher_desc *desc, int enc, char *p, int bcount; int ret; - sg_set_buf(sg, p, blen); + sg_init_one(sg, p, blen); for (start = jiffies, end = start + sec * HZ, bcount = 0; time_before(jiffies, end); bcount++) { @@ -440,7 +442,7 @@ static int test_cipher_cycles(struct blkcipher_desc *desc, int enc, char *p, int ret = 0; int i; - sg_set_buf(sg, p, blen); + sg_init_one(sg, p, blen); local_bh_disable(); local_irq_disable(); @@ -570,6 +572,8 @@ static int test_hash_jiffies_digest(struct hash_desc *desc, char *p, int blen, int bcount; int ret; + sg_init_table(sg, 1); + for (start = jiffies, end = start + sec * HZ, bcount = 0; time_before(jiffies, end); bcount++) { sg_set_buf(sg, p, blen); @@ -595,6 +599,8 @@ static int test_hash_jiffies(struct hash_desc *desc, char *p, int blen, if (plen == blen) return test_hash_jiffies_digest(desc, p, blen, out, sec); + sg_init_table(sg, 1); + for (start = jiffies, end = start + sec * HZ, bcount = 0; time_before(jiffies, end); bcount++) { ret = crypto_hash_init(desc); @@ -626,6 +632,8 @@ static int test_hash_cycles_digest(struct hash_desc *desc, char *p, int blen, int i; int ret; + sg_init_table(sg, 1); + local_bh_disable(); local_irq_disable(); @@ -677,6 +685,8 @@ static int test_hash_cycles(struct hash_desc *desc, char *p, int blen, if (plen == blen) return test_hash_cycles_digest(desc, p, blen, out); + sg_init_table(sg, 1); + local_bh_disable(); local_irq_disable();