Skip to content

Commit d763fce

Browse files
author
ipl_ci
committed
WW48'24 source code update
1 parent 944aa7a commit d763fce

File tree

11 files changed

+250
-114
lines changed

11 files changed

+250
-114
lines changed

BUILD.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ To build the Intel® Cryptography Primitives Library on macOS\*, complete the fo
223223

224224
- Example for Linux\* OS and the Intel® 64 architecture:
225225
`-DPLATFORM_LIST="m7;n8;y8;e9;l9;k0;k1"`
226+
- `-DMBX_PLATFORM_LIST="<platform list>"` - optional, works only if `-DMERGED_BLD:BOOL=off` is set. Sets target platforms for the code to be compiled for [Crypto Multi Buffer library](./sources/ippcp/crypto_mb/Readme.md). Please, refer to [Crypto Multi Buffer library target platforms list](./sources/ippcp/crypto_mb/Readme.md/#target-optimization-codes-in-function-names) to check the supported platforms.
227+
- Example:
228+
`-DMBX_PLATFORM_LIST="k1;l9"`
226229
- `-DNO_CRYPTO_MB:BOOL=TRUE` - optional, turns off the build of [Crypto Multi Buffer library](./sources/ippcp/crypto_mb/Readme.md) and, as a consequence, removes all dependencies on OpenSSL library.
227230
- `-DTONGSUO:BOOL=on`, `-DBORINGSSL:BOOL=on` - required only if forks of OpenSSL library are used to resolve OpenSSL dependencies - Tongsuo and BoringSSL respectively. These flags make sense when [Crypto Multi Buffer library](./sources/ippcp/crypto_mb/Readme.md) is built.
228231
> **NOTE:** -DBABASSL:BOOL=on flag is deprecated and targeted to be removed in the future releases. Please use -DTONGSUO:BOOL=on instead.\*.

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
This is a list of notable changes to Intel® Cryptography Primitives Library, in reverse chronological order.
44

55
## Intel(R) Cryptography Primitives Library 1.1.0
6+
67
- Added single buffer SHA384, SHA512, SHA512/224, SHA512/256 hash algorithm optimizations with the new SHA512 instructions for Lunar Lake and Arrow Lake S CPUs.
8+
- Enabled support of [specific ISA library](./OVERVIEW.md#specific-isa-library) build for Crypto Multi buffer library.
9+
Cmake build options `-DMERGED_BLD:BOOL=off -DMBX_PLATFORM_LIST="k1;l9"` may be used. Please refer to
10+
[BUILD.md](./BUILD.md) for the details.
11+
- Fixed AVX512 IFMA implementation (k1 branch) of SM2 signature and verification single-buffer algorithm. The optimized path is re-enabled.
712

813
## Intel(R) Cryptography Primitives Library 1.0.0
914
- Intel® Integrated Performance Primitives Cryptography (Intel® IPP Cryptography) was renamed to Intel(R) Cryptography Primitives Library.

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ endif()
9191
if("${MERGED_BLD}" STREQUAL "")
9292
set(MERGED_BLD ON)
9393
endif()
94+
# Crypto_mb merged build flag is set same as IPPCP by default
95+
if(MERGED_BLD)
96+
set(MBX_MERGED_BLD ON)
97+
endif()
9498

9599
# Set default installation directories
96100
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
@@ -244,7 +248,6 @@ if (NOT (CRYPTO_USE_CLANG_TIDY))
244248
endif()
245249
endif()
246250

247-
248251
if(BUILD_EXAMPLES)
249252
# This helps to organize examples projects structure in IDE by folders
250253
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

sources/ippcp/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ include (GenerateExportHeader)
2222

2323
set(TARGET_NAME ${LIB_NAME})
2424

25-
#Set platform list
25+
# Set platform list (order is important for dispatcher generation!!!)
2626
if (NOT MERGED_BLD)
2727
if(${ARCH} MATCHES "ia32")
2828
set(BASE_PLATFORM_LIST px)
@@ -672,3 +672,8 @@ if ((NOT NO_CRYPTO_MB) AND ("${ARCH}" STREQUAL "intel64"))
672672
message(SEND_ERROR "IPPCP_INTERFACE_VERSION and MBX_INTERFACE_VERSION don't match")
673673
endif()
674674
endif()
675+
676+
# Forward crypto_mb's list of platforms to the parent scope
677+
if(NOT MBX_MERGED_BLD)
678+
set(MBX_PLATFORM_LIST ${MBX_PLATFORM_LIST} PARENT_SCOPE)
679+
endif()

sources/ippcp/crypto_mb/CMakeLists.txt

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,53 @@ endif()
6060
set(l9_def "_L9" "SIMD_LEN=256")
6161
set(k1_def "_K1" "USE_AMS_5x" "SIMD_LEN=512")
6262

63+
# Check MERGED_BLD flag for the standalone build case (otherwise it is set in the parent project)
64+
if(MB_STANDALONE)
65+
if("${MERGED_BLD}" STREQUAL "") # MERGED_BLD is on by default
66+
set(MERGED_BLD ON)
67+
endif()
68+
if(MERGED_BLD) # MERGED_BLD is on by default or by user settings
69+
set(MBX_MERGED_BLD ON)
70+
message (STATUS "MERGED_BLD ............................ on")
71+
else()
72+
message (STATUS "MERGED_BLD ............................ off")
73+
endif()
74+
endif()
75+
6376
# Proper dispatching requires several optimization paths
64-
set(MBX_PLATFORM_LIST k1 l9)
77+
# Set platform list (order is important for dispacther generation!!!)
78+
set(MBX_BASE_PLATFORM_LIST k1 l9)
79+
80+
if(MBX_PLATFORM_LIST) # MBX_PLATFORM_LIST may be set by user
81+
if (NOT MBX_MERGED_BLD)
82+
foreach(opt ${MBX_PLATFORM_LIST})
83+
set(FOUND_PLATFORM false)
84+
foreach(base_opt ${MBX_BASE_PLATFORM_LIST})
85+
string(STRIP "${opt}" opt_strip)
86+
if(opt_strip STREQUAL base_opt)
87+
set(FOUND_PLATFORM true)
88+
endif()
89+
endforeach(base_opt ${MBX_BASE_PLATFORM_LIST})
90+
if(NOT FOUND_PLATFORM)
91+
message (FATAL_ERROR "Incorrect platform: " ${opt})
92+
endif()
93+
endforeach(opt ${MBX_PLATFORM_LIST})
94+
if (MBX_PLATFORM_LIST STREQUAL "")
95+
message (FATAL_ERROR "MBX_PLATFORM_LIST cannot be empty")
96+
endif(MBX_PLATFORM_LIST STREQUAL "")
97+
message (STATUS "MBX Platform list ......................... " ${MBX_PLATFORM_LIST})
98+
else()
99+
message (FATAL_ERROR "MBX_PLATFORM_LIST cannot be set, when MERGED_BLD is on")
100+
endif(NOT MBX_MERGED_BLD)
101+
else()
102+
set(MBX_PLATFORM_LIST ${MBX_BASE_PLATFORM_LIST})
103+
endif()
104+
105+
if (NOT MB_STANDALONE)
106+
if (NOT MBX_MERGED_BLD)
107+
set(MBX_PLATFORM_LIST ${MBX_PLATFORM_LIST} PARENT_SCOPE)
108+
endif()
109+
endif()
65110

66111
# check if L9 is supported by the compiler
67112
set(MBX_CC_AVXIFMA_SUPPORT 0)

sources/ippcp/crypto_mb/Readme.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,18 @@ You can find the installed files in:
109109
> In this case to resolve the Crypto Multi-buffer Library dependency on OpenSSL it is
110110
> necessary to update `LD_LIBRARY_PATH` with the path to the target OpenSSL library.
111111
112+
## Supported Platforms
113+
114+
Crypto multi-buffer library uses multiple implementations of each function, optimized
115+
for various CPUs. Please, refer to [OVERVIEW.md](../../../OVERVIEW.md#cpu-dispatching)
116+
for the detailed information about code dispatching.
117+
118+
### Target Optimization Codes in Function Names
119+
120+
| Intel® 64 architecture | Meaning |
121+
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
122+
| l9 | Optimized for processors with Intel® Advanced Vector Extensions 2 (Intel® AVX2) with Intel® AVX-IFMA (formerly codenamed Sierra Forest) |
123+
| k1 | Optimized for processors with Intel® Advanced Vector Extensions 512 (Intel® AVX-512) (formerly codenamed IceLake) |
112124

113125
## How to Build
114126

@@ -137,7 +149,9 @@ You can find the installed files in:
137149

138150
### Building with Intel® Cryptography Primitives Library
139151

140-
The Crypto Multi-buffer library will be built automatically with Intel® Cryptography Primitives Library if optimization for Intel® Microarchitecture Code Named Ice Lake is available. For more information see [Intel Cryptography Primitives Library Build Instructions](../../../BUILD.md)
152+
The Crypto Multi-buffer library will be built automatically with Intel® Cryptography Primitives Library if
153+
optimization for Intel® Microarchitecture Code Named Ice Lake/Code Named Sierra Forest are available.
154+
For more information see [Intel Cryptography Primitives Library Build Instructions](../../../BUILD.md)
141155

142156
### CMake Build Options
143157

@@ -151,3 +165,11 @@ The Crypto Multi-buffer library will be built automatically with Intel® Cryptog
151165
```
152166

153167
- Set `-DOPENSSL_USE_STATIC_LIBS=TRUE` if static OpenSSL libraries are preferred.
168+
169+
- Use `-DMERGED_BLD:BOOL=off` to build of one static/dynamic library per optimization;
170+
See [specific ISA library](../../../OVERVIEW.md#specific-isa-library) for the details about 1CPU libraries build.
171+
172+
- Use `-DMBX_PLATFORM_LIST="<platform list>"` to set target platforms for the code to be compiled.
173+
The flag works only if `-DMERGED_BLD:BOOL=off` is set. Please, refer to [Target Optimization Codes in Function Names](#target-optimization-codes-in-function-names) for the supported platforms list.
174+
- Example:
175+
`-DMBX_PLATFORM_LIST="k1;l9"`

sources/ippcp/crypto_mb/include/internal/common/internal_defs.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,19 @@
3535
#include "x25519_cpuspc.h"
3636
#endif
3737

38+
#if defined(_MBX_MERGED_BLD)
3839
#if defined( _L9 ) /* Intel® AVX2 */
3940
#define OWNAPI(name) l9_##name
40-
#define _MBX _MBX_L9
4141
#elif defined( _K1 )
4242
#define OWNAPI(name) k1_##name
43+
#endif
44+
#else /* 1CPU build */
45+
#define OWNAPI(name) name
46+
#endif
47+
48+
#if defined( _L9 ) /* Intel® AVX2 */
49+
#define _MBX _MBX_L9
50+
#elif defined( _K1 )
4351
#define _MBX _MBX_K1
4452
#endif
4553

0 commit comments

Comments
 (0)