Skip to content

Commit

Permalink
Update Multibuffer crypto library name and header path
Browse files Browse the repository at this point in the history
Change-Id: Id652b8c763efd29c1217843dcfa572b7867656f4
Signed-off-by: Yogaraj Alamenda <[email protected]>
  • Loading branch information
Yogaraj-Alamenda committed Apr 24, 2020
1 parent 2f55117 commit 5f8a773
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .tools/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ MAKE = make err-files && make
endif

install-data-am:
cp -L --remove-destination .libs/libqat.so $(ENGINE_LIB)
cp -f .libs/libqat.so $(ENGINE_LIB)

err-files:
if QAT_OPENSSL_102
Expand Down
8 changes: 4 additions & 4 deletions .tools/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ then
AC_CHECK_LIB(qat_s, cpaCyRsaDecrypt, [AC_MSG_NOTICE([QAT Offload with libraries from standard location])], [AC_MSG_NOTICE([QAT Library not found in the standard location])], [])
if test "x$ac_cv_lib_qat_s_cpaCyRsaDecrypt" = "xno"
then
AC_CHECK_LIB(crypto-mb, ifma_getversion, [AC_ARG_WITH(cflags_multibuff_offload, AS_HELP_STRING(), , cflags_multibuff_offload="-DOPENSSL_MULTIBUFF_OFFLOAD")], [AC_MSG_ERROR([Both QAT and Multibuff IFMA Library not found in the standard path. Install either QAT or IFMA library])], [])
AC_CHECK_LIB(crypto_mb, ifma_getversion, [AC_ARG_WITH(cflags_multibuff_offload, AS_HELP_STRING(), , cflags_multibuff_offload="-DOPENSSL_MULTIBUFF_OFFLOAD")], [AC_MSG_ERROR([Both QAT and Multibuff IFMA Library not found in the standard path. Install either QAT or IFMA library])], [])
AC_SUBST(cflags_multibuff_offload)
AM_CONDITIONAL([OPENSSL_MULTIBUFF_OFFLOAD], [test "x$ac_cv_lib_crypto_mb_ifma_getversion" = "xyes"])
fi
Expand Down Expand Up @@ -283,7 +283,7 @@ fi

if test "x$with_multibuff_install_dir" = "x" -a "x$cflags_multibuff_offload" != "x"
then
AC_CHECK_LIB(crypto-mb, ifma_getversion, [AC_MSG_NOTICE([Using from IFMA Library from Default location])], [AC_MSG_ERROR([IFMA Library not found, Install the IFMA library or provide the path to the library using --with-multibuff_install_dir])],[])
AC_CHECK_LIB(crypto_mb, ifma_getversion, [AC_MSG_NOTICE([Using from IFMA Library from Default location])], [AC_MSG_ERROR([IFMA Library not found, Install the IFMA library or provide the path to the library using --with-multibuff_install_dir])],[])
with_multibuff_install_dir="/usr/local/lib"
fi

Expand Down Expand Up @@ -595,7 +595,7 @@ AC_SUBST(with_ICP_LAC_API_DIR)
AC_ARG_WITH(includes_driver, AS_HELP_STRING(), , includes_driver="-I\$(with_ICP_API_DIR) -I\$(with_ICP_LAC_API_DIR) -I\$(with_ICP_SAL_API_DIR)")
AC_SUBST(includes_driver)

AC_ARG_WITH(includes_multibuff, AS_HELP_STRING(), , includes_multibuff="-I\$(with_multibuff_dir)/include/public")
AC_ARG_WITH(includes_multibuff, AS_HELP_STRING(), , includes_multibuff="-I\$(with_multibuff_dir)/include")
AC_SUBST(includes_multibuff)

AC_ARG_WITH(DRIVER, AS_HELP_STRING(), , DRIVER="qat")
Expand Down Expand Up @@ -650,7 +650,7 @@ fi

if test "x$with_multibuff_install_dir" != "x" -a "x$cflags_multibuff_offload" != "x"
then
AC_ARG_WITH(QAT_SHARED_LIB_DEPS_MULTIBUFF, AS_HELP_STRING(), , QAT_SHARED_LIB_DEPS_MULTIBUFF=["-Wl,-rpath,\$(with_multibuff_install_dir) -L\$(with_multibuff_install_dir) -lcrypto-mb"])
AC_ARG_WITH(QAT_SHARED_LIB_DEPS_MULTIBUFF, AS_HELP_STRING(), , QAT_SHARED_LIB_DEPS_MULTIBUFF=["-Wl,-rpath,\$(with_multibuff_install_dir) -L\$(with_multibuff_install_dir) -lcrypto_mb"])
AC_SUBST(QAT_SHARED_LIB_DEPS_MULTIBUFF)
fi

Expand Down
35 changes: 17 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ repository:

[10]:https://github.com/openssl/openssl/pull/10080

* Support for Multibuffer offload is extended to RSA 2k only and other algorithms will
use the standard OpenSSL implemenation when this feature is enabled.
* Support for Multibuffer offload is extended to RSA 2k only. Other key sizes will
use the standard OpenSSL implementation when this feature is enabled.

## Installation Instructions

Expand Down Expand Up @@ -982,10 +982,9 @@ Mandatory (when using the Intel&reg; IFMA Mutibuffer Library)
Specify the path to the source code of the Intel(R) IFMA Mutibuffer library.
This path is needed for compilation in order to locate the Intel(R) IFMA
Multibuffer header files. If you do not specify this the build will fail.
For example if using Intel&reg; IFMA Mutibuffer library that was
unpacked to `/IFMA`, and you are using the Intel(R) Icelake Server or Client
platform for multibuff offload then you would use the following setting:
--with-multibuff_dir=/IFMA
For example if using Intel&reg; IFMA Mutibuffer library that was cloned from
the ipp-crypto GitHub to `/ipp-crypto`, then you would use the following
setting: --with-multibuff_dir=/ipp-crypto/sources/ippcp/crypto_mb
Optional
Expand Down Expand Up @@ -1492,32 +1491,32 @@ Multiply Add (IFMA) library.

The Intel&reg; QAT OpenSSL\* Engine Multibuffer Support, when enabled by the user
using the build instructions mentioned below performs operation by batching up
multiple requests maintained in queues and uses the OpenSSL async infrastucture
multiple requests maintained in queues and uses the OpenSSL async infrastructure
to submit the batched requests upto 8 to IFMA API which processes them in
parallel using AVX512 vector instructions. Multibuffer optimizations will be
beneficial to use in asynchronous operations where there are many parallel
connections.

### Requirements
1. This Intel&reg; QAT OpenSSL\* Engine supports Multibuffer based software
optimizations for RSA only in the Ice Lake Server(ICX) or Ice Lake Client(ICL)
platform and not supported in any other platform.
2. Successful operation of the Multibuffer support requires a software tool

Successful operation of the Multibuffer support requires a software tool
chain that supports OpenSSL\* 1.1.1 and Intel&reg; AVX-512 Integer Fused
Multiply Add (IFMA) library version 0.5.3 cloned and installed using the
instructions in the Readme from the [IFMA GitHub][13]
Multiply Add (IFMA) library version 0.5.3 or above cloned from the
[ipp-crypto GitHub][13] repo and installed using the instructions in
the Readme from [IFMA Source][14]

[13]:https://github.com/intel/ipp-crypto/tree/develop/sources/ippcp/ifma_rsa_mb
[13]:https://github.com/intel/ipp-crypto
[14]:https://github.com/intel/ipp-crypto/tree/develop/sources/ippcp/crypto_mb

### Build Instructions for Intel&reg; QAT OpenSSL\* Engine to enable Multibuffer Support

The following example is assuming:

* The Intel&reg; QAT OpenSSL\* Engine was cloned to its own location at the root
of the drive: `/`.
* The Intel&reg; AVX-512 Integer Fused Multiply Add (IFMA) library was cloned from the
[IFMA Github][13] to its own location at the root of the drive: `/IFMA` and installed
to `/usr/local/lib`
* The Intel&reg; AVX-512 Integer Fused Multiply Add (IFMA) library was cloned
from the [ipp-crypto GitHub][13] to its own location at the root of the
drive: `/` and IFMA Multibuffer library installed to `/usr/local/lib`
* OpenSSL\* 1.1.1 was installed to `/usr/local/ssl`.

To build and install the Intel&reg; QAT OpenSSL\* Engine with Multibuffer offload:
Expand All @@ -1526,7 +1525,7 @@ To build and install the Intel&reg; QAT OpenSSL\* Engine with Multibuffer offloa
cd /QAT_Engine
./autogen.sh
./configure \
--with-multibuff_dir=/IFMA \
--with-multibuff_dir=/ipp-crypto/sources/ippcp/crypto_mb \
--with-openssl_install_dir=/usr/local/ssl
make
make install
Expand Down
2 changes: 1 addition & 1 deletion multibuff_rsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
#include <unistd.h>
#include <signal.h>

#include "rsa_ifma.h"
#include "crypto_mb/rsa_ifma.h"
#include "multibuff_init.h"
#include "multibuff_rsa.h"
#include "qat_events.h"
Expand Down

0 comments on commit 5f8a773

Please sign in to comment.