summaryrefslogtreecommitdiffstats
path: root/crypto/s390x_arch.h
diff options
context:
space:
mode:
authorPatrick Steuer <patrick.steuer@de.ibm.com>2019-09-19 15:31:27 +0200
committerPatrick Steuer <patrick.steuer@de.ibm.com>2019-09-25 15:53:53 +0200
commit19bd1fa1ef17ff0ac071402cb6b002f1c29e37b9 (patch)
tree721bd78ca88377bc1246e656d3c2d9f30ac46021 /crypto/s390x_arch.h
parent2281be2ed4a7df462677661d30b13826ae6b3e26 (diff)
s390x assembly pack: accelerate X25519, X448, Ed25519 and Ed448
using PCC and KDSA instructions. Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10004)
Diffstat (limited to 'crypto/s390x_arch.h')
-rw-r--r--crypto/s390x_arch.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/crypto/s390x_arch.h b/crypto/s390x_arch.h
index bb69ed02c1..77f327d4de 100644
--- a/crypto/s390x_arch.h
+++ b/crypto/s390x_arch.h
@@ -30,6 +30,9 @@ int s390x_pcc(unsigned int fc, void *param);
int s390x_kdsa(unsigned int fc, void *param, const unsigned char *in,
size_t len);
+void s390x_flip_endian32(unsigned char dst[32], const unsigned char src[32]);
+void s390x_flip_endian64(unsigned char dst[64], const unsigned char src[64]);
+
/*
* The field elements of OPENSSL_s390xcap_P are the 64-bit words returned by
* the STFLE instruction followed by the 64-bit word pairs returned by
@@ -123,6 +126,10 @@ extern struct OPENSSL_s390xcap_st OPENSSL_s390xcap_P;
# define S390X_SCALAR_MULTIPLY_P256 64
# define S390X_SCALAR_MULTIPLY_P384 65
# define S390X_SCALAR_MULTIPLY_P521 66
+# define S390X_SCALAR_MULTIPLY_ED25519 72
+# define S390X_SCALAR_MULTIPLY_ED448 73
+# define S390X_SCALAR_MULTIPLY_X25519 80
+# define S390X_SCALAR_MULTIPLY_X448 81
/* kdsa */
# define S390X_ECDSA_VERIFY_P256 1
@@ -131,6 +138,10 @@ extern struct OPENSSL_s390xcap_st OPENSSL_s390xcap_P;
# define S390X_ECDSA_SIGN_P256 9
# define S390X_ECDSA_SIGN_P384 10
# define S390X_ECDSA_SIGN_P521 11
+# define S390X_EDDSA_VERIFY_ED25519 32
+# define S390X_EDDSA_VERIFY_ED448 36
+# define S390X_EDDSA_SIGN_ED25519 40
+# define S390X_EDDSA_SIGN_ED448 44
/* Register 0 Flags */
# define S390X_DECRYPT 0x80