diff options
author | Juergen Christ <jchrist@linux.ibm.com> | 2023-01-20 17:43:59 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-02-08 16:53:12 +0100 |
commit | 79040cf29e011c21789563d74da626b7465a0540 (patch) | |
tree | cf4db184af2d8fba461a64994a27635c41d1d51a /crypto/dh | |
parent | abf654645dee168b229f3fa6a365f6a8e4dd7c31 (diff) | |
download | openssl-new-79040cf29e011c21789563d74da626b7465a0540.tar.gz |
S390x: Support ME and CRT offloading
S390x has to ability to offload modular exponentiation and CRT operations to
Crypto Express Adapters. This possible performance optimization was not yet
used by OpenSSL. Add support for offloading and implement an optimized
version of RSA and DH with it.
The environment variable OPENSSL_s390xcap now recognizes the token "nocex" to
prevent offloading.
Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20113)
Diffstat (limited to 'crypto/dh')
-rw-r--r-- | crypto/dh/dh_key.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/dh/dh_key.c b/crypto/dh/dh_key.c index 0854395fc5..328780b9a9 100644 --- a/crypto/dh/dh_key.c +++ b/crypto/dh/dh_key.c @@ -184,7 +184,11 @@ static int dh_bn_mod_exp(const DH *dh, BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx) { +#ifdef S390X_MOD_EXP + return s390x_mod_exp(r, a, p, m, ctx, m_ctx); +#else return BN_mod_exp_mont(r, a, p, m, ctx, m_ctx); +#endif } static int dh_init(DH *dh) |