Skip to content

Commit 9f41efc

Browse files
committed
Refactoring of crypto_mb library; crypto_mb extended with ECDSA/ECDHE for NIST p256r1/p384r1 curves; RSA 2048 decryption (CRT) optimizations for IceLake CPU
1 parent a5423a6 commit 9f41efc

File tree

823 files changed

+18548
-9588
lines changed

Some content is hidden

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

823 files changed

+18548
-9588
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
*.sln text eol=crlf
2121
*.bat text eol=crlf
2222

23+
# Declare files that will always have LF line endings on checkout.
24+
*.py text eol=lf
25+
2326
# Denote all files that are truly binary and should not be modified.
2427
*.png binary
2528
*.jpg binary

CHANGELOG.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@
22

33
This is a list of notable changes to Intel(R) IPP Cryptography, in reverse chronological order.
44

5+
## YYYY-MM-DD
6+
7+
## 2020-10-21
8+
- RSA-2048 decryption (CRT) was enabled for Intel(R) Microarchitecture Code Named Ice Lake
9+
- Crypto Multi-buffer library was extended with ECDSA (Sign) and ECDHE for the NIST curves p256r1 and p384r1
10+
511
## 2020-09-01
612
- Refactoring of Crypto Multi-buffer library, added build and installation of crypto_mb dynamic library and CPU features detection.
713

814
## 2020-08-19
9-
- Added multi-buffer implementation of AES-CFB optimized with Intel(R) AES-NI and vector extensions of Intel(R) AES-NI instruction sets.
10-
- Fixed compatibility issue with x64 ABI (restored non-volatile registers after function call in AVX/AVX2 assembly code).
15+
- Added multi-buffer implementation of AES-CFB optimized with Intel(R) AES New Instructions (Intel(R) AES-NI) and vector extensions of Intel(R) AES New Instructions (Intel(R) AES-NI) instruction sets.
16+
- Fixed compatibility issue with x64 ABI (restored non-volatile registers after function call in Intel® Advanced Vector Extensions (Intel® AVX)/Intel® Advanced Vector Extensions 2 (Intel® AVX2) assembly code).
1117
- Updated Intel IPP Custom Library Tool.
1218

1319
## 2020-06-09
@@ -23,7 +29,7 @@ This is a list of notable changes to Intel(R) IPP Cryptography, in reverse chron
2329

2430
## 2020-04-19
2531
- AES-XTS optimization for Intel(R) Microarchitecture Code Named Ice Lake with vector extensions of Intel(R) AES New Instructions (Intel(R) AES-NI) was improved.
26-
- Fixed a build issue that affect build of the Intel(R) IPP Crypto library with MSVC\* compiler on Windows\* OS.
32+
- Fixed a build issue that affect build of the Intel(R) IPP Cryptography library with MSVC\* compiler on Windows\* OS.
2733
- Duplicated APIs of HASH, HMAC, MGF, RSA, ECCP functionality were marked as deprecated. For more information see [Deprecation notes](./DEPRECATION_NOTES.md)
2834
- Added examples demonstrating usage of SMS4-CBC encryption and decryption.
2935

examples/FindIPPCrypto.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,22 @@ if (NOT IPPCRYPTO_ROOT_DIR OR NOT EXISTS "${IPPCRYPTO_ROOT_DIR}/include/ippcp.h"
4141

4242
if(WIN32)
4343
list(APPEND ippcp_search_paths
44-
$ENV{ProgramFiles\(x86\)}/IntelSWTools/compilers_and_libraries/windows/ippcp)
44+
$ENV{ProgramFiles\(x86\)}/IntelSWTools/compilers_and_libraries/windows/ippcp
45+
$ENV{ProgramFiles\(x86\)}/Intel/oneAPI/ippcp/latest)
4546
endif()
4647

4748
if(UNIX)
4849
list(APPEND ippcp_search_paths
4950
/opt/intel/ippcp
50-
$ENV{HOME}/intel/ippcp)
51+
$ENV{HOME}/intel/ippcp
52+
/opt/intel/oneapi/ippcp/latest
53+
$ENV{HOME}/intel/oneapi/ippcp/latest)
5154
endif()
5255

5356
find_path(IPPCRYPTO_ROOT_DIR include/ippcp.h PATHS ${ippcp_search_paths})
5457
endif()
5558

59+
5660
set(IPPCRYPTO_INCLUDE_DIRS "${IPPCRYPTO_ROOT_DIR}/include" CACHE PATH "Path to Intel IPP Cryptography library include directory" FORCE)
5761

5862
# Check found directory

include/ippcpdefs.h

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,16 @@ extern "C" {
3737

3838
#if !defined( IPPAPI )
3939

40+
/* Specify explicit calling convention for public functions */
4041
#if defined( IPP_W32DLL ) && (defined( _WIN32 ) || defined( _WIN64 ))
4142
#if defined( _MSC_VER ) || defined( __ICL )
4243
#define IPPAPI( type,name,arg ) \
43-
__declspec(dllimport) type IPP_STDCALL name arg;
44+
__declspec(dllimport) type IPP_CALL name arg;
4445
#else
45-
#define IPPAPI( type,name,arg ) type IPP_STDCALL name arg;
46+
#define IPPAPI( type,name,arg ) type IPP_CALL name arg;
4647
#endif
4748
#else
48-
#define IPPAPI( type,name,arg ) type IPP_STDCALL name arg;
49+
#define IPPAPI( type,name,arg ) type IPP_CALL name arg;
4950
#endif
5051

5152
#endif
@@ -102,16 +103,25 @@ extern "C" {
102103
#endif
103104
#endif
104105

105-
#if defined( _WIN32 ) || defined ( _WIN64 )
106-
#define IPP_STDCALL __stdcall
106+
107+
#if defined (_MSC_VER)
107108
#define IPP_CDECL __cdecl
109+
#elif (defined (__INTEL_COMPILER) || defined (__GNUC__ ) || defined (__clang__)) && defined (_ARCH_IA32)
110+
#define IPP_CDECL __attribute((cdecl))
111+
#else
112+
#define IPP_CDECL
113+
#endif
114+
115+
#if defined( _WIN32 ) || defined( _WIN64 )
116+
#define IPP_STDCALL __stdcall
117+
#define IPP_CALL IPP_STDCALL
108118
#define IPP_INT64 __int64
109119
#define IPP_UINT64 unsigned __int64
110120
#else
111121
#define IPP_STDCALL
112-
#define IPP_CDECL
122+
#define IPP_CALL IPP_CDECL
113123
#define IPP_INT64 long long
114-
#define IPP_UINT64 unsigned long long
124+
#define IPP_UINT64 unsigned long long
115125
#endif
116126

117127
#define IPP_COUNT_OF( obj ) (sizeof(obj)/sizeof(obj[0]))
@@ -250,9 +260,9 @@ typedef enum {
250260
ipp64fc = 20
251261
} IppDataType;
252262

253-
typedef enum {
254-
ippFalse = 0,
255-
ippTrue = 1
263+
typedef enum {
264+
ippFalse = 0,
265+
ippTrue = 1
256266
} IppBool;
257267

258268
#ifdef __cplusplus
@@ -486,12 +496,6 @@ typedef struct _cpHashCtx IppsHashState;
486496
typedef struct _cpHashMethod_rmf IppsHashMethod;
487497
typedef struct _cpHashCtx_rmf IppsHashState_rmf;
488498

489-
490-
/* MGF */
491-
typedef IppStatus (IPP_STDCALL *IppMGF)(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen);
492-
/* HASH function */
493-
typedef IppStatus (IPP_STDCALL *IppHASH)(const Ipp8u* pMsg, int len, Ipp8u* pMD);
494-
495499
#define IPP_SHA1_DIGEST_BITSIZE 160 /* digest size (bits) */
496500
#define IPP_SHA256_DIGEST_BITSIZE 256
497501
#define IPP_SHA224_DIGEST_BITSIZE 224
@@ -547,7 +551,7 @@ typedef struct _cpPRNG IppsPRNGState;
547551
typedef struct _cpPrime IppsPrimeState;
548552

549553
/* External Bit Supplier */
550-
typedef IppStatus (IPP_STDCALL *IppBitSupplier)(Ipp32u* pRand, int nBits, void* pEbsParams);
554+
typedef IppStatus (IPP_CALL *IppBitSupplier)(Ipp32u* pRand, int nBits, void* pEbsParams);
551555

552556
#define IPP_IS_EQ (0)
553557
#define IPP_IS_GT (1)

include/ippversion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929
#define IPP_VERSION_MAJOR 2020
3030
#define IPP_VERSION_MINOR 0
31-
#define IPP_VERSION_UPDATE 2
31+
#define IPP_VERSION_UPDATE 3
3232

33-
#define IPP_VERSION_STR "2020.0.2"
33+
#define IPP_VERSION_STR "2020.0.3"
3434

3535
#endif /* IPPVERSION_H__ */

sources/cmake/linux/common.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ if(NOT NONPIC_LIB)
3030
set(LIBRARY_DEFINES "${LIBRARY_DEFINES} -DIPP_PIC")
3131
endif()
3232

33-
set(LIBRARY_DEFINES "${LIBRARY_DEFINES} -DBN_OPENSSL_DISABLE")
33+
#set(LIBRARY_DEFINES "${LIBRARY_DEFINES} -DBN_OPENSSL_DISABLE")

sources/cmake/macosx/common.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
set(OS_DEFAULT_COMPILER Intel19.0.0)
2222

2323
set(LIBRARY_DEFINES "${LIBRARY_DEFINES} -DIPP_PIC -DOSXEM64T -DLINUX32E -D_ARCH_EM64T")
24-
set(LIBRARY_DEFINES "${LIBRARY_DEFINES} -DBN_OPENSSL_DISABLE")
24+
#set(LIBRARY_DEFINES "${LIBRARY_DEFINES} -DBN_OPENSSL_DISABLE")

sources/cmake/windows/common.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ else()
2626
set(LIBRARY_DEFINES "${LIBRARY_DEFINES} -DWIN32E -D_ARCH_EM64T") # _WIN32 and _WIN64 are defined by a compiler
2727
endif(${ARCH} MATCHES "ia32")
2828

29-
set(LIBRARY_DEFINES "${LIBRARY_DEFINES} -DBN_OPENSSL_DISABLE")
29+
#set(LIBRARY_DEFINES "${LIBRARY_DEFINES} -DBN_OPENSSL_DISABLE")

sources/dispatcher/gen_disp_lin32.nonpic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126

127127
DISP.write("typedef void (*IPP_PROC)(void);\n\n")
128128
DISP.write("extern int ippcpJumpIndexForMergedLibs;\n")
129-
DISP.write("extern IPP_STDCALL ippcpInit();\n\n")
129+
DISP.write("extern IPP_CALL ippcpInit();\n\n")
130130

131131
DISP.write("extern IppStatus in_"+FunName+FunArg+";\n")
132132

sources/dispatcher/gen_disp_lin32.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@
134134

135135
DISP.write("typedef void (*IPP_PROC)(void);\n\n")
136136
DISP.write("extern int ippcpJumpIndexForMergedLibs;\n")
137-
DISP.write("extern IPP_STDCALL ippcpInit();\n\n")
137+
DISP.write("extern IPP_CALL ippcpInit();\n\n")
138138

139-
DISP.write("extern IppStatus IPP_STDCALL in_"+FunName+FunArg+";\n")
139+
DISP.write("extern IppStatus IPP_CALL in_"+FunName+FunArg+";\n")
140140

141141
for cpu in cpulist:
142-
DISP.write("extern IppStatus IPP_STDCALL "+cpu+"_"+FunName+FunArg+";\n")
142+
DISP.write("extern IppStatus IPP_CALL "+cpu+"_"+FunName+FunArg+";\n")
143143

144144
DISP.write("""
145145
__asm( " .data");
@@ -158,7 +158,7 @@
158158

159159
DISP.write("""
160160
#undef IPPAPI
161-
#define IPPAPI(type,name,arg) __declspec(naked) void IPP_STDCALL name arg
161+
#define IPPAPI(type,name,arg) __declspec(naked) void IPP_CALL name arg
162162
__declspec(naked) IPP_PROC {FunName}{FunArg}
163163
{{
164164
__asm( ".L0: call .L1");

0 commit comments

Comments
 (0)