Skip to content

Commit 93f367a

Browse files
ebiggersherbertx
authored andcommitted
crypto: testmgr - stop checking crypto_ahash_alignmask
Now that the alignmask for ahash and shash algorithms is always 0, crypto_ahash_alignmask() always returns 0 and will be removed. In preparation for this, stop checking crypto_ahash_alignmask() in testmgr. As a result of this change, test_sg_division::offset_relative_to_alignmask and testvec_config::key_offset_relative_to_alignmask no longer have any effect on ahash (or shash) algorithms. Therefore, also stop setting these flags in default_hash_testvec_configs[]. Signed-off-by: Eric Biggers <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 03be4e4 commit 93f367a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

crypto/testmgr.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -408,17 +408,15 @@ static const struct testvec_config default_hash_testvec_configs[] = {
408408
.finalization_type = FINALIZATION_TYPE_FINAL,
409409
.key_offset = 1,
410410
}, {
411-
.name = "digest buffer aligned only to alignmask",
411+
.name = "digest misaligned buffer",
412412
.src_divs = {
413413
{
414414
.proportion_of_total = 10000,
415415
.offset = 1,
416-
.offset_relative_to_alignmask = true,
417416
},
418417
},
419418
.finalization_type = FINALIZATION_TYPE_DIGEST,
420419
.key_offset = 1,
421-
.key_offset_relative_to_alignmask = true,
422420
}, {
423421
.name = "init+update+update+final two even splits",
424422
.src_divs = {
@@ -1458,7 +1456,6 @@ static int test_ahash_vec_cfg(const struct hash_testvec *vec,
14581456
u8 *hashstate)
14591457
{
14601458
struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1461-
const unsigned int alignmask = crypto_ahash_alignmask(tfm);
14621459
const unsigned int digestsize = crypto_ahash_digestsize(tfm);
14631460
const unsigned int statesize = crypto_ahash_statesize(tfm);
14641461
const char *driver = crypto_ahash_driver_name(tfm);
@@ -1474,7 +1471,7 @@ static int test_ahash_vec_cfg(const struct hash_testvec *vec,
14741471
/* Set the key, if specified */
14751472
if (vec->ksize) {
14761473
err = do_setkey(crypto_ahash_setkey, tfm, vec->key, vec->ksize,
1477-
cfg, alignmask);
1474+
cfg, 0);
14781475
if (err) {
14791476
if (err == vec->setkey_error)
14801477
return 0;
@@ -1491,7 +1488,7 @@ static int test_ahash_vec_cfg(const struct hash_testvec *vec,
14911488
}
14921489

14931490
/* Build the scatterlist for the source data */
1494-
err = build_hash_sglist(tsgl, vec, cfg, alignmask, divs);
1491+
err = build_hash_sglist(tsgl, vec, cfg, 0, divs);
14951492
if (err) {
14961493
pr_err("alg: ahash: %s: error preparing scatterlist for test vector %s, cfg=\"%s\"\n",
14971494
driver, vec_name, cfg->name);

0 commit comments

Comments
 (0)