Intel(R) Integrated Performance Primitives (Intel(R) IPP)
Cryptography is a secure, fast and lightweight library of
building blocks for cryptography, highly-optimized for various
Intel(R) CPUs.

https://github.com/intel/ipp-crypto

Key Features:

The library provides a comprehensive set of routines commonly used for 
cryptographic operations, including:
* Symmetric Cryptography Primitive Functions:
        * AES (ECB, CBC, CTR, OFB, CFB, XTS, GCM, CCM, SIV)
        * SM4 (ECB, CBC, CTR, OFB, CFB, CCM)
        * TDES (ECB, CBC, CTR, OFB, CFB)
        * RC4
* One-Way Hash Primitives:
        * SHA-1, SHA-224, SHA-256, SHA-384, SHA-512
        * MD5
        * SM3
* Data Authentication Primitive Functions:
        * HMAC
        * AES-CMAC
* Public Key Cryptography Functions:
        * RSA, RSA-OAEP, RSA-PKCS_v15, RSA-PSS
        * DLP, DLP-DSA, DLP-DH
        * ECC (NIST curves), ECDSA, ECDH, EC-SM2
* Multi-buffer RSA, ECDSA, SM3, x25519
* Finite Field Arithmetic Functions
* Big Number Integer Arithmetic Functions
* PRNG/TRNG and Prime Numbers Generation

Reasons to Use Intel IPP Cryptography:

* Security (constant-time execution for secret processing functions)
* Designed for the small footprint size
* Optimized for different Intel CPUs and instruction set architectures 
(including
hardware cryptography instructions support):
        Intel® Streaming SIMD Extensions 2 (Intel® SSE2)
        Intel® SSE3
        Intel® SSE4.2
        Intel® Advanced Vector Extensions (Intel® AVX)
        Intel® Advanced Vector Extensions 2 (Intel® AVX2)
        Intel® Advanced Vector Extensions 512 (Intel® AVX-512)
* Configurable CPU dispatching for the best performance
* Kernel mode compatibility
* Thread-safe design

Signed-off-by: Naveen Saini <[email protected]>
---
 ...ow-to-pass-compiler-and-linker-flags.patch | 29 ++++++
 ...0002-ippcp-gen-config.cmake-fix-typo.patch | 28 ++++++
 ...ists.txt-exclude-host-system-headers.patch | 40 ++++++++
 .../0004-cmake-fix-installation-path.patch    | 92 +++++++++++++++++++
 .../ipp-crypto/ipp-crypto_2021.2.bb           | 34 +++++++
 5 files changed, 223 insertions(+)
 create mode 100644 
recipes-support/ipp-crypto/ipp-crypto/0001-GNU.cmake-allow-to-pass-compiler-and-linker-flags.patch
 create mode 100644 
recipes-support/ipp-crypto/ipp-crypto/0002-ippcp-gen-config.cmake-fix-typo.patch
 create mode 100644 
recipes-support/ipp-crypto/ipp-crypto/0003-CMakeLists.txt-exclude-host-system-headers.patch
 create mode 100644 
recipes-support/ipp-crypto/ipp-crypto/0004-cmake-fix-installation-path.patch
 create mode 100644 recipes-support/ipp-crypto/ipp-crypto_2021.2.bb

diff --git 
a/recipes-support/ipp-crypto/ipp-crypto/0001-GNU.cmake-allow-to-pass-compiler-and-linker-flags.patch
 
b/recipes-support/ipp-crypto/ipp-crypto/0001-GNU.cmake-allow-to-pass-compiler-and-linker-flags.patch
new file mode 100644
index 00000000..49adf8f1
--- /dev/null
+++ 
b/recipes-support/ipp-crypto/ipp-crypto/0001-GNU.cmake-allow-to-pass-compiler-and-linker-flags.patch
@@ -0,0 +1,29 @@
+From c440800cae91f857949255cc63993426bdaefb26 Mon Sep 17 00:00:00 2001
+From: Naveen Saini <[email protected]>
+Date: Wed, 16 Jun 2021 20:54:33 +0800
+Subject: [PATCH 1/4] GNU.cmake: allow to pass compiler and linker flags
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Naveen Saini <[email protected]>
+---
+ sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake 
b/sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake
+index 5d148a1..4cb2289 100644
+--- a/sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake
++++ b/sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake
+@@ -56,7 +56,8 @@ set(LINK_FLAGS_DYNAMIC "${LINK_FLAGS_DYNAMIC} 
${CRYPTO_MB_SOURCES_DIR}/cmake/dll
+ # Compiler flags
+ 
+ # Tells the compiler to align functions and loops
+-set(CMAKE_C_FLAGS " -falign-functions=32 -falign-loops=32")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -falign-functions=32 -falign-loops=32")
++
+ # Ensures that compilation takes place in a freestanding environment
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffreestanding")
+ 
+-- 
+2.17.1
+
diff --git 
a/recipes-support/ipp-crypto/ipp-crypto/0002-ippcp-gen-config.cmake-fix-typo.patch
 
b/recipes-support/ipp-crypto/ipp-crypto/0002-ippcp-gen-config.cmake-fix-typo.patch
new file mode 100644
index 00000000..b94883a0
--- /dev/null
+++ 
b/recipes-support/ipp-crypto/ipp-crypto/0002-ippcp-gen-config.cmake-fix-typo.patch
@@ -0,0 +1,28 @@
+From bbde24b31d5d035ec19637a510f1636cd9738fe3 Mon Sep 17 00:00:00 2001
+From: Naveen Saini <[email protected]>
+Date: Thu, 17 Jun 2021 12:33:11 +0800
+Subject: [PATCH 2/4] ippcp-gen-config.cmake: fix typo
+
+Upstream-Status: Pending
+
+Signed-off-by: Naveen Saini <[email protected]>
+---
+ sources/cmake/ippcp-gen-config.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sources/cmake/ippcp-gen-config.cmake 
b/sources/cmake/ippcp-gen-config.cmake
+index d8f3b3b..55bd3bd 100644
+--- a/sources/cmake/ippcp-gen-config.cmake
++++ b/sources/cmake/ippcp-gen-config.cmake
+@@ -21,7 +21,7 @@ set(IPPCP_INC_REL_PATH    "include")
+ configure_file("${IPP_CRYPTO_DIR}/sources/cmake/ippcp-config.cmake.in" 
"${CMAKE_BINARY_DIR}/ippcp-config.cmake" @ONLY)
+ 
configure_file("${IPP_CRYPTO_DIR}/sources/cmake/ippcp-config-version.cmake.in" 
"${CMAKE_BINARY_DIR}/ippcp-config-version.cmake" @ONLY)
+ install(FILES
+-    "${CMAKE_BINARY_DIR}/ippcpo-config.cmake"
++    "${CMAKE_BINARY_DIR}/ippcp-config.cmake"
+     "${CMAKE_BINARY_DIR}/ippcp-config-version.cmake"
+     DESTINATION "cmake")
+ 
+-- 
+2.17.1
+
diff --git 
a/recipes-support/ipp-crypto/ipp-crypto/0003-CMakeLists.txt-exclude-host-system-headers.patch
 
b/recipes-support/ipp-crypto/ipp-crypto/0003-CMakeLists.txt-exclude-host-system-headers.patch
new file mode 100644
index 00000000..2457bd04
--- /dev/null
+++ 
b/recipes-support/ipp-crypto/ipp-crypto/0003-CMakeLists.txt-exclude-host-system-headers.patch
@@ -0,0 +1,40 @@
+From 7b575fc23d246373425c3682e83634203aadc4a6 Mon Sep 17 00:00:00 2001
+From: Naveen Saini <[email protected]>
+Date: Thu, 17 Jun 2021 12:35:36 +0800
+Subject: [PATCH 3/4] CMakeLists.txt: exclude host system headers
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Naveen Saini <[email protected]>
+---
+ sources/ippcp/CMakeLists.txt           | 1 -
+ sources/ippcp/crypto_mb/CMakeLists.txt | 1 -
+ 2 files changed, 2 deletions(-)
+
+diff --git a/sources/ippcp/CMakeLists.txt b/sources/ippcp/CMakeLists.txt
+index f70439f..0270bbd 100644
+--- a/sources/ippcp/CMakeLists.txt
++++ b/sources/ippcp/CMakeLists.txt
+@@ -232,7 +232,6 @@ set (C_INCLUDE_DIRECTORIES
+     # RSA_SB (ifma) uses crypto_mb headers
+     ${IPP_CRYPTO_SOURCES_DIR}/crypto_mb/include
+     $<$<C_COMPILER_ID:Intel>:$ENV{ROOT}/compiler/include 
$ENV{ROOT}/compiler/include/icc>
+-    $<$<NOT:$<C_COMPILER_ID:Intel>>:${CMAKE_SYSTEM_INCLUDE_PATH}>
+     $<$<OR:$<C_COMPILER_ID:Intel>,$<BOOL:${MSVC_IDE}>>:$ENV{INCLUDE}>
+     )
+ 
+diff --git a/sources/ippcp/crypto_mb/CMakeLists.txt 
b/sources/ippcp/crypto_mb/CMakeLists.txt
+index d1f3994..db9635b 100644
+--- a/sources/ippcp/crypto_mb/CMakeLists.txt
++++ b/sources/ippcp/crypto_mb/CMakeLists.txt
+@@ -75,7 +75,6 @@ endif()
+ include_directories(
+      ${MB_INCLUDE_DIRS}
+      $<$<C_COMPILER_ID:Intel>:$ENV{ROOT}/compiler/include 
$ENV{ROOT}/compiler/include/icc>
+-     $<$<NOT:$<C_COMPILER_ID:Intel>>:${CMAKE_SYSTEM_INCLUDE_PATH}>
+      $<$<OR:$<C_COMPILER_ID:Intel>,$<BOOL:${MSVC_IDE}>>:$ENV{INCLUDE}>
+ )
+ 
+-- 
+2.17.1
+
diff --git 
a/recipes-support/ipp-crypto/ipp-crypto/0004-cmake-fix-installation-path.patch 
b/recipes-support/ipp-crypto/ipp-crypto/0004-cmake-fix-installation-path.patch
new file mode 100644
index 00000000..cb81bc98
--- /dev/null
+++ 
b/recipes-support/ipp-crypto/ipp-crypto/0004-cmake-fix-installation-path.patch
@@ -0,0 +1,92 @@
+From 8b236efe9904ba2f5042f32db8cdc2a1659f62b1 Mon Sep 17 00:00:00 2001
+From: Naveen Saini <[email protected]>
+Date: Fri, 18 Jun 2021 11:52:12 +0800
+Subject: [PATCH 4/4] cmake: fix installation path
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Naveen Saini <[email protected]>
+---
+ sources/cmake/ippcp-gen-config.cmake |  2 +-
+ sources/ippcp/CMakeLists.txt         | 26 +++++++++++++-------------
+ 2 files changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/sources/cmake/ippcp-gen-config.cmake 
b/sources/cmake/ippcp-gen-config.cmake
+index 55bd3bd..d8e212f 100644
+--- a/sources/cmake/ippcp-gen-config.cmake
++++ b/sources/cmake/ippcp-gen-config.cmake
+@@ -23,5 +23,5 @@ 
configure_file("${IPP_CRYPTO_DIR}/sources/cmake/ippcp-config-version.cmake.in" "
+ install(FILES
+     "${CMAKE_BINARY_DIR}/ippcp-config.cmake"
+     "${CMAKE_BINARY_DIR}/ippcp-config-version.cmake"
+-    DESTINATION "cmake")
++    DESTINATION ${CMAKE_INSTALL_LIBDIR}/ippcp/cmake)
+ 
+diff --git a/sources/ippcp/CMakeLists.txt b/sources/ippcp/CMakeLists.txt
+index 0270bbd..5955ecb 100644
+--- a/sources/ippcp/CMakeLists.txt
++++ b/sources/ippcp/CMakeLists.txt
+@@ -367,9 +367,9 @@ foreach(opt ${PLATFORM_LIST})
+     endif()
+ 
+     install(TARGETS ${IPPCP_DYN_ITER}
+-            LIBRARY DESTINATION "lib/${ARCH}/$<$<BOOL:${NONPIC_LIB}>:nonpic>"
+-            RUNTIME DESTINATION "lib/${ARCH}/$<$<BOOL:${NONPIC_LIB}>:nonpic>"
+-            PUBLIC_HEADER DESTINATION "include")
++            LIBRARY DESTINATION 
"${CMAKE_INSTALL_LIBDIR}/$<$<BOOL:${NONPIC_LIB}>:nonpic>"
++            RUNTIME DESTINATION 
"${CMAKE_INSTALL_LIBDIR}/$<$<BOOL:${NONPIC_LIB}>:nonpic>"
++            PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+     list(APPEND IPPCP_LIB_DYNAMIC ${IPPCP_DYN_ITER})
+   endif(DYNAMIC_LIB AND NOT MERGED_BLD)
+ 
+@@ -397,8 +397,8 @@ foreach(opt ${PLATFORM_LIST})
+   if (NOT MERGED_BLD)
+     set_target_properties(${IPPCP_ST_ITER} PROPERTIES PUBLIC_HEADER 
"${IPPCP_PUBLIC_HEADERS}")
+     install(TARGETS ${IPPCP_ST_ITER}
+-            ARCHIVE DESTINATION "lib/${ARCH}/$<$<BOOL:${NONPIC_LIB}>:nonpic>"
+-            PUBLIC_HEADER DESTINATION "include")
++            ARCHIVE DESTINATION 
"${CMAKE_INSTALL_LIBDIR}/$<$<BOOL:${NONPIC_LIB}>:nonpic>"
++            PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+   endif()
+ 
+   list(APPEND IPPCP_LIB_STATIC ${IPPCP_ST_ITER})
+@@ -472,9 +472,9 @@ if(MERGED_BLD)
+                                                        PRIVATE_HEADER 
"${ONE_CPU_HEADERS}")
+ 
+   install(TARGETS ${IPPCP_LIB_MERGED}
+-          ARCHIVE DESTINATION "lib/${ARCH}/$<$<BOOL:${NONPIC_LIB}>:nonpic>"
+-          PUBLIC_HEADER DESTINATION "include"
+-          PRIVATE_HEADER DESTINATION "tools/${ARCH}/staticlib")
++          ARCHIVE DESTINATION 
"${CMAKE_INSTALL_LIBDIR}/$<$<BOOL:${NONPIC_LIB}>:nonpic>"
++          PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
++          PRIVATE_HEADER DESTINATION 
"${CMAKE_INSTALL_LIBDIR}/ippcp/tools/staticlib")
+ 
+   set_source_files_properties(${DISPATCHER_C_SOURCES} pcpver.rc PROPERTIES 
INCLUDE_DIRECTORIES "${C_INCLUDE_DIRECTORIES}")
+   # protection (_FORTIFY_SOURCE) and optimization flags for dispatcher
+@@ -510,10 +510,10 @@ if(MERGED_BLD)
+     set_target_properties(${IPPCP_LIB_PCS} PROPERTIES OUTPUT_NAME 
"${TARGET_NAME}")
+ 
+     install(TARGETS ${IPPCP_LIB_PCS}
+-            LIBRARY DESTINATION "lib/${ARCH}/$<$<BOOL:${NONPIC_LIB}>:nonpic>"
+-            RUNTIME DESTINATION "lib/${ARCH}/$<$<BOOL:${NONPIC_LIB}>:nonpic>"
+-            PUBLIC_HEADER DESTINATION "include"
+-            PRIVATE_HEADER DESTINATION "tools/${ARCH}/staticlib")
++            LIBRARY DESTINATION 
"${CMAKE_INSTALL_LIBDIR}/$<$<BOOL:${NONPIC_LIB}>:nonpic>"
++            RUNTIME DESTINATION 
"${CMAKE_INSTALL_LIBDIR}/$<$<BOOL:${NONPIC_LIB}>:nonpic>"
++            PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
++            PRIVATE_HEADER DESTINATION 
"${CMAKE_INSTALL_LIBDIR}/ippcp/tools/staticlib")
+ 
+     if(WIN32)
+       set_target_properties(${IPPCP_LIB_PCS} PROPERTIES LINK_FLAGS 
${LINK_FLAG_DYNAMIC_WINDOWS})
+@@ -551,7 +551,7 @@ 
include("${IPP_CRYPTO_DIR}/sources/cmake/ippcp-gen-config.cmake")
+ 
+ # Install Custom Library tool
+ install(DIRECTORY "${TOOLS_DIR}/ipp_custom_library_tool_python/"
+-        DESTINATION "tools/custom_library_tool_python")
++        DESTINATION 
"${CMAKE_INSTALL_LIBDIR}/ippcp/tools/custom_library_tool_python")
+ 
+ # Crypto multi-buffer library
+ if ("${ARCH}" STREQUAL "intel64")
+-- 
+2.17.1
+
diff --git a/recipes-support/ipp-crypto/ipp-crypto_2021.2.bb 
b/recipes-support/ipp-crypto/ipp-crypto_2021.2.bb
new file mode 100644
index 00000000..23df52c0
--- /dev/null
+++ b/recipes-support/ipp-crypto/ipp-crypto_2021.2.bb
@@ -0,0 +1,34 @@
+SUMMARY  = "Intel(R) Integrated Performance Primitives Cryptography"
+DESCRIPTION = "Intel(R) Integrated Performance Primitives (Intel(R) IPP) \
+Cryptography is a secure, fast and lightweight library of building blocks \
+for cryptography, highly-optimized for various Intel(R) CPUs."
+HOMEPAGE = "https://github.com/intel/ipp-crypto";
+
+LICENSE  = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e787af283468feca985d6b865d27d95b"
+
+inherit pkgconfig cmake
+
+S = "${WORKDIR}/git"
+
+SRC_URI = 
"git://github.com/intel/ipp-crypto.git;protocol=https;branch=ipp-crypto_2021_2 \
+            
file://0001-GNU.cmake-allow-to-pass-compiler-and-linker-flags.patch \
+            file://0002-ippcp-gen-config.cmake-fix-typo.patch \
+            file://0003-CMakeLists.txt-exclude-host-system-headers.patch \
+            file://0004-cmake-fix-installation-path.patch \
+            "
+SRCREV = "711db2d0ec73f23804a32a285aaa71e66e35f15a"
+
+DEPENDS = "nasm-native"
+RDEPENDS_${PN} += "libcrypto"
+
+#c_sources/m7/c_intel64/m7_pcpver.c:83:6: error: macro "__DATE__" might prevent
+#reproducible builds
+CFLAGS_append = " -Wno-error=date-time"
+
+EXTRA_OECMAKE += " \
+                  
-DARCH=${@oe.utils.conditional('TARGET_ARCH','x86_64','intel64','ia32',d)}  \
+                  "
+PACKAGES =+ "${PN}-tools"
+FILES_${PN} += " ${libdir}/ippcp/cmake"
+FILES_${PN}-tools = "${libdir}/ippcp/tools"
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7114): 
https://lists.yoctoproject.org/g/meta-intel/message/7114
Mute This Topic: https://lists.yoctoproject.org/mt/83684820/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-intel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to