s390/zcrypt: Add low level functions for CCA AES cipher keys
authorHarald Freudenberger <freude@linux.ibm.com>
Wed, 3 Jul 2019 11:16:51 +0000 (13:16 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 21 Aug 2019 10:58:54 +0000 (12:58 +0200)
commit4bc123b18ce6ae6c42c69d0456b5acbd2f7bc8bd
treed61d54197d0e56b2df201270b281940846d43c5b
parent4da57a2fea064f662c29e77da043baebb8d6cdc8
s390/zcrypt: Add low level functions for CCA AES cipher keys

This patch adds low level functions, structs and defines to support
CCA AES cipher keys:
- struct cipherkeytoken can be used for an inside view of the CCA AES
  cipher key token blob.
- function cca_cipher2protkey() derives an CPACF protected key from an
  CCA AES cipher key.
- function cca_gencipherkey() generates an CCA AES cipher key with
  random value.
- function cca_findcard2() constructs a list of apqns based on input
  constrains like min hardware type, mkvp values.
- cca_check_secaescipherkey() does a check on the given CCA AES cipher
  key blob.
- cca_clr2cipherkey() generates an CCA AES cipher key from a given
  clear key value.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
drivers/s390/crypto/zcrypt_ccamisc.c
drivers/s390/crypto/zcrypt_ccamisc.h