s390/pkey: add support for ecc clear key
authorHarald Freudenberger <freude@linux.ibm.com>
Sat, 1 Apr 2023 16:26:06 +0000 (18:26 +0200)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Thu, 1 Jun 2023 15:10:21 +0000 (17:10 +0200)
commit9e436c195e2d6d3a0db6921e14ef2c85e559ae5b
treea0ad1d2baad99a786fe2c448930ecfb6344fa880
parentf370f45c6475ad0058277ae111f28fb32f58aa46
s390/pkey: add support for ecc clear key

Add support for a new 'non CCA clear key token' with these
ECC clear keys supported:

- ECC P256
- ECC P384
- ECC P521
- ECC ED25519
- ECC ED448

This makes it possible to derive a protected key from this
ECC clear key input via PKEY_KBLOB2PROTK3 ioctl. As of now
the only way to derive protected keys from these clear key
tokens is via PCKMO instruction. For AES keys an alternate
path via creating a secure key from the clear key and then
derive a protected key from the secure key exists. This
alternate path is not implemented for ECC keys as it would
require to rearrange and maybe recalculate the clear key
material for input to derive an CCA or EP11 ECC secure key.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
arch/s390/include/asm/cpacf.h
arch/s390/include/uapi/asm/pkey.h
drivers/s390/crypto/pkey_api.c