From: Harald Freudenberger <freude@linux.ibm.com>
To: dengler@linux.ibm.com, herbert@gondor.apana.org.au,
davem@davemloft.net, hca@linux.ibm.com
Cc: linux-s390@vger.kernel.org, linux-crypto@vger.kernel.org
Subject: [PATCH v3 0/3] New s390 specific protected key hmac
Date: Thu, 7 Nov 2024 15:55:18 +0100 [thread overview]
Message-ID: <20241107145521.424769-1-freude@linux.ibm.com> (raw)
Add support for protected key hmac ("phmac") for s390 arch.
With the latest machine generation there is now support for
protected key (that is a key wrapped by a master key stored
in firmware) hmac for sha2 (sha224, sha256, sha384 and sha512)
for the s390 specific CPACF instruction kmac.
This patch adds support via 4 new shashes registered as
phmac(sha224), phmac(sha256), phmac(sha384) and phmac(sha512).
Please note that as of now, there is no selftest enabled for
these shashes, but the implementation has been tested with
testcases via AF_ALG interface. However, there may come an
improvement soon to use the available clear key hmac selftests.
Changelog:
v1: Initial version
v2: Increase HASH_MAX_DESCSIZE generic (not just for arch s390).
Fix one finding to use kmemdup instead of kmalloc/memcpy
from test robot. Remove unneeded cpacf subfunctions checks.
Simplify clone_tfm() function.
Rebased to s390/features.
v3: Feedback from Herbert: Use GFP_ATOMIC in setkey function.
Feedback from Holger: rework tfm clone function, move
convert key invocation from setkey to init function.
Rebased to updated s390/features from 11/7/2024.
Ready for integration if there are no complains on v3.
Holger Dengler (3):
crypto: api - Adjust HASH_MAX_DESCSIZE for s390-phmac context
s390/crypto: Add protected key hmac subfunctions for KMAC
s390/crypto: New s390 specific shash phmac
arch/s390/configs/debug_defconfig | 1 +
arch/s390/configs/defconfig | 1 +
arch/s390/crypto/Makefile | 1 +
arch/s390/crypto/phmac_s390.c | 473 ++++++++++++++++++++++++++++++
arch/s390/include/asm/cpacf.h | 4 +
drivers/crypto/Kconfig | 12 +
include/crypto/hash.h | 5 +-
7 files changed, 494 insertions(+), 3 deletions(-)
create mode 100644 arch/s390/crypto/phmac_s390.c
base-commit: de786f0f83824eaa12aa92603be8655ec5d1a5bf
--
2.43.0
next reply other threads:[~2024-11-07 15:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-07 14:55 Harald Freudenberger [this message]
2024-11-07 14:55 ` [PATCH v3 1/3] crypto: api - Adjust HASH_MAX_DESCSIZE for s390-phmac context Harald Freudenberger
2024-11-07 14:55 ` [PATCH v3 2/3] s390/crypto: Add protected key hmac subfunctions for KMAC Harald Freudenberger
2024-11-07 14:55 ` [PATCH v3 3/3] s390/crypto: New s390 specific shash phmac Harald Freudenberger
2024-11-11 12:13 ` Ingo Franzki
2024-11-12 1:34 ` Herbert Xu
2024-11-12 1:38 ` Herbert Xu
2024-11-12 12:45 ` Harald Freudenberger
2024-11-14 11:17 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241107145521.424769-1-freude@linux.ibm.com \
--to=freude@linux.ibm.com \
--cc=davem@davemloft.net \
--cc=dengler@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox