crypto: aead - Add common IV generation code
[deliverable/linux.git] / crypto / tcrypt.c
index 4b9e23fa42045d42fae1229f7cc9c9887ca4a275..2bff6130d80674f77266d159e3816c066862a3a8 100644 (file)
  *
  */
 
+#include <crypto/aead.h>
 #include <crypto/hash.h>
 #include <linux/err.h>
+#include <linux/fips.h>
 #include <linux/init.h>
 #include <linux/gfp.h>
 #include <linux/module.h>
@@ -34,7 +36,6 @@
 #include <linux/timex.h>
 #include <linux/interrupt.h>
 #include "tcrypt.h"
-#include "internal.h"
 
 /*
  * Need slab memory for testing (size in number of pages).
@@ -808,7 +809,7 @@ static int test_ahash_jiffies(struct ahash_request *req, int blen,
 
        for (start = jiffies, end = start + secs * HZ, bcount = 0;
             time_before(jiffies, end); bcount++) {
-               ret = crypto_ahash_init(req);
+               ret = do_one_ahash_op(req, crypto_ahash_init(req));
                if (ret)
                        return ret;
                for (pcount = 0; pcount < blen; pcount += plen) {
@@ -877,7 +878,7 @@ static int test_ahash_cycles(struct ahash_request *req, int blen,
 
        /* Warm-up run. */
        for (i = 0; i < 4; i++) {
-               ret = crypto_ahash_init(req);
+               ret = do_one_ahash_op(req, crypto_ahash_init(req));
                if (ret)
                        goto out;
                for (pcount = 0; pcount < blen; pcount += plen) {
@@ -896,7 +897,7 @@ static int test_ahash_cycles(struct ahash_request *req, int blen,
 
                start = get_cycles();
 
-               ret = crypto_ahash_init(req);
+               ret = do_one_ahash_op(req, crypto_ahash_init(req));
                if (ret)
                        goto out;
                for (pcount = 0; pcount < blen; pcount += plen) {
@@ -1155,9 +1156,9 @@ static void test_acipher_speed(const char *algo, int enc, unsigned int secs,
                                goto out_free_req;
                        }
 
-                       sg_init_table(sg, TVMEMSIZE);
-
                        k = *keysize + *b_size;
+                       sg_init_table(sg, DIV_ROUND_UP(k, PAGE_SIZE));
+
                        if (k > PAGE_SIZE) {
                                sg_set_buf(sg, tvmem[0] + *keysize,
                                   PAGE_SIZE - *keysize);
This page took 0.026856 seconds and 5 git commands to generate.