Skip to content

Commit 739e295

Browse files
committed
Intel(R) Integrated Performance Primitives 2019 Cryptography
1 parent 01aa285 commit 739e295

File tree

9 files changed

+176
-135
lines changed

9 files changed

+176
-135
lines changed

README.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -146,25 +146,25 @@ with the options described in [CMake Arguments](#cmake-arguments).
146146
147147
4. Run CMake\* on the command line. Example CMake lines for different
148148
operating systems:
149-
149+
150150
**Windows\* OS**:
151-
151+
152152
```
153153
cmake CMakeLists.txt -Bbuild -G"Visual Studio 14 2015 Win64" -T"Intel C++ Compiler 18.0"
154154
```
155-
155+
156156
**Linux\* OS**:
157-
157+
158158
```
159159
CC=icc CXX=icpc cmake CMakeLists.txt -Bbuild -DARCH=intel64
160160
```
161-
161+
162162
**macOS\***:
163-
163+
164164
```
165165
CC=icc CXX=icpc cmake CMakeLists.txt -Bbuild -DARCH=intel64 -DUSEYASM=<path to Yasm compiler>
166166
```
167-
167+
168168
The list of supported CMake arguments is available in the
169169
[CMake Arguments](#cmake-arguments) section.
170170
@@ -173,6 +173,17 @@ with the options described in [CMake Arguments](#cmake-arguments).
173173
174174
- On Windows\* OS: open the Microsoft Visual Studio\* solution and
175175
run a build.
176+
177+
**Important:** the process used to build the Microsoft Visual Studio solutions results
178+
in debug information being generated for assembly files by default for both Debug and
179+
Release configurations. To build Intel IPP Cryptography library binaries without debug
180+
information in the Release configuration, follow these steps:
181+
182+
1. Right-click a project file and select **Properties**.
183+
2. In the **Configuration** drop-down list, select **Release**.
184+
3. Select the **Microsoft Macro Assembler** tab.
185+
4. Set the value of the **Generate Debug Information** option to **No**.
186+
5. Repeat steps 1-3 for all projects you want to build.
176187
177188
- On Linux\* OS or macOS\*: start a build using makefiles.
178189
@@ -206,7 +217,7 @@ with the options described in [CMake Arguments](#cmake-arguments).
206217
static library with all available optimizations; build of dynamic
207218
libraries with a dynamic dispatcher library.
208219
209-
- `-DMERGED_BLD:BOOL=off`: Build of one static library per
220+
- `-DMERGED_BLD:BOOL=off`: build of one static library per
210221
optimization; build of one dynamic library per optimization.
211222
212223
- `-DTHREADED_LIB:BOOL=<off|on>` - optional. Defines the threading
@@ -218,7 +229,7 @@ with the options described in [CMake Arguments](#cmake-arguments).
218229
- `-DTHREADED_LIB:BOOL=on`: build multi-threaded Intel IPP Cryptography
219230
library.
220231
221-
- `-DPLATFORM_LIST="<platform list>"` -- optional, works only if
232+
- `-DPLATFORM_LIST="<platform list>"` - optional, works only if
222233
`-DMERGED_BLD:BOOL=off` is set. Sets target platforms for the code
223234
to be compiled. See the supported platform list at
224235
<https://software.intel.com/en-us/ipp-dev-guide-dispatching>.
@@ -253,7 +264,7 @@ CC=<path to C compiler> CXX=<path to C++ compiler> cmake <Arguments>
253264
254265
#### Linux\* OS CMake Arguments:
255266
256-
- `-DNONPIC_LIB:BOOL=<off|on>` -optional. Defines whether the built
267+
- `-DNONPIC_LIB:BOOL=<off|on>` - optional. Defines whether the built
257268
library will be position-dependent or not:
258269
259270
- `-DNONPIC_LIB:BOOL=off:` default. Position-independent code.
@@ -271,7 +282,7 @@ CC=<path to C compiler> CXX=<path to C++ compiler> cmake <Arguments>
271282
`"x86_64-linux-android-"` defines the prefix for x86_64 GNU compiler
272283
tools.
273284
274-
Note: Before running CMake scripts for cross-platform build for
285+
**Note:** Before running CMake scripts for cross-platform build for
275286
Android\* OS, you need to do the following:
276287
277288
1. Set the following environment variables for Android\* NDK:

include/ippcp.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,16 +355,24 @@ IPPAPI(IppStatus, ippsAES_CMACGetTag,(Ipp8u* pMD, int mdLen, const IppsAES_CMACS
355355
// RC4 Stream Ciphers
356356
// =========================================================
357357
*/
358+
IPP_DEPRECATED("is deprecated. This function is obsolete and will be removed in one of the future IPP releases") \
358359
IPPAPI(IppStatus, ippsARCFourCheckKey, (const Ipp8u *pKey, int keyLen, IppBool* pIsWeak))
359360

361+
IPP_DEPRECATED("is deprecated. This function is obsolete and will be removed in one of the future IPP releases") \
360362
IPPAPI(IppStatus, ippsARCFourGetSize, (int* pSize))
363+
IPP_DEPRECATED("is deprecated. This function is obsolete and will be removed in one of the future IPP releases") \
361364
IPPAPI(IppStatus, ippsARCFourInit, (const Ipp8u *pKey, int keyLen, IppsARCFourState *pCtx))
365+
IPP_DEPRECATED("is deprecated. This function is obsolete and will be removed in one of the future IPP releases") \
362366
IPPAPI(IppStatus, ippsARCFourReset, (IppsARCFourState* pCtx))
363367

368+
IPP_DEPRECATED("is deprecated. This function is obsolete and will be removed in one of the future IPP releases") \
364369
IPPAPI(IppStatus, ippsARCFourPack,(const IppsARCFourState* pCtx, Ipp8u* pBuffer))
370+
IPP_DEPRECATED("is deprecated. This function is obsolete and will be removed in one of the future IPP releases") \
365371
IPPAPI(IppStatus, ippsARCFourUnpack,(const Ipp8u* pBuffer, IppsARCFourState* pCtx))
366372

373+
IPP_DEPRECATED("is deprecated. This function is obsolete and will be removed in one of the future IPP releases") \
367374
IPPAPI(IppStatus, ippsARCFourEncrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx))
375+
IPP_DEPRECATED("is deprecated. This function is obsolete and will be removed in one of the future IPP releases") \
368376
IPPAPI(IppStatus, ippsARCFourDecrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx))
369377

370378

include/ippversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
#define IPP_VERSION_MINOR 0
5454
#define IPP_VERSION_UPDATE 0
5555

56-
#define IPP_VERSION_STR "2019.0.0 Beta Refresh"
56+
#define IPP_VERSION_STR "2019.0.0"
5757

5858
#endif /* IPPVERSION_H__ */

sources/cmake/android/Intel18.0.0.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ set(CC_FLAGS_INLINE_ASM_UNIX_IA32 "-fasm-blocks -use_msasm -w -m32 -fomit-frame-
4747

4848
set(CC_FLAGS_INLINE_ASM_UNIX_INTEL64 "-fasm-blocks -use_msasm -ffixed-rdi -ffixed-rsi -ffixed-rbx -ffixed-rcx -ffixed-rdx -ffixed-rbp -ffixed-r8 -ffixed-r9 -ffixed-r12 -ffixed-r13 -ffixed-r14 -ffixed-r15")
4949

50-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS} ${LIBRARY_DEFINES}")
50+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBRARY_DEFINES}")
5151

5252
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffreestanding -restrict -qopt-report2 -qopt-report-phase:vec -std=c99 -falign-functions=32 -falign-loops=32 -diag-error 266 -diag-disable 13366 -Wformat -Wformat-security -fstack-protector")
5353
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -platform=android")

sources/cmake/linux/Intel18.0.0.cmake

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,44 @@
4242
# Intel(R) Integrated Performance Primitives (Intel(R) IPP) Cryptography
4343
#
4444

45-
# linker
46-
set(LINK_FLAG_DYNAMIC_LINUX "-nostdlib -Wl,-shared -Wl,-z,defs -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,-call_shared,-lc -Wl,-call_shared,-lm")
45+
# Linker flags
46+
47+
# Security flags
48+
set(LINK_FLAG_SECURITY "")
49+
# Disallows undefined symbols in object files. Undefined symbols in shared libraries are still allowed
50+
set(LINK_FLAG_SECURITY "${LINK_FLAG_SECURITY} -Wl,-z,defs")
51+
# Stack execution protection
52+
set(LINK_FLAG_SECURITY "${LINK_FLAG_SECURITY} -Wl,-z,noexecstack")
53+
# Data relocation and protection (RELRO)
54+
set(LINK_FLAG_SECURITY "${LINK_FLAG_SECURITY} -Wl,-z,relro -Wl,-z,now")
55+
56+
set(LINK_FLAG_DYNAMIC_LINUX "${LINK_FLAG_SECURITY} -nostdlib -Wl,-shared -Wl,-call_shared,-lc -Wl,-call_shared,-lm")
4757
if(${ARCH} MATCHES "ia32")
4858
set(LINK_FLAG_DYNAMIC_LINUX "${LINK_FLAG_DYNAMIC_LINUX} -Wl,-m,elf_i386")
4959
endif(${ARCH} MATCHES "ia32")
5060

51-
set(LINK_FLAG_PCS_LINUX "-nostdlib -Wl,-call_shared,-ldl -Wl,-call_shared,-lc -Wl,-call_shared,-lm") #check lm lc
61+
set(LINK_FLAG_PCS_LINUX "${LINK_FLAG_SECURITY} -nostdlib -Wl,-shared -Wl,-call_shared,-ldl -Wl,-call_shared,-lc -Wl,-call_shared,-lm")
5262
if(${ARCH} MATCHES "ia32")
5363
set(LINK_FLAG_PCS_LINUX "${LINK_FLAG_PCS_LINUX} -Wl,-m,elf_i386")
5464
endif(${ARCH} MATCHES "ia32")
5565

56-
# compiler
66+
# Compiler flags
5767
set(CC_FLAGS_INLINE_ASM_UNIX_IA32 "-fasm-blocks -use_msasm -w -m32 -fomit-frame-pointer")
5868

5969
set(CC_FLAGS_INLINE_ASM_UNIX_INTEL64 "-fasm-blocks -use_msasm -ffixed-rdi -ffixed-rsi -ffixed-rbx -ffixed-rcx -ffixed-rdx -ffixed-rbp -ffixed-r8 -ffixed-r9 -ffixed-r12 -ffixed-r13 -ffixed-r14 -ffixed-r15")
6070

61-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS} ${LIBRARY_DEFINES}")
71+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBRARY_DEFINES}")
72+
73+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffreestanding -restrict -qopt-report2 -qopt-report-phase:vec -std=c99 -falign-functions=32 -falign-loops=32 -diag-error 266 -diag-disable 13366")
74+
75+
# Stack-based Buffer Overrun Detection
76+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector")
77+
78+
# Format string vulnerabilities
79+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wformat -Wformat-security")
6280

63-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffreestanding -restrict -qopt-report2 -qopt-report-phase:vec -std=c99 -falign-functions=32 -falign-loops=32 -diag-error 266 -diag-disable 13366 -Wformat -Wformat-security -fstack-protector")
6481
if(NOT NONPIC_LIB)
82+
# Position Independent Execution (PIE)
6583
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fpic -fPIC")
6684
endif()
6785
if(THREADED_LIB)

sources/cmake/macosx/Intel18.0.0.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ set(CC_FLAGS_INLINE_ASM_UNIX_IA32 "-fasm-blocks -use_msasm -w -m32 -fomit-frame-
5858

5959
set(CC_FLAGS_INLINE_ASM_UNIX_INTEL64 "-fasm-blocks -use_msasm -ffixed-rdi -ffixed-rsi -ffixed-rbx -ffixed-rcx -ffixed-rdx -ffixed-rbp -ffixed-r8 -ffixed-r9 -ffixed-r12 -ffixed-r13 -ffixed-r14 -ffixed-r15")
6060

61-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS} ${LIBRARY_DEFINES}")
61+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBRARY_DEFINES}")
6262

6363
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffreestanding -restrict -qopt-report2 -qopt-report-phase:vec -std=c99 -falign-functions=32 -falign-loops=32 -diag-error 266 -diag-disable 13366 -Wformat -Wformat-security -fstack-protector")
6464
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fpic -fPIC")

sources/cmake/windows/Intel18.0.0.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ set(LINK_LIB_STATIC_RELEASE ${LINK_LIB_STATIC_RELEASE_VS2015})
5555
set(LINK_LIB_STATIC_DEBUG ${LINK_LIB_STATIC_DEBUG_VS2015})
5656

5757
# compiler
58-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS} ${LIBRARY_DEFINES}")
58+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBRARY_DEFINES}")
5959

6060
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -nologo -Qfp-speculation:safe -Qfreestanding -X -W4 -GS -Qdiag-error:266 -Qdiag-disable:13366 /Qfnalign:32 /Qalign-loops:32 -Qrestrict -Zp16 -Qvc12 -Qopt-report2 -Qopt-report-phase:vec -Qopt-report-stdout -Qsox- /Gy -Qstd=c99")
6161
if(THREADED_LIB)

sources/ippcp/CMakeLists.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ if(IPP_REVISION)
249249
set(LIBRARY_DEFINES "${LIBRARY_DEFINES} -DIPP_REVISION=${IPP_REVISION}")
250250
endif()
251251

252-
include(${COMPILER_OPTIONS_FILE}) # uses ${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS} ${LIBRARY_DEFINES} from the scope
252+
include(${COMPILER_OPTIONS_FILE}) # uses ${CMAKE_C_FLAGS} ${LIBRARY_DEFINES} from the scope
253253

254254
if(WIN32)
255255
set(OPTKEY "-Qx")
@@ -570,10 +570,9 @@ if(MERGED_BLD)
570570
else()
571571
set(IPPCP_LIB_PCS ${IPPCP_LIB_PCS} PARENT_SCOPE)
572572
if(${ARCH} MATCHES "ia32")
573-
# NOTE: O3 is reduced to O1
574-
set_source_files_properties(pcpmain.c PROPERTIES COMPILE_FLAGS "${CC_FLAGS_INLINE_ASM_UNIX_IA32} -D_GNU_SOURCE -D_FORTIFY_SOURCE=2 -O1")
573+
set_source_files_properties(pcpmain.c PROPERTIES COMPILE_FLAGS "${CC_FLAGS_INLINE_ASM_UNIX_IA32} -D_GNU_SOURCE")
575574
else()
576-
set_source_files_properties(pcpmain.c PROPERTIES COMPILE_FLAGS "${CC_FLAGS_INLINE_ASM_UNIX_INTEL64} -D_GNU_SOURCE -D_FORTIFY_SOURCE=2 -O1")
575+
set_source_files_properties(pcpmain.c PROPERTIES COMPILE_FLAGS "${CC_FLAGS_INLINE_ASM_UNIX_INTEL64} -D_GNU_SOURCE")
577576
endif()
578577
add_library(${IPPCP_LIB_PCS} SHARED pcpmain.c cpinit.c ${ASM_SOURCES_PCS})
579578
if(NOT APPLE)
@@ -589,7 +588,11 @@ if(MERGED_BLD)
589588
add_dependencies(${IPPCP_LIB_PCS} ${TARGET_NAME}_dyn_${opt})
590589
target_link_libraries(${IPPCP_LIB_PCS} ${TARGET_NAME}_dyn_${opt})
591590
endforeach()
592-
set_target_properties(${IPPCP_LIB_PCS} PROPERTIES COMPILE_FLAGS "-D_PCS -D_IPP_DYNAMIC -D_IPP_DATA")
591+
if(NOT APPLE)
592+
set_target_properties(${IPPCP_LIB_PCS} PROPERTIES COMPILE_FLAGS "-D_PCS -D_IPP_DYNAMIC -D_IPP_DATA -D_FORTIFY_SOURCE=2 -O2")
593+
else()
594+
set_target_properties(${IPPCP_LIB_PCS} PROPERTIES COMPILE_FLAGS "-D_PCS -D_IPP_DYNAMIC -D_IPP_DATA")
595+
endif(NOT APPLE)
593596
if(WIN32)
594597
foreach(link ${LINK_LIB_STATIC_DEBUG})
595598
target_link_libraries(${IPPCP_LIB_PCS} debug ${link})

0 commit comments

Comments
 (0)