Skip to content

Commit d2dec49

Browse files
fcalliesVasily Gorbik
authored andcommitted
s390/crypto: Add KDSA CPACF Instruction
Add the function code definitions for using the KDSA function to the CPACF header file. Suggested-by: Harald Freudenberger <freude@linux.ibm.com> Reviewed-by: Harald Freudenberger <freude@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Finn Callies <fcallies@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
1 parent ab22f8d commit d2dec49

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

arch/s390/include/asm/cpacf.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,27 @@
183183
#define CPACF_KLMD_DUFOP 0x4000
184184
#define CPACF_KLMD_NIP 0x8000
185185

186+
/*
187+
* Function codes for KDSA (COMPUTE DIGITAL SIGNATURE AUTHENTICATION)
188+
* instruction
189+
*/
190+
#define CPACF_KDSA_QUERY 0x00
191+
#define CPACF_KDSA_ECDSA_VERIFY_P256 0x01
192+
#define CPACF_KDSA_ECDSA_VERIFY_P384 0x02
193+
#define CPACF_KDSA_ECDSA_VERIFY_P521 0x03
194+
#define CPACF_KDSA_ECDSA_SIGN_P256 0x09
195+
#define CPACF_KDSA_ECDSA_SIGN_P384 0x0a
196+
#define CPACF_KDSA_ECDSA_SIGN_P521 0x0b
197+
#define CPACF_KDSA_ENC_ECDSA_SIGN_P256 0x11
198+
#define CPACF_KDSA_ENC_ECDSA_SIGN_P384 0x12
199+
#define CPACF_KDSA_ENC_ECDSA_SIGN_P521 0x13
200+
#define CPACF_KDSA_EDDSA_VERIFY_ED25519 0x20
201+
#define CPACF_KDSA_EDDSA_VERIFY_ED448 0x24
202+
#define CPACF_KDSA_EDDSA_SIGN_ED25519 0x28
203+
#define CPACF_KDSA_EDDSA_SIGN_ED448 0x2c
204+
#define CPACF_KDSA_ENC_EDDSA_SIGN_ED25519 0x30
205+
#define CPACF_KDSA_ENC_EDDSA_SIGN_ED448 0x34
206+
186207
typedef struct { unsigned char bytes[16]; } cpacf_mask_t;
187208

188209
/*
@@ -287,6 +308,8 @@ static __always_inline int __cpacf_check_opcode(unsigned int opcode)
287308
return test_facility(57); /* check for MSA5 */
288309
case CPACF_KMA:
289310
return test_facility(146); /* check for MSA8 */
311+
case CPACF_KDSA:
312+
return test_facility(155); /* check for MSA9 */
290313
default:
291314
__cpacf_bad_opcode();
292315
return 0;

0 commit comments

Comments
 (0)