aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/testmgr.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 8fcea70ed267..e9e9d84293b9 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -180,7 +180,12 @@ static int test_hash(struct crypto_ahash *tfm, struct hash_testvec *template,
180 ahash_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG, 180 ahash_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG,
181 tcrypt_complete, &tresult); 181 tcrypt_complete, &tresult);
182 182
183 j = 0;
183 for (i = 0; i < tcount; i++) { 184 for (i = 0; i < tcount; i++) {
185 if (template[i].np)
186 continue;
187
188 j++;
184 memset(result, 0, 64); 189 memset(result, 0, 64);
185 190
186 hash_buff = xbuf[0]; 191 hash_buff = xbuf[0];
@@ -198,7 +203,7 @@ static int test_hash(struct crypto_ahash *tfm, struct hash_testvec *template,
198 template[i].ksize); 203 template[i].ksize);
199 if (ret) { 204 if (ret) {
200 printk(KERN_ERR "alg: hash: setkey failed on " 205 printk(KERN_ERR "alg: hash: setkey failed on "
201 "test %d for %s: ret=%d\n", i + 1, algo, 206 "test %d for %s: ret=%d\n", j, algo,
202 -ret); 207 -ret);
203 goto out; 208 goto out;
204 } 209 }
@@ -220,14 +225,14 @@ static int test_hash(struct crypto_ahash *tfm, struct hash_testvec *template,
220 /* fall through */ 225 /* fall through */
221 default: 226 default:
222 printk(KERN_ERR "alg: hash: digest failed on test %d " 227 printk(KERN_ERR "alg: hash: digest failed on test %d "
223 "for %s: ret=%d\n", i + 1, algo, -ret); 228 "for %s: ret=%d\n", j, algo, -ret);
224 goto out; 229 goto out;
225 } 230 }
226 231
227 if (memcmp(result, template[i].digest, 232 if (memcmp(result, template[i].digest,
228 crypto_ahash_digestsize(tfm))) { 233 crypto_ahash_digestsize(tfm))) {
229 printk(KERN_ERR "alg: hash: Test %d failed for %s\n", 234 printk(KERN_ERR "alg: hash: Test %d failed for %s\n",
230 i + 1, algo); 235 j, algo);
231 hexdump(result, crypto_ahash_digestsize(tfm)); 236 hexdump(result, crypto_ahash_digestsize(tfm));
232 ret = -EINVAL; 237 ret = -EINVAL;
233 goto out; 238 goto out;