crypto: s390 - Add selftest support for phmac
authorHarald Freudenberger <freude@linux.ibm.com>
Tue, 17 Jun 2025 13:44:39 +0000 (15:44 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 26 Jun 2025 10:52:33 +0000 (18:52 +0800)
commitd48b2f5e82ea3888fb23659675c05f490899a293
tree98fcce004603273571fdbedbc2e80ea2871a1ee7
parentd0da164ba63dd6ff3696c565b118631a277822c3
crypto: s390 - Add selftest support for phmac

Add key preparation code in case of selftest running to the phmac
setkey function:

As long as crypto_ahash_tested() returns with false, all setkey()
invocations are assumed to carry sheer hmac clear key values and thus
need some preparation to work with the phmac implementation. Thus it
is possible to use the already available hmac test vectors implemented
in the testmanager to test the phmac code.

When crypto_ahash_tested() returns true (that is after larval state)
the phmac code assumes the key material is a blob digestible by the
pkey kernel module which converts the blob into a working key for the
phmac code.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/s390/crypto/phmac_s390.c