Skip to content

Commit 07c8c90

Browse files
committed
Merge branch 'dev/amatyuko-readme-fix' into 'ippcp-2020u1-os-rls'
[IPPCP][Documentation][Fix] Fixes of IPPD-2969 and IPPD-2970 See merge request ipl/ipp/crypto_os!3
2 parents 4b78865 + e12eb50 commit 07c8c90

38 files changed

+5701
-5
lines changed

BUILD.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
- [Common tools](#common-software-requirements)
3737
- Intel® C++ Compiler 19.0 Update 4 for Windows\* OS
3838
- Microsoft Visual C++ Compiler\* version 19.16 provided by Microsoft Visual Studio\* 2017 version 15.9
39+
- Microsoft Visual C++ Compiler\* version 19.24 provided by Microsoft Visual Studio\* 2019 version 16.4
3940
### macOS*
4041
- [Common tools](#common-software-requirements)
4142
- Intel® C++ Compiler 19.0 Update 4 for macOS\*
@@ -104,11 +105,18 @@ To build the Intel IPP Cryptography library on Windows* OS, complete the followi
104105
```
105106

106107
2. Set the environment variables for one of the supported C/C++ compilers.
108+
107109
For Intel® Compiler instructions, refer to the [Intel® C++ Compiler Developer Guide and Reference](https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference).
108110
For MSVC* Compiler, refer to [Use the MSVC toolset from the command line](https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=vs-2017).
109111

110112
3. Run CMake\* in the command line.
111113

114+
``` bash
115+
cmake CMakeLists.txt -B_build -G<vs_generator> [-T"Intel C++ Compiler <version>"] -DBUILD_EXAMPLES:BOOL=ON
116+
```
117+
118+
For the Visual Studio* generators options, please refer to the [CMake\* generators help](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#visual-studio-generators). The toolchain switch is optional, specify it if you want to build the library and examples using Intel(R) C++ Compiler.
119+
112120
*Examples*:
113121

114122
For Intel® C++ Compiler and Visual Studio\* 2019:
@@ -280,4 +288,4 @@ endif()
280288
# `IPPCRYPTO_LIBRARIES` - static library name
281289
# `IPPCRYPTO_INCLUDE_DIRS` - path to IPP Crypto headers
282290
# `IPPCRYPTO_ROOT_DIR` - library root dir (a folder with 'include' and 'lib' directories)
283-
```
291+
```

CHANGELOG.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Intel(R) Integrated Performance Primitives Cryptography (Intel(R) IPP Cryptography)
2+
3+
This is a list of notable changes to Intel(R) IPP Cryptography, in reverse chronological order.
4+
5+
## YYYY-MM-DD
6+
7+
## 2020-02-25
8+
- SM4-ECB, SM4-CBC and SM4-CTR were enabled for Ice Lake CPU with Intel(R) Advanced Vector Extensions 512 (Intel(R) AVX-512) GFNI instructions.
9+
- Added support of Clang 9.0 for Linux and Clang 11.0 for MacOS compilers.
10+
- Added examples of RSA Multi-Buffer Encryption/Decryption usage.
11+
- The library was enabled with Intel(R) Control-flow Enforcement Technology (CET) on Linux and Windows.
12+
- Changed API of ippsGFpECSignDSA, ippsGFpECSignNR and ippsGFpECSignSM2 functions: const-ness requirement of private ephemeral keys is removed and now the ephemeral keys are cleaned up after signing.
13+
14+
## 2019-12-13
15+
- Removed Android support. Use Linux libraries instead.
16+
- Added RSA PSS multi buffer signature generation and verification.
17+
- Added RSA PKCS#1 v1.5 multi buffer signature generation and verification.
18+
- Added RSA IFMA Muti-buffer Library.
19+
- Fixed all build warnings for supported GCC\* and MSVC\* compilres.
20+
- Assembler sources were migrated to NASM\* assembler.
21+
22+
## 2019-09-17
23+
- Added RSA multi buffer encryption and decryption.
24+
25+
## 2019-08-27
26+
- Added Intel(R) IPP Cryptography library examples: AES-CTR, RSA-OAEP, RSA-PSS.
27+
- Fixed code generation for kernel code model in Linux* Intel(R) 64 non-PIC builds.
28+
- Fixes in Intel(R) IPP Custom Library Tool.
29+
30+
## 2019-07-23
31+
- Added Microsoft\* Visual Studio\* 2019 build support.
32+
- Added Intel(R) IPP Custom Library Tool.
33+
34+
## 2019-06-24
35+
- AES-GCM was enabled with vector extensions of Intel(R) AES New Instructions (Intel(R) AES-NI).
36+
- A dynamic dispatcher library and a set of CPU-optimized dynamic libraries were replaced by a single merged dynamic library with an internal dispatcher.
37+
- Removed deprecated multi-threaded version of the library.
38+
- Removed Supplemental Streaming SIMD Extensions 3 (SSSE3) support on macOS.
39+
40+
## 2019-05-29
41+
- AES-XTS was enabled with vector extensions of Intel(R) AES New Instructions (Intel(R) AES-NI).
42+
43+
## 2019-05-22
44+
- Fixed GCC\* and MSVC\* builds of IA32 generic CPU code (pure C) with -DMERGED_BLD:BOOL=off option.
45+
- Added single-CPU headers generation.
46+
- Aligned structure of the build output directory across all supported operation systems.
47+
48+
## 2019-04-23
49+
- AES-CFB was enabled with vector extensions of Intel(R) AES New Instructions (Intel(R) AES-NI).
50+
- ippsGFpECGetPointOctString and ippsGFpECSetPointOctString now support elliptic curves over both prime and extended finite fields.
51+
52+
## 2019-04-01
53+
- 1024, 2048, 3072 and 4096 bit RSA were enabled with AVX512 IFMA instructions.
54+
- AES-ECB, AES-CBC and AES-CTR were enabled with vector extensions of Intel(R) AES New Instructions (Intel(R) AES-NI).
55+
- Improved optimization of Intel(R) AES-NI based CMAC.
56+
- Added the ippsGFpGetInfo function, which returns information about a finite field.
57+
- Added the ippsHashGetInfo_rmf function, which returns information about a hash algorithm.
58+
- Added the ability to build the Intel(R) IPP Cryptography library with GCC\* 8.2.
59+
- Fixed selection of CPU-specific code in dynamic/shared libraries.
60+
61+
## 2018-10-15
62+
- Added the new SM2 encryption scheme.
63+
- Added the ability to build the Intel(R) IPP Cryptography library with the Microsoft\* Visual C++ Compiler 2017.
64+
- Added the ability to build the Intel(R) IPP Cryptography library with the Intel(R) C++ Compiler 19.
65+
- Changed the range of the message being signed or verified by EC and DLP.
66+
- Fixed a potential security problem in the DLP signing and key generation functions.
67+
- Fixed a potential security problem in the AES-CTR cipher functions.
68+
- Fixed a potential security problem in the AES-GCM cipher functions.
69+
70+
## 2018-09-07
71+
- Deprecated the ARCFour functionality.
72+
- Fixed a potential security problem in the signing functions over elliptic curves.
73+
- Fixed a potential security problem in the key expansion function for AES Encryption.
74+
- Fixed some of the compilation warnings observed when building the static dispatcher on Windows\* OS.
75+
- Fixed minor issues with DLP functions.
76+
77+
78+
------------------------------------------------------------------------
79+
Intel is a trademark of Intel Corporation or its subsidiaries in the U.S. and/or other countries.
80+
\* Other names and brands may be claimed as the property of others.

OVERVIEW.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,9 @@
3131
## Repository Structure
3232

3333
``` bash
34-
├── CHANGELOG.md
35-
├── CMakeLists.txt < Main CMake file
34+
├── data < Repository data (documentation images, etc)
3635
├── examples < Examples of the library usage
3736
├── include < Public headers
38-
├── LICENSE
39-
├── README.md
4037
├── sources
4138
│   ├── cmake < OS-specific CMake files
4239
│   │   ├── linux
@@ -51,6 +48,12 @@
5148
│   └── ifma_rsa_mb < Sources of RSA IFMA Multi-buffer library
5249
└── tools
5350
└── ipp_custom_library_tool_python < Custom Library Tool
51+
├── BUILD.md < Build instructions
52+
├── CHANGELOG.md
53+
├── CMakeLists.txt < Main CMake file
54+
├── LICENSE
55+
├── OVERVIEW.md < This file
56+
└── README.md < High-level information about the product
5457
```
5558

5659
### Branches Description

examples/CMakeLists.txt

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
#===============================================================================
2+
# Copyright 2019-2020 Intel Corporation
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#===============================================================================
16+
17+
#
18+
# Intel(R) Integrated Performance Primitives (Intel(R) IPP) Cryptography examples
19+
#
20+
21+
# List of examples for targets generation
22+
set(IPPCP_EXAMPLES
23+
# AES examples
24+
aes/aes-256-ctr-encryption.cpp
25+
aes/aes-256-ctr-decryption.cpp
26+
# RSA SSA-PSS examples
27+
rsa/rsa-3k-pss-sha384-type1-signature.cpp
28+
rsa/rsa-1k-pss-sha1-verification.cpp
29+
# RSA OAEP examples
30+
rsa/rsa-1k-oaep-sha1-encryption.cpp
31+
rsa/rsa-1k-oaep-sha1-type2-decryption.cpp
32+
# RSA MB examples
33+
rsa_mb/rsa_mb-1k-type1-encryption-decryption.cpp
34+
# SMS4 examples
35+
sms4/sms4-128-cbc-encryption.cpp
36+
sms4/sms4-128-cbc-decryption.cpp
37+
)
38+
39+
cmake_policy(SET CMP0003 NEW)
40+
41+
# Custom target to build ALL examples at once
42+
add_custom_target(ippcp_examples_all)
43+
set_target_properties(ippcp_examples_all PROPERTIES FOLDER "examples")
44+
45+
function(ippcp_define_example out_target source_file category)
46+
# Extract file name without directory or longest extension
47+
get_filename_component(name "${source_file}" NAME_WE)
48+
# Add suffix for nonpic build
49+
if (NONPIC_LIB)
50+
set(suffix "-nonpic")
51+
endif()
52+
set(local_target "example_${name}${suffix}")
53+
# link additional sources if defined in categoryOptions.cmake
54+
set(additional_sources "${category}_CATEGORY_COMMON_SOURCES")
55+
add_executable(${local_target} "${source_file}"
56+
$<$<BOOL:${${additional_sources}}>:${${additional_sources}}>)
57+
# Static linking with merged lib is only supported
58+
ippcp_example_set_build_options(${local_target} ${IPPCP_LIB_MERGED})
59+
set_target_properties(${local_target} PROPERTIES
60+
PROJECT_LABEL "(example) ${name}" # Set name of the target in IDE
61+
FOLDER "examples/${category}" # Group projects in solution folder
62+
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_OUTPUT_DIR}/$<UPPER_CASE:$<CONFIG>>/examples") # Set output directory for examples in the build folder
63+
64+
# Add a single target to build all examples of the same category (e.g. 'make ippcp_examples_aes')
65+
set(parent_target ippcp_examples_${category})
66+
if(NOT TARGET ${parent_target})
67+
add_custom_target(${parent_target})
68+
set_target_properties(${parent_target} PROPERTIES FOLDER "examples")
69+
if(TARGET ippcp_examples_all)
70+
add_dependencies(ippcp_examples_all ${parent_target})
71+
endif()
72+
endif()
73+
add_dependencies(${parent_target} ${local_target})
74+
set(${out_target} ${local_target} PARENT_SCOPE)
75+
endfunction()
76+
77+
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_LIST_DIR)
78+
# Build with standalone library
79+
cmake_minimum_required(VERSION 3.15)
80+
81+
project("Intel(R) IPP Cryptography Examples" CXX)
82+
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
83+
84+
option(BUILD_EXAMPLES "Build examples" ON)
85+
86+
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
87+
find_package(IPPCrypto REQUIRED MODULE)
88+
89+
if (NOT IPPCRYPTO_FOUND)
90+
message(FATAL_ERROR "No Intel(R) IPP Cryptography library found on the system. To build examples with pre-built library, please specify -DIPPCRYPTO_ROOT_DIR=<path> option, where <path> is the path to directory that contains include/ and lib/ folders of Intel(R) IPP Cryptography product.")
91+
endif()
92+
93+
# Define library to link
94+
list(GET IPPCRYPTO_LIBRARIES 0 IPPCP_LIB_MERGED)
95+
# Define include folder
96+
set(IPP_CRYPTO_INCLUDE_DIR ${IPPCRYPTO_INCLUDE_DIRS})
97+
# Define output directory
98+
if(NOT CMAKE_OUTPUT_DIR)
99+
set(CMAKE_OUTPUT_DIR "${CMAKE_BINARY_DIR}/.build")
100+
endif()
101+
else()
102+
# Build with library sources
103+
if(NOT BUILD_EXAMPLES OR NOT MERGED_BLD)
104+
message(FATAL_ERROR "Only merged library build is currently supported for Intel(R) IPP Cryptography examples. Use -DMERGED_BLD:BOOL=on options.")
105+
endif()
106+
endif()
107+
108+
include(examplesBuildOptions.cmake)
109+
110+
foreach(example_filename ${IPPCP_EXAMPLES})
111+
# Extract example category from its subdirectory
112+
get_filename_component(category "${example_filename}" DIRECTORY)
113+
114+
# Source additional options that may exist for category
115+
include(${category}/categoryOptions.cmake OPTIONAL)
116+
117+
ippcp_define_example(example ${example_filename} ${category})
118+
endforeach()

examples/FindIPPCrypto.cmake

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
#===============================================================================
2+
# Copyright 2019-2020 Intel Corporation
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#===============================================================================
16+
17+
#
18+
# Intel(R) Integrated Performance Primitives (Intel(R) IPP) Cryptography library
19+
# detection routine.
20+
#
21+
# If found the following variables will be available:
22+
# IPPCRYPTO_FOUND
23+
# IPPCRYPTO_ROOT_DIR
24+
# IPPCRYPTO_INCLUDE_DIRS
25+
# IPPCRYPTO_LIBRARIES
26+
#
27+
28+
include(FindPackageHandleStandardArgs)
29+
30+
macro(ippcp_not_found)
31+
set(IPPCRYPTO_FOUND OFF)
32+
set(IPPCRYPTO_ROOT_DIR "${IPPCRYPTO_ROOT_DIR}" CACHE PATH "Path to Intel(R) IPP Cryptography root directory")
33+
return()
34+
endmacro()
35+
36+
# Try to find Intel(R) IPP Cryptography library on the system if root dir is not defined externally
37+
if (NOT IPPCRYPTO_ROOT_DIR OR NOT EXISTS "${IPPCRYPTO_ROOT_DIR}/include/ippcp.h")
38+
set(ippcp_search_paths
39+
${CMAKE_CURRENT_SOURCE_DIR}/../.build
40+
$ENV{IPPCRYPTOROOT})
41+
42+
if(WIN32)
43+
list(APPEND ippcp_search_paths
44+
$ENV{ProgramFiles\(x86\)}/IntelSWTools/compilers_and_libraries/windows/ippcp)
45+
endif()
46+
47+
if(UNIX)
48+
list(APPEND ippcp_search_paths
49+
/opt/intel/ippcp
50+
$ENV{HOME}/intel/ippcp)
51+
endif()
52+
53+
find_path(IPPCRYPTO_ROOT_DIR include/ippcp.h PATHS ${ippcp_search_paths})
54+
endif()
55+
56+
set(IPPCRYPTO_INCLUDE_DIRS "${IPPCRYPTO_ROOT_DIR}/include" CACHE PATH "Path to Intel(R) IPP Cryptography library include directory" FORCE)
57+
58+
# Check found directory
59+
if(NOT IPPCRYPTO_ROOT_DIR
60+
OR NOT EXISTS "${IPPCRYPTO_ROOT_DIR}"
61+
OR NOT EXISTS "${IPPCRYPTO_INCLUDE_DIRS}"
62+
OR NOT EXISTS "${IPPCRYPTO_INCLUDE_DIRS}/ippcpdefs.h"
63+
)
64+
ippcp_not_found()
65+
endif()
66+
67+
# Determine ARCH
68+
set(IPPCRYPTO_ARCH "ia32")
69+
if(CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
70+
set(IPPCRYPTO_ARCH "intel64")
71+
endif()
72+
if(CMAKE_SIZEOF_VOID_P)
73+
set(IPPCRYPTO_ARCH "intel64")
74+
endif()
75+
76+
# Define list of libraries to search
77+
set(IPPCP_SUFFIX "")
78+
if(WIN32)
79+
set(IPPCP_SUFFIX "mt") # static lib on Windows
80+
endif()
81+
set(ippcp_search_libraries
82+
ippcp${IPPCP_SUFFIX})
83+
84+
# Define library search paths (TODO: to handle nonpic libraries)
85+
set(ippcp_lib_search_paths "")
86+
list(APPEND ippcp_lib_search_paths
87+
${IPPCRYPTO_ROOT_DIR}/lib
88+
${IPPCRYPTO_ROOT_DIR}/lib/${IPPCRYPTO_ARCH})
89+
90+
# Set preferences to look for static libraries only
91+
if(WIN32)
92+
list(INSERT CMAKE_FIND_LIBRARY_SUFFIXES 0 .lib .a)
93+
else()
94+
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
95+
endif()
96+
97+
foreach(lib ${ippcp_search_libraries})
98+
find_library(${lib} ${lib} ${ippcp_lib_search_paths})
99+
if(NOT ${lib})
100+
ippcp_not_found()
101+
endif()
102+
list(APPEND IPPCRYPTO_LIBRARIES ${${lib}})
103+
endforeach()
104+
105+
list(REMOVE_DUPLICATES IPPCRYPTO_LIBRARIES)
106+
107+
message(STATUS "Found Intel(R) IPP Cryptography at: ${IPPCRYPTO_ROOT_DIR}")
108+
109+
set(IPPCRYPTO_FOUND ON)
110+
set(IPPCRYPTO_ROOT_DIR "${IPPCRYPTO_ROOT_DIR}" CACHE PATH "Path to Intel(R) IPP Cryptography root directory")
111+
set(IPPCRYPTO_INCLUDE_DIRS "${IPPCRYPTO_INCLUDE_DIRS}" CACHE PATH "Path to Intel(R) IPP Cryptography include directory")
112+
set(IPPCRYPTO_LIBRARIES "${IPPCRYPTO_LIBRARIES}" CACHE STRING "Intel(R) IPP Cryptography libraries")

0 commit comments

Comments
 (0)