Type: fix
This patch fixes the chacha20-poly1305 support check in ipsecmb
engine build.
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Signed-off-by: PiotrX Kleski <piotrx.kleski@intel.com>
Change-Id: I74b52a27f78a0f6a65c867dbd44a44a8f4a2ed60
# See the License for the specific language governing permissions and
# limitations under the License.
# See the License for the specific language governing permissions and
# limitations under the License.
-include (CheckFunctionExists)
-
if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
return()
endif()
if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
return()
endif()
- check_function_exists(ipsecmb_ops_chacha_poly HAVE_IPSECMB_CHACHA_POLY)
+ file(READ "${IPSECMB_INCLUDE_DIR}/intel-ipsec-mb.h" ipsecmb_header)
+ string(REGEX MATCH "IMB_VERSION_STR (\"+[0-9]+\\.[0-9]+\\.[0-9]+\")" _ ${ipsecmb_header})
+ string(REPLACE "\"" "" IPSECMB_VERSION ${CMAKE_MATCH_1})
- if (HAVE_IPSECMB_CHACHA_POLY)
+ if (${IPSECMB_VERSION} VERSION_GREATER "0.54.0")
add_definitions(-DHAVE_IPSECMB_CHACHA_POLY)
else()
add_definitions(-DHAVE_IPSECMB_CHACHA_POLY)
else()
- message(STATUS "Intel IPSecMB CHACHA support not found. Disabled")
+ message(STATUS "Intel IPSecMB ${IPSECMB_VERSION} does not support chacha20-poly1305. Disabled")
endif()
target_compile_options(crypto_ipsecmb_plugin PRIVATE "-march=silvermont" "-maes")
endif()
target_compile_options(crypto_ipsecmb_plugin PRIVATE "-march=silvermont" "-maes")