int bcount;
int ret;
+ sg_init_table(sg, 1);
+
for (start = jiffies, end = start + sec * HZ, bcount = 0;
time_before(jiffies, end); bcount++) {
- sg_init_one(sg, p, blen);
+ sg_set_buf(sg, p, blen);
ret = crypto_hash_digest(desc, sg, blen, out);
if (ret)
return ret;
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);
if (ret)
return ret;
for (pcount = 0; pcount < blen; pcount += plen) {
- sg_init_one(sg, p + pcount, plen);
+ sg_set_buf(sg, p + pcount, plen);
ret = crypto_hash_update(desc, sg, plen);
if (ret)
return ret;
int i;
int ret;
+ sg_init_table(sg, 1);
+
local_bh_disable();
local_irq_disable();
/* Warm-up run. */
for (i = 0; i < 4; i++) {
- sg_init_one(sg, p, blen);
+ sg_set_buf(sg, p, blen);
ret = crypto_hash_digest(desc, sg, blen, out);
if (ret)
goto out;
start = get_cycles();
- sg_init_one(sg, p, blen);
+ sg_set_buf(sg, p, blen);
ret = crypto_hash_digest(desc, sg, blen, out);
if (ret)
goto out;
if (plen == blen)
return test_hash_cycles_digest(desc, p, blen, out);
+ sg_init_table(sg, 1);
+
local_bh_disable();
local_irq_disable();
if (ret)
goto out;
for (pcount = 0; pcount < blen; pcount += plen) {
- sg_init_one(sg, p + pcount, plen);
+ sg_set_buf(sg, p + pcount, plen);
ret = crypto_hash_update(desc, sg, plen);
if (ret)
goto out;
if (ret)
goto out;
for (pcount = 0; pcount < blen; pcount += plen) {
- sg_init_one(sg, p + pcount, plen);
+ sg_set_buf(sg, p + pcount, plen);
ret = crypto_hash_update(desc, sg, plen);
if (ret)
goto out;