Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Eric Biggers and committed by
Herbert Xu
93f367a9 03be4e45

+3 -6
+3 -6
crypto/testmgr.c
··· 408 408 .finalization_type = FINALIZATION_TYPE_FINAL, 409 409 .key_offset = 1, 410 410 }, { 411 - .name = "digest buffer aligned only to alignmask", 411 + .name = "digest misaligned buffer", 412 412 .src_divs = { 413 413 { 414 414 .proportion_of_total = 10000, 415 415 .offset = 1, 416 - .offset_relative_to_alignmask = true, 417 416 }, 418 417 }, 419 418 .finalization_type = FINALIZATION_TYPE_DIGEST, 420 419 .key_offset = 1, 421 - .key_offset_relative_to_alignmask = true, 422 420 }, { 423 421 .name = "init+update+update+final two even splits", 424 422 .src_divs = { ··· 1456 1458 u8 *hashstate) 1457 1459 { 1458 1460 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); 1459 - const unsigned int alignmask = crypto_ahash_alignmask(tfm); 1460 1461 const unsigned int digestsize = crypto_ahash_digestsize(tfm); 1461 1462 const unsigned int statesize = crypto_ahash_statesize(tfm); 1462 1463 const char *driver = crypto_ahash_driver_name(tfm); ··· 1471 1474 /* Set the key, if specified */ 1472 1475 if (vec->ksize) { 1473 1476 err = do_setkey(crypto_ahash_setkey, tfm, vec->key, vec->ksize, 1474 - cfg, alignmask); 1477 + cfg, 0); 1475 1478 if (err) { 1476 1479 if (err == vec->setkey_error) 1477 1480 return 0; ··· 1488 1491 } 1489 1492 1490 1493 /* Build the scatterlist for the source data */ 1491 - err = build_hash_sglist(tsgl, vec, cfg, alignmask, divs); 1494 + err = build_hash_sglist(tsgl, vec, cfg, 0, divs); 1492 1495 if (err) { 1493 1496 pr_err("alg: ahash: %s: error preparing scatterlist for test vector %s, cfg=\"%s\"\n", 1494 1497 driver, vec_name, cfg->name);