diff options
author | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
commit | 62b8c978ee6b8d135d9e7953221de58000dba986 (patch) | |
tree | 683b04b2e627f6710c22c151b23c8cc9a165315e /crypto/testmgr.c | |
parent | 78fd82238d0e5716578c326404184a27ba67fd6e (diff) | |
download | linux-fsl-qoriq-62b8c978ee6b8d135d9e7953221de58000dba986.tar.xz |
Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12
Diffstat (limited to 'crypto/testmgr.c')
-rw-r--r-- | crypto/testmgr.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 7795550..e091ef6 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c @@ -179,7 +179,7 @@ static int do_one_async_hash_op(struct ahash_request *req, ret = wait_for_completion_interruptible(&tr->completion); if (!ret) ret = tr->err; - reinit_completion(&tr->completion); + INIT_COMPLETION(tr->completion); } return ret; } @@ -336,7 +336,7 @@ static int __test_hash(struct crypto_ahash *tfm, struct hash_testvec *template, ret = wait_for_completion_interruptible( &tresult.completion); if (!ret && !(ret = tresult.err)) { - reinit_completion(&tresult.completion); + INIT_COMPLETION(tresult.completion); break; } /* fall through */ @@ -503,16 +503,16 @@ static int __test_aead(struct crypto_aead *tfm, int enc, goto out; } + sg_init_one(&sg[0], input, + template[i].ilen + (enc ? authsize : 0)); + if (diff_dst) { output = xoutbuf[0]; output += align_offset; - sg_init_one(&sg[0], input, template[i].ilen); sg_init_one(&sgout[0], output, - template[i].rlen); - } else { - sg_init_one(&sg[0], input, template[i].ilen + (enc ? authsize : 0)); + } else { output = input; } @@ -543,7 +543,7 @@ static int __test_aead(struct crypto_aead *tfm, int enc, ret = wait_for_completion_interruptible( &result.completion); if (!ret && !(ret = result.err)) { - reinit_completion(&result.completion); + INIT_COMPLETION(result.completion); break; } case -EBADMSG: @@ -612,6 +612,12 @@ static int __test_aead(struct crypto_aead *tfm, int enc, memcpy(q, template[i].input + temp, template[i].tap[k]); + n = template[i].tap[k]; + if (k == template[i].np - 1 && enc) + n += authsize; + if (offset_in_page(q) + n < PAGE_SIZE) + q[n] = 0; + sg_set_buf(&sg[k], q, template[i].tap[k]); if (diff_dst) { @@ -619,17 +625,13 @@ static int __test_aead(struct crypto_aead *tfm, int enc, offset_in_page(IDX[k]); memset(q, 0, template[i].tap[k]); + if (offset_in_page(q) + n < PAGE_SIZE) + q[n] = 0; sg_set_buf(&sgout[k], q, template[i].tap[k]); } - n = template[i].tap[k]; - if (k == template[i].np - 1 && enc) - n += authsize; - if (offset_in_page(q) + n < PAGE_SIZE) - q[n] = 0; - temp += template[i].tap[k]; } @@ -648,10 +650,10 @@ static int __test_aead(struct crypto_aead *tfm, int enc, goto out; } + sg[k - 1].length += authsize; + if (diff_dst) sgout[k - 1].length += authsize; - else - sg[k - 1].length += authsize; } sg_init_table(asg, template[i].anp); @@ -695,7 +697,7 @@ static int __test_aead(struct crypto_aead *tfm, int enc, ret = wait_for_completion_interruptible( &result.completion); if (!ret && !(ret = result.err)) { - reinit_completion(&result.completion); + INIT_COMPLETION(result.completion); break; } case -EBADMSG: @@ -981,7 +983,7 @@ static int __test_skcipher(struct crypto_ablkcipher *tfm, int enc, ret = wait_for_completion_interruptible( &result.completion); if (!ret && !((ret = result.err))) { - reinit_completion(&result.completion); + INIT_COMPLETION(result.completion); break; } /* fall through */ @@ -1084,7 +1086,7 @@ static int __test_skcipher(struct crypto_ablkcipher *tfm, int enc, ret = wait_for_completion_interruptible( &result.completion); if (!ret && !((ret = result.err))) { - reinit_completion(&result.completion); + INIT_COMPLETION(result.completion); break; } /* fall through */ |