Skip to content

Commit 7cc5eb9

Browse files
ShuaiYuan21Yogaraj-Alamenda
authored andcommitted
Provider Support for DSA, DH, HKDF, PRF, SHA3 & aes-cbc
OpenSSL 3.0 Provider Support for algorithms DSA, DH, HKDF, PRF SHA-3 & aes-cbc. Bug Fixes in AES-GCM and fix core dump with debug. Signed-off-by: Yuan, Shuai <shuai.yuan@intel.com> Signed-off-by: Yogaraj Alamenda <yogarajx.alamenda@intel.com>
1 parent c51fc17 commit 7cc5eb9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+6070
-161
lines changed

Makefile.am

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,15 @@ if QAT_PROVIDER
3636
qat_prov_ciphers.c \
3737
qat_prov_kmgmt_ec.c \
3838
qat_prov_ecdsa.c \
39-
qat_prov_ecdh.c
39+
qat_prov_ecdh.c \
40+
qat_prov_dsa.c \
41+
qat_prov_kmgmt_dsa.c \
42+
qat_prov_dh.c \
43+
qat_prov_kmgmt_dh.c \
44+
qat_prov_hkdf.c \
45+
qat_prov_prf.c \
46+
qat_prov_cbc.c \
47+
qat_prov_sha3.c
4048

4149
endif
4250

configure.ac

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ else
544544
AC_MSG_NOTICE([Not Accelerating DH to Hardware])
545545
fi
546546

547-
if test "x$enable_qat_hw_prf" != "xno" -a "x$cflags_qat_hw" != "x" -a "x$cflags_openssl_3" = "x"
547+
if test "x$enable_qat_hw_prf" != "xno" -a "x$cflags_qat_hw" != "x"
548548
then
549549
enable_qat_hw_prf="-DENABLE_QAT_HW_PRF"
550550
AC_MSG_NOTICE([Accelerating PRF to Hardware])
@@ -553,7 +553,7 @@ else
553553
AC_MSG_NOTICE([Not Accelerating PRF to Hardware])
554554
fi
555555

556-
if test "x$enable_qat_hw_hkdf" = "xyes" -a "x$cflags_qat_hw" != "x" -a "x$cflags_openssl_3" = "x"
556+
if test "x$enable_qat_hw_hkdf" = "xyes" -a "x$cflags_qat_hw" != "x"
557557
then
558558
enable_qat_hw_hkdf="-DENABLE_QAT_HW_HKDF"
559559
AC_MSG_NOTICE([Accelerating HKDF to Hardware])
@@ -562,7 +562,7 @@ else
562562
AC_MSG_NOTICE([Not Accelerating HKDF to Hardware])
563563
fi
564564

565-
if test "x$enable_qat_hw_ciphers" != "xno" -a "x$cflags_qat_hw" != "x" -a "x$cflags_openssl_3" = "x"
565+
if test "x$enable_qat_hw_ciphers" != "xno" -a "x$cflags_qat_hw" != "x"
566566
then
567567
enable_qat_hw_ciphers="-DENABLE_QAT_HW_CIPHERS"
568568
AC_MSG_NOTICE([Accelerating CIPHERS to Hardware])

docs/limitations.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,8 @@
3838
due to the locks at engine_table_select in OpenSSL.
3939
* OpenSSL 1.1.1n introduced misleading error message(undefined symbol: EVP_PKEY_get_base_id)
4040
during engine load which can be ignored as it is not a real failure. Details of error
41-
message can be found [here] [1]
42-
[1]:https://github.com/openssl/openssl/issues/17962
41+
message can be found [here][1]
42+
* AES-CBC-HMAC-SHA chained ciphers does not support pipeline feature when built with
43+
OpenSSL 3.0 as the corresponding support is not available in OpenSSL 3.0.
44+
45+
[1]:https://github.com/openssl/openssl/issues/17962

docs/qat_common.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,29 @@ flags (eg:--enable-qat_sw_rsa) in which case the individual algorithms enabled
2121

2222
Intel&reg; QAT OpenSSL\* Engine supports Provider interface for OpenSSL 3.0.
2323
The qatprovider support can be enabled using configure flag `--enable-qat_provider`
24-
and the default if not specified will use engine interface. Currently RSA, ECDSA,
25-
ECDH, ECX and AES-GCM algorithms are only supported for both QAT_HW
26-
and QAT_SW. This support is added as an experimental feature and tested with
24+
and the default if not specified will use engine interface.
25+
26+
| Algorithms | Supported by |
27+
| :---: | :---: |
28+
| RSA | QAT_HW & QAT_SW |
29+
| ECDSA | QAT_HW & QAT_SW |
30+
| ECDH | QAT_HW & QAT_SW |
31+
| ECX | QAT_HW & QAT_SW |
32+
| AES-GCM | QAT_HW & QAT_SW |
33+
| DSA | QAT_HW |
34+
| DH | QAT_HW |
35+
| HKDF | QAT_HW |
36+
| PRF | QAT_HW |
37+
| AES128_CBC_HMAC_SHA1 | QAT_HW |
38+
| AES256_CBC_HMAC_SHA1 | QAT_HW |
39+
| AES128_CBC_HMAC_SHA256 | QAT_HW |
40+
| AES256_CBC_HMAC_SHA256 | QAT_HW |
41+
| SHA3-224 | QAT_HW |
42+
| SHA3-256 | QAT_HW |
43+
| SHA3-384 | QAT_HW |
44+
| SHA3-512 | QAT_HW |
45+
46+
This support is added as an experimental feature and tested with
2747
OpenSSL Speed and testapp only and not tested with any application.
2848

2949
Example OpenSSL Speed command to test using qatprovider:

qat_evp.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,12 +532,14 @@ const EVP_CIPHER *qat_create_gcm_cipher_meth(int nid, int keylen)
532532
#ifndef QAT_OPENSSL_PROVIDER
533533
res &= EVP_CIPHER_meth_set_init(c, vaesgcm_ciphers_init);
534534
res &= EVP_CIPHER_meth_set_do_cipher(c, vaesgcm_ciphers_do_cipher);
535-
#endif
536535
res &= EVP_CIPHER_meth_set_cleanup(c, vaesgcm_ciphers_cleanup);
536+
#endif
537537
res &= EVP_CIPHER_meth_set_impl_ctx_size(c, sizeof(vaesgcm_ctx));
538538
res &= EVP_CIPHER_meth_set_set_asn1_params(c, NULL);
539539
res &= EVP_CIPHER_meth_set_get_asn1_params(c, NULL);
540+
#ifndef QAT_OPENSSL_PROVIDER
540541
res &= EVP_CIPHER_meth_set_ctrl(c, vaesgcm_ciphers_ctrl);
542+
#endif
541543
qat_sw_gcm_offload = 1;
542544
DEBUG("QAT SW AES_GCM registration\n");
543545
}
@@ -558,14 +560,16 @@ const EVP_CIPHER *qat_create_gcm_cipher_meth(int nid, int keylen)
558560
#ifndef QAT_OPENSSL_PROVIDER
559561
res &= EVP_CIPHER_meth_set_init(c, qat_aes_gcm_init);
560562
res &= EVP_CIPHER_meth_set_do_cipher(c, qat_aes_gcm_cipher);
561-
#endif
562563
res &= EVP_CIPHER_meth_set_cleanup(c, qat_aes_gcm_cleanup);
564+
#endif
563565
res &= EVP_CIPHER_meth_set_impl_ctx_size(c, sizeof(qat_gcm_ctx));
564566
res &= EVP_CIPHER_meth_set_set_asn1_params(c, EVP_CIPH_FLAG_DEFAULT_ASN1 ?
565567
NULL : EVP_CIPHER_set_asn1_iv);
566568
res &= EVP_CIPHER_meth_set_get_asn1_params(c, EVP_CIPH_FLAG_DEFAULT_ASN1 ?
567569
NULL : EVP_CIPHER_get_asn1_iv);
570+
#ifndef QAT_OPENSSL_PROVIDER
568571
res &= EVP_CIPHER_meth_set_ctrl(c, qat_aes_gcm_ctrl);
572+
#endif
569573
qat_hw_gcm_offload = 1;
570574
DEBUG("QAT HW AES_GCM registration\n");
571575
}

0 commit comments

Comments
 (0)