diff --git a/.clang-format-ignore b/.clang-format-ignore index d0431fbb..cd398b13 100644 --- a/.clang-format-ignore +++ b/.clang-format-ignore @@ -1,3 +1,3 @@ -include/aarch64_multibinary.h -include/riscv64_multibinary.h +include/internal/aarch64_multibinary.h +include/internal/riscv64_multibinary.h intel-ipsec-mb/* diff --git a/CMakeLists.txt b/CMakeLists.txt index 28fb27c7..e279a7a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,7 +91,7 @@ endif() # Set include directories set(ISAL_CRYPTO_INCLUDE_DIRS - ${CMAKE_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/include ) # Initialize EXTERN_HEADERS list @@ -162,12 +162,12 @@ endif() include(cmake/fips.cmake) -# Add common headers -list(APPEND EXTERN_HEADERS include/test.h include/types.h include/endian_helper.h) +# Add common headers (only public API headers) +list(APPEND EXTERN_HEADERS include/isa-l_crypto/types.h) # Windows .def file for symbol exports (only needed on Windows) if(WIN32) - set(ISAL_CRYPTO_DEF_FILE ${CMAKE_SOURCE_DIR}/isa-l_crypto.def) + set(ISAL_CRYPTO_DEF_FILE ${CMAKE_CURRENT_SOURCE_DIR}/isa-l_crypto.def) endif() # Create the main ISA-L Crypto library @@ -221,7 +221,7 @@ if(USE_NASM) if(source MATCHES "\\.asm$") get_filename_component(source_dir ${source} DIRECTORY) set_source_files_properties(${source} PROPERTIES - INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR};${CMAKE_SOURCE_DIR}/${source_dir}") + INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_SOURCE_DIR}/${source_dir}") endif() endforeach() endif() @@ -229,25 +229,27 @@ endif() # Include directories target_include_directories(isal_crypto PUBLIC - $ + $ $ PRIVATE - ${CMAKE_SOURCE_DIR}/aes - ${CMAKE_SOURCE_DIR}/intel-ipsec-mb/lib - ${CMAKE_SOURCE_DIR}/md5_mb - ${CMAKE_SOURCE_DIR}/sha1_mb - ${CMAKE_SOURCE_DIR}/sha256_mb - ${CMAKE_SOURCE_DIR}/sha512_mb - ${CMAKE_SOURCE_DIR}/sm3_mb - ${CMAKE_SOURCE_DIR}/mh_sha1 - ${CMAKE_SOURCE_DIR}/mh_sha256 - ${CMAKE_SOURCE_DIR}/mh_sha1_murmur3_x64_128 - ${CMAKE_SOURCE_DIR}/rolling_hash + ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto + ${CMAKE_CURRENT_SOURCE_DIR}/include/internal + ${CMAKE_CURRENT_SOURCE_DIR}/aes + ${CMAKE_CURRENT_SOURCE_DIR}/intel-ipsec-mb/lib + ${CMAKE_CURRENT_SOURCE_DIR}/md5_mb + ${CMAKE_CURRENT_SOURCE_DIR}/sha1_mb + ${CMAKE_CURRENT_SOURCE_DIR}/sha256_mb + ${CMAKE_CURRENT_SOURCE_DIR}/sha512_mb + ${CMAKE_CURRENT_SOURCE_DIR}/sm3_mb + ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1 + ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha256 + ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1_murmur3_x64_128 + ${CMAKE_CURRENT_SOURCE_DIR}/rolling_hash ) # Generate isa-l_crypto.h header set(ISAL_CRYPTO_HEADER "${CMAKE_BINARY_DIR}/isa-l_crypto.h") -configure_file(${CMAKE_SOURCE_DIR}/cmake/isa-l_crypto.h.in ${ISAL_CRYPTO_HEADER} @ONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/isa-l_crypto.h.in ${ISAL_CRYPTO_HEADER} @ONLY) # Install targets include(GNUInstallDirs) @@ -266,9 +268,9 @@ install(FILES ${ISAL_CRYPTO_HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) -# Install headers -install(DIRECTORY include/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/isa-l_crypto +# Install headers (only public headers, not internal/) +install(DIRECTORY include/isa-l_crypto + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h" ) @@ -283,7 +285,7 @@ install(EXPORT ISALCryptoTargets include(CMakePackageConfigHelpers) configure_package_config_file( - "${CMAKE_SOURCE_DIR}/cmake/ISALCryptoConfig.cmake.in" + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/ISALCryptoConfig.cmake.in" "${CMAKE_BINARY_DIR}/ISALCryptoConfig.cmake" INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ISALCrypto ) @@ -308,7 +310,7 @@ set(includedir \${prefix}/${CMAKE_INSTALL_INCLUDEDIR}) set(VERSION ${PROJECT_VERSION}) configure_file( - "${CMAKE_SOURCE_DIR}/libisal_crypto.pc.in" + "${CMAKE_CURRENT_SOURCE_DIR}/libisal_crypto.pc.in" "${CMAKE_BINARY_DIR}/libisal_crypto.pc" @ONLY ) diff --git a/Makefile.am b/Makefile.am index b2ffd647..fc3c5136 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,10 +2,10 @@ EXTRA_DIST = autogen.sh Makefile.unx make.inc Makefile.nmake isa-l_crypto.def LI CLEANFILES = LDADD = AM_MAKEFLAGS = --no-print-directory -noinst_HEADERS = -pkginclude_HEADERS = include/test.h include/types.h include/endian_helper.h +noinst_HEADERS = include/internal/test.h include/internal/endian_helper.h +pkginclude_HEADERS = include/isa-l_crypto/types.h noinst_LTLIBRARIES = -INCLUDE = -I $(srcdir)/include/ +INCLUDE = -I $(srcdir)/include -I $(srcdir)/include/isa-l_crypto -I $(srcdir)/include/internal pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libisal_crypto.pc @@ -149,7 +149,7 @@ isa-l_crypto.h: @echo '#ifndef _ISAL_CRYPTO_H_' >> $@ @echo '#define _ISAL_CRYPTO_H_' >> $@ @echo '' >> $@ - @for unit in $(sort $(extern_hdrs)); do echo "#include " | sed -e 's;include/;;' >> $@; done + @for unit in $(sort $(extern_hdrs)); do echo "#include <$$unit>" | sed -e 's;include/;;' >> $@; done @echo '#endif //_ISAL_CRYPTO_H_' >> $@ doc: isa-l_crypto.h diff --git a/Makefile.nmake b/Makefile.nmake index ccc44540..46008470 100644 --- a/Makefile.nmake +++ b/Makefile.nmake @@ -271,7 +271,7 @@ objs = \ bin\version.obj -INCLUDES = -I./ -Isha1_mb/ -Isha256_mb/ -Isha512_mb/ -Imd5_mb/ -Imh_sha1/ -Imh_sha1_murmur3_x64_128/ -Imh_sha256/ -Irolling_hash/ -Ism3_mb/ -Iaes/ -Iinclude/ -Iintel-ipsec-mb/lib +INCLUDES = -I./ -Isha1_mb/ -Isha256_mb/ -Isha512_mb/ -Imd5_mb/ -Imh_sha1/ -Imh_sha1_murmur3_x64_128/ -Imh_sha256/ -Irolling_hash/ -Ism3_mb/ -Iaes/ -Iinclude/ -Iinclude/isa-l_crypto/ -Iinclude/internal/ -Iintel-ipsec-mb/lib # Modern asm feature level, consider upgrading nasm before decreasing feature_level CFLAGS_REL = -O2 -DNDEBUG /Z7 /MD /Gy /ZH:SHA_256 /guard:cf CFLAGS_DBG = -Od -DDEBUG /Z7 /MDd diff --git a/aes/Makefile.am b/aes/Makefile.am index 2aa05d30..3ccd10aa 100644 --- a/aes/Makefile.am +++ b/aes/Makefile.am @@ -31,7 +31,7 @@ src_include += -I $(srcdir)/aes src_include += -I $(srcdir)/intel-ipsec-mb/lib -extern_hdrs += include/aes_gcm.h include/aes_cbc.h include/aes_xts.h include/aes_keyexp.h include/isal_crypto_api.h +extern_hdrs += include/isa-l_crypto/aes_gcm.h include/isa-l_crypto/aes_cbc.h include/isa-l_crypto/aes_xts.h include/isa-l_crypto/aes_keyexp.h include/isa-l_crypto/isal_crypto_api.h lsrc += aes/gcm_pre.c lsrc += aes/cbc_pre.c @@ -112,7 +112,7 @@ lsrc_aarch64 += aes/aarch64/gcm_multibinary_aarch64.S \ aes/aarch64/cbc_dec_aes.S other_src += include/multibinary.asm -other_src += include/test.h include/types.h include/reg_sizes.asm +other_src += include/internal/test.h include/isa-l_crypto/types.h include/reg_sizes.asm other_src += aes/gcm_defines.asm other_src += aes/aes_common.asm other_src += aes/clear_regs.asm diff --git a/cmake/aes.cmake b/cmake/aes.cmake index 3ea226de..f77a97df 100644 --- a/cmake/aes.cmake +++ b/cmake/aes.cmake @@ -146,11 +146,11 @@ endif() # Headers exported by aes module set(AES_HEADERS - include/aes_gcm.h - include/aes_cbc.h - include/aes_xts.h - include/aes_keyexp.h - include/isal_crypto_api.h + include/isa-l_crypto/aes_gcm.h + include/isa-l_crypto/aes_cbc.h + include/isa-l_crypto/aes_xts.h + include/isa-l_crypto/aes_keyexp.h + include/isa-l_crypto/isal_crypto_api.h ) # Add to main extern headers list @@ -202,7 +202,7 @@ if(BUILD_TESTS OR BUILD_PERF) get_filename_component(test_exec ${test_name} NAME) add_executable(${test_exec} ${test_name}.c) target_link_libraries(${test_exec} PRIVATE isal_crypto) - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/aes) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/aes) add_test(NAME ${test_exec} COMMAND ${test_exec}) endforeach() @@ -214,7 +214,7 @@ if(BUILD_TESTS OR BUILD_PERF) if(OPENSSL_FOUND) target_link_libraries(${test_exec} PRIVATE OpenSSL::Crypto) endif() - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/aes) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/aes) endforeach() # Build examples @@ -222,7 +222,7 @@ if(BUILD_TESTS OR BUILD_PERF) get_filename_component(example_exec ${example_name} NAME) add_executable(${example_exec} ${example_name}.c) target_link_libraries(${example_exec} PRIVATE isal_crypto) - target_include_directories(${example_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/aes) + target_include_directories(${example_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/aes) endforeach() endif() @@ -235,7 +235,7 @@ if(BUILD_TESTS OR BUILD_PERF) if(OPENSSL_FOUND) target_link_libraries(${test_exec} PRIVATE OpenSSL::Crypto) endif() - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/aes) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/aes) endforeach() endif() endif() diff --git a/cmake/fips.cmake b/cmake/fips.cmake index 578a4a7a..50b8b76b 100644 --- a/cmake/fips.cmake +++ b/cmake/fips.cmake @@ -75,7 +75,7 @@ if(BUILD_TESTS) get_filename_component(test_exec ${test_name} NAME) add_executable(${test_exec} ${test_name}.c) target_link_libraries(${test_exec} PRIVATE isal_crypto) - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/fips) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/fips) add_test(NAME ${test_exec} COMMAND ${test_exec}) endforeach() endif() diff --git a/cmake/isa-l_crypto.h.in b/cmake/isa-l_crypto.h.in index 4743b381..da92e603 100644 --- a/cmake/isa-l_crypto.h.in +++ b/cmake/isa-l_crypto.h.in @@ -56,8 +56,6 @@ #include #include #include -#include #include -#include #endif //_ISAL_CRYPTO_H_ diff --git a/cmake/md5_mb.cmake b/cmake/md5_mb.cmake index fb0cbbbc..dc8ee0a9 100644 --- a/cmake/md5_mb.cmake +++ b/cmake/md5_mb.cmake @@ -95,8 +95,8 @@ endif() # Headers exported by md5_mb module set(MD5_MB_HEADERS - include/md5_mb.h - include/multi_buffer.h + include/isa-l_crypto/md5_mb.h + include/isa-l_crypto/multi_buffer.h ) # Add to main extern headers list @@ -129,7 +129,7 @@ if(BUILD_TESTS OR BUILD_PERF) add_executable(${test_exec} ${test_name}.c) endif() target_link_libraries(${test_exec} PRIVATE isal_crypto) - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/md5_mb) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/md5_mb) add_test(NAME ${test_exec} COMMAND ${test_exec}) endforeach() @@ -141,7 +141,7 @@ if(BUILD_TESTS OR BUILD_PERF) if(OPENSSL_FOUND) target_link_libraries(${test_exec} PRIVATE OpenSSL::Crypto) endif() - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/md5_mb) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/md5_mb) endforeach() endif() @@ -154,7 +154,7 @@ if(BUILD_TESTS OR BUILD_PERF) if(OPENSSL_FOUND) target_link_libraries(${test_exec} PRIVATE OpenSSL::Crypto) endif() - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/md5_mb) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/md5_mb) endforeach() endif() endif() diff --git a/cmake/mh_sha1.cmake b/cmake/mh_sha1.cmake index c184e156..86c42be1 100644 --- a/cmake/mh_sha1.cmake +++ b/cmake/mh_sha1.cmake @@ -79,7 +79,7 @@ endif() # Headers exported by mh_sha1 module set(MH_SHA1_HEADERS - include/mh_sha1.h + include/isa-l_crypto/mh_sha1.h ) # Add to main extern headers list @@ -110,7 +110,7 @@ if(BUILD_TESTS OR BUILD_PERF) add_executable(${test_exec} ${test_name}.c) endif() target_link_libraries(${test_exec} PRIVATE isal_crypto) - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mh_sha1) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1) add_test(NAME ${test_exec} COMMAND ${test_exec}) endforeach() @@ -119,7 +119,7 @@ if(BUILD_TESTS OR BUILD_PERF) # mh_sha1_update_test also needs mh_sha1_ref.c add_executable(${test_exec} ${test_name}.c mh_sha1/mh_sha1_ref.c) target_link_libraries(${test_exec} PRIVATE isal_crypto) - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mh_sha1) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1) add_test(NAME ${test_exec} COMMAND ${test_exec}) endforeach() endif() @@ -129,7 +129,7 @@ if(BUILD_TESTS OR BUILD_PERF) get_filename_component(test_exec ${test_name} NAME) add_executable(${test_exec} ${test_name}.c) target_link_libraries(${test_exec} PRIVATE isal_crypto) - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mh_sha1) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1) endforeach() endif() endif() diff --git a/cmake/mh_sha1_murmur3_x64_128.cmake b/cmake/mh_sha1_murmur3_x64_128.cmake index e937329b..616acffb 100644 --- a/cmake/mh_sha1_murmur3_x64_128.cmake +++ b/cmake/mh_sha1_murmur3_x64_128.cmake @@ -75,7 +75,7 @@ endif() # Headers exported by mh_sha1_murmur3_x64_128 module set(MH_SHA1_MURMUR3_HEADERS - include/mh_sha1_murmur3_x64_128.h + include/isa-l_crypto/mh_sha1_murmur3_x64_128.h ) # Add to main extern headers list @@ -102,7 +102,7 @@ if(BUILD_TESTS OR BUILD_PERF) # Tests need both mh_sha1_ref.c and murmur3_x64_128.c add_executable(${test_exec} ${test_name}.c mh_sha1/mh_sha1_ref.c mh_sha1_murmur3_x64_128/murmur3_x64_128.c) target_link_libraries(${test_exec} PRIVATE isal_crypto) - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mh_sha1 ${CMAKE_SOURCE_DIR}/mh_sha1_murmur3_x64_128) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1 ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1_murmur3_x64_128) add_test(NAME ${test_exec} COMMAND ${test_exec}) endforeach() @@ -111,7 +111,7 @@ if(BUILD_TESTS OR BUILD_PERF) # Unit tests also need both helper files add_executable(${test_exec} ${test_name}.c mh_sha1/mh_sha1_ref.c mh_sha1_murmur3_x64_128/murmur3_x64_128.c) target_link_libraries(${test_exec} PRIVATE isal_crypto) - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mh_sha1 ${CMAKE_SOURCE_DIR}/mh_sha1_murmur3_x64_128) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1 ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1_murmur3_x64_128) add_test(NAME ${test_exec} COMMAND ${test_exec}) endforeach() endif() @@ -121,7 +121,7 @@ if(BUILD_TESTS OR BUILD_PERF) get_filename_component(test_exec ${test_name} NAME) add_executable(${test_exec} ${test_name}.c mh_sha1/mh_sha1_ref.c mh_sha1_murmur3_x64_128/murmur3_x64_128.c) target_link_libraries(${test_exec} PRIVATE isal_crypto) - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mh_sha1 ${CMAKE_SOURCE_DIR}/mh_sha1_murmur3_x64_128) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1 ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1_murmur3_x64_128) endforeach() endif() endif() diff --git a/cmake/mh_sha256.cmake b/cmake/mh_sha256.cmake index 76b64b11..4b756d8f 100644 --- a/cmake/mh_sha256.cmake +++ b/cmake/mh_sha256.cmake @@ -74,7 +74,7 @@ endif() # Headers exported by mh_sha256 module set(MH_SHA256_HEADERS - include/mh_sha256.h + include/isa-l_crypto/mh_sha256.h ) # Add to main extern headers list @@ -105,7 +105,7 @@ if(BUILD_TESTS OR BUILD_PERF) add_executable(${test_exec} ${test_name}.c) endif() target_link_libraries(${test_exec} PRIVATE isal_crypto) - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mh_sha256) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha256) add_test(NAME ${test_exec} COMMAND ${test_exec}) endforeach() @@ -114,7 +114,7 @@ if(BUILD_TESTS OR BUILD_PERF) # mh_sha256_update_test also needs mh_sha256_ref.c add_executable(${test_exec} ${test_name}.c mh_sha256/mh_sha256_ref.c) target_link_libraries(${test_exec} PRIVATE isal_crypto) - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mh_sha256) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha256) add_test(NAME ${test_exec} COMMAND ${test_exec}) endforeach() endif() @@ -124,7 +124,7 @@ if(BUILD_TESTS OR BUILD_PERF) get_filename_component(test_exec ${test_name} NAME) add_executable(${test_exec} ${test_name}.c) target_link_libraries(${test_exec} PRIVATE isal_crypto) - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mh_sha256) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha256) endforeach() endif() endif() diff --git a/cmake/misc.cmake b/cmake/misc.cmake index 33532c57..f81048ed 100644 --- a/cmake/misc.cmake +++ b/cmake/misc.cmake @@ -33,7 +33,7 @@ set(MISC_SOURCES # Headers exported by misc module set(MISC_HEADERS - include/isal_crypto_api.h + include/isa-l_crypto/isal_crypto_api.h ) # Add to main extern headers list @@ -49,7 +49,7 @@ if(BUILD_TESTS) get_filename_component(test_exec ${test_name} NAME) add_executable(${test_exec} ${test_name}.c) target_link_libraries(${test_exec} PRIVATE isal_crypto) - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/misc) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/misc) add_test(NAME ${test_exec} COMMAND ${test_exec}) endforeach() endif() diff --git a/cmake/rolling_hash.cmake b/cmake/rolling_hash.cmake index 50cb40af..a11dc432 100644 --- a/cmake/rolling_hash.cmake +++ b/cmake/rolling_hash.cmake @@ -67,7 +67,7 @@ endif() # Headers exported by rolling_hash module set(ROLLING_HASH_HEADERS - include/rolling_hashx.h + include/isa-l_crypto/rolling_hashx.h ) # Add to main extern headers list @@ -89,7 +89,7 @@ if(BUILD_TESTS OR BUILD_PERF) get_filename_component(test_exec ${test_name} NAME) add_executable(${test_exec} ${test_name}.c) target_link_libraries(${test_exec} PRIVATE isal_crypto) - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/rolling_hash) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/rolling_hash) add_test(NAME ${test_exec} COMMAND ${test_exec}) endforeach() endif() @@ -99,7 +99,7 @@ if(BUILD_TESTS OR BUILD_PERF) get_filename_component(test_exec ${test_name} NAME) add_executable(${test_exec} ${test_name}.c) target_link_libraries(${test_exec} PRIVATE isal_crypto) - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/rolling_hash) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/rolling_hash) endforeach() endif() endif() diff --git a/cmake/sha1_mb.cmake b/cmake/sha1_mb.cmake index 8f01c69f..c69c8880 100644 --- a/cmake/sha1_mb.cmake +++ b/cmake/sha1_mb.cmake @@ -105,8 +105,8 @@ endif() # Headers exported by sha1_mb module set(SHA1_MB_HEADERS - include/sha1_mb.h - include/multi_buffer.h + include/isa-l_crypto/sha1_mb.h + include/isa-l_crypto/multi_buffer.h ) # Add to main extern headers list @@ -140,7 +140,7 @@ if(BUILD_TESTS OR BUILD_PERF) add_executable(${test_exec} ${test_name}.c) endif() target_link_libraries(${test_exec} PRIVATE isal_crypto) - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sha1_mb) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/sha1_mb) add_test(NAME ${test_exec} COMMAND ${test_exec}) endforeach() @@ -153,7 +153,7 @@ if(BUILD_TESTS OR BUILD_PERF) if(OPENSSL_FOUND) target_link_libraries(${test_exec} PRIVATE OpenSSL::Crypto) endif() - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sha1_mb) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/sha1_mb) add_test(NAME ${test_exec} COMMAND ${test_exec}) endforeach() endif() @@ -167,7 +167,7 @@ if(BUILD_TESTS OR BUILD_PERF) if(OPENSSL_FOUND) target_link_libraries(${test_exec} PRIVATE OpenSSL::Crypto) endif() - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sha1_mb) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/sha1_mb) endforeach() endif() endif() diff --git a/cmake/sha256_mb.cmake b/cmake/sha256_mb.cmake index 1dccad44..2ce143b1 100644 --- a/cmake/sha256_mb.cmake +++ b/cmake/sha256_mb.cmake @@ -101,8 +101,8 @@ endif() # Headers exported by sha256_mb module set(SHA256_MB_HEADERS - include/sha256_mb.h - include/multi_buffer.h + include/isa-l_crypto/sha256_mb.h + include/isa-l_crypto/multi_buffer.h ) # Add to main extern headers list @@ -136,7 +136,7 @@ if(BUILD_TESTS OR BUILD_PERF) add_executable(${test_exec} ${test_name}.c) endif() target_link_libraries(${test_exec} PRIVATE isal_crypto) - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sha256_mb) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/sha256_mb) add_test(NAME ${test_exec} COMMAND ${test_exec}) endforeach() @@ -149,7 +149,7 @@ if(BUILD_TESTS OR BUILD_PERF) if(OPENSSL_FOUND) target_link_libraries(${test_exec} PRIVATE OpenSSL::Crypto) endif() - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sha256_mb) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/sha256_mb) add_test(NAME ${test_exec} COMMAND ${test_exec}) endforeach() endif() @@ -163,7 +163,7 @@ if(BUILD_TESTS OR BUILD_PERF) if(OPENSSL_FOUND) target_link_libraries(${test_exec} PRIVATE OpenSSL::Crypto) endif() - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sha256_mb) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/sha256_mb) endforeach() endif() endif() diff --git a/cmake/sha512_mb.cmake b/cmake/sha512_mb.cmake index fb942c3b..f5c745a8 100644 --- a/cmake/sha512_mb.cmake +++ b/cmake/sha512_mb.cmake @@ -98,8 +98,8 @@ endif() # Headers exported by sha512_mb module set(SHA512_MB_HEADERS - include/sha512_mb.h - include/multi_buffer.h + include/isa-l_crypto/sha512_mb.h + include/isa-l_crypto/multi_buffer.h ) # Add to main extern headers list @@ -132,7 +132,7 @@ if(BUILD_TESTS OR BUILD_PERF) add_executable(${test_exec} ${test_name}.c) endif() target_link_libraries(${test_exec} PRIVATE isal_crypto) - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sha512_mb) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/sha512_mb) add_test(NAME ${test_exec} COMMAND ${test_exec}) endforeach() @@ -145,7 +145,7 @@ if(BUILD_TESTS OR BUILD_PERF) if(OPENSSL_FOUND) target_link_libraries(${test_exec} PRIVATE OpenSSL::Crypto) endif() - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sha512_mb) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/sha512_mb) add_test(NAME ${test_exec} COMMAND ${test_exec}) endforeach() endif() @@ -159,7 +159,7 @@ if(BUILD_TESTS OR BUILD_PERF) if(OPENSSL_FOUND) target_link_libraries(${test_exec} PRIVATE OpenSSL::Crypto) endif() - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sha512_mb) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/sha512_mb) endforeach() endif() endif() diff --git a/cmake/sm3_mb.cmake b/cmake/sm3_mb.cmake index 6daf2816..6d8e2679 100644 --- a/cmake/sm3_mb.cmake +++ b/cmake/sm3_mb.cmake @@ -94,8 +94,8 @@ endif() # Headers exported by sm3_mb module set(SM3_MB_HEADERS - include/sm3_mb.h - include/multi_buffer.h + include/isa-l_crypto/sm3_mb.h + include/isa-l_crypto/multi_buffer.h ) # Add to main extern headers list @@ -130,7 +130,7 @@ if(BUILD_TESTS OR BUILD_PERF) if(OPENSSL_FOUND) target_link_libraries(${test_exec} PRIVATE OpenSSL::Crypto) endif() - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sm3_mb) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/sm3_mb) add_test(NAME ${test_exec} COMMAND ${test_exec}) endforeach() @@ -142,7 +142,7 @@ if(BUILD_TESTS OR BUILD_PERF) if(OPENSSL_FOUND) target_link_libraries(${test_exec} PRIVATE OpenSSL::Crypto) endif() - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sm3_mb) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/sm3_mb) add_test(NAME ${test_exec} COMMAND ${test_exec}) endforeach() endif() @@ -156,7 +156,7 @@ if(BUILD_TESTS OR BUILD_PERF) if(OPENSSL_FOUND) target_link_libraries(${test_exec} PRIVATE OpenSSL::Crypto) endif() - target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sm3_mb) + target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/sm3_mb) endforeach() endif() endif() diff --git a/fips/Makefile.am b/fips/Makefile.am index d088ba14..329ad9d5 100644 --- a/fips/Makefile.am +++ b/fips/Makefile.am @@ -28,7 +28,7 @@ ######################################################################## src_include += -I $(srcdir)/fips -extern_hdrs += include/isal_crypto_api.h include/aes_xts.h include/aes_keyexp.h include/sha1_mb.h include/sha256_mb.h +extern_hdrs += include/isa-l_crypto/isal_crypto_api.h include/isa-l_crypto/aes_xts.h include/isa-l_crypto/aes_keyexp.h include/isa-l_crypto/sha1_mb.h include/isa-l_crypto/sha256_mb.h lsrc_x86_64 += fips/self_tests.c fips/aes_self_tests.c lsrc_aarch64 += fips/self_tests_generic.c fips/aes_self_tests.c @@ -39,6 +39,6 @@ lsrc_x86_64 += fips/asm_self_tests.asm lsrc_base_aliases += fips/self_tests_generic.c -other_src += include/test.h include/types.h include/reg_sizes.asm include/aes_keyexp_internal.h include/aes_cbc_internal.h +other_src += include/internal/test.h include/isa-l_crypto/types.h include/reg_sizes.asm include/internal/aes_keyexp_internal.h include/internal/aes_cbc_internal.h check_tests += fips/self_tests_test diff --git a/include/aarch64_multibinary.h b/include/internal/aarch64_multibinary.h similarity index 100% rename from include/aarch64_multibinary.h rename to include/internal/aarch64_multibinary.h diff --git a/include/aes_cbc_internal.h b/include/internal/aes_cbc_internal.h similarity index 100% rename from include/aes_cbc_internal.h rename to include/internal/aes_cbc_internal.h diff --git a/include/aes_gcm_internal.h b/include/internal/aes_gcm_internal.h similarity index 100% rename from include/aes_gcm_internal.h rename to include/internal/aes_gcm_internal.h diff --git a/include/aes_keyexp_internal.h b/include/internal/aes_keyexp_internal.h similarity index 100% rename from include/aes_keyexp_internal.h rename to include/internal/aes_keyexp_internal.h diff --git a/include/aes_xts_internal.h b/include/internal/aes_xts_internal.h similarity index 100% rename from include/aes_xts_internal.h rename to include/internal/aes_xts_internal.h diff --git a/include/endian_helper.h b/include/internal/endian_helper.h similarity index 100% rename from include/endian_helper.h rename to include/internal/endian_helper.h diff --git a/include/intrinreg.h b/include/internal/intrinreg.h similarity index 100% rename from include/intrinreg.h rename to include/internal/intrinreg.h diff --git a/include/md5_mb_internal.h b/include/internal/md5_mb_internal.h similarity index 100% rename from include/md5_mb_internal.h rename to include/internal/md5_mb_internal.h diff --git a/include/memcpy_inline.h b/include/internal/memcpy_inline.h similarity index 100% rename from include/memcpy_inline.h rename to include/internal/memcpy_inline.h diff --git a/include/riscv64_multibinary.h b/include/internal/riscv64_multibinary.h similarity index 100% rename from include/riscv64_multibinary.h rename to include/internal/riscv64_multibinary.h diff --git a/include/sha1_mb_internal.h b/include/internal/sha1_mb_internal.h similarity index 100% rename from include/sha1_mb_internal.h rename to include/internal/sha1_mb_internal.h diff --git a/include/sha256_mb_internal.h b/include/internal/sha256_mb_internal.h similarity index 100% rename from include/sha256_mb_internal.h rename to include/internal/sha256_mb_internal.h diff --git a/include/sha512_mb_internal.h b/include/internal/sha512_mb_internal.h similarity index 100% rename from include/sha512_mb_internal.h rename to include/internal/sha512_mb_internal.h diff --git a/include/sm3_mb_internal.h b/include/internal/sm3_mb_internal.h similarity index 100% rename from include/sm3_mb_internal.h rename to include/internal/sm3_mb_internal.h diff --git a/include/test.h b/include/internal/test.h similarity index 100% rename from include/test.h rename to include/internal/test.h diff --git a/include/aes_cbc.h b/include/isa-l_crypto/aes_cbc.h similarity index 100% rename from include/aes_cbc.h rename to include/isa-l_crypto/aes_cbc.h diff --git a/include/aes_gcm.h b/include/isa-l_crypto/aes_gcm.h similarity index 100% rename from include/aes_gcm.h rename to include/isa-l_crypto/aes_gcm.h diff --git a/include/aes_keyexp.h b/include/isa-l_crypto/aes_keyexp.h similarity index 100% rename from include/aes_keyexp.h rename to include/isa-l_crypto/aes_keyexp.h diff --git a/include/aes_xts.h b/include/isa-l_crypto/aes_xts.h similarity index 100% rename from include/aes_xts.h rename to include/isa-l_crypto/aes_xts.h diff --git a/include/isal_crypto_api.h b/include/isa-l_crypto/isal_crypto_api.h similarity index 100% rename from include/isal_crypto_api.h rename to include/isa-l_crypto/isal_crypto_api.h diff --git a/include/md5_mb.h b/include/isa-l_crypto/md5_mb.h similarity index 100% rename from include/md5_mb.h rename to include/isa-l_crypto/md5_mb.h diff --git a/include/mh_sha1.h b/include/isa-l_crypto/mh_sha1.h similarity index 100% rename from include/mh_sha1.h rename to include/isa-l_crypto/mh_sha1.h diff --git a/include/mh_sha1_murmur3_x64_128.h b/include/isa-l_crypto/mh_sha1_murmur3_x64_128.h similarity index 100% rename from include/mh_sha1_murmur3_x64_128.h rename to include/isa-l_crypto/mh_sha1_murmur3_x64_128.h diff --git a/include/mh_sha256.h b/include/isa-l_crypto/mh_sha256.h similarity index 100% rename from include/mh_sha256.h rename to include/isa-l_crypto/mh_sha256.h diff --git a/include/multi_buffer.h b/include/isa-l_crypto/multi_buffer.h similarity index 100% rename from include/multi_buffer.h rename to include/isa-l_crypto/multi_buffer.h diff --git a/include/rolling_hashx.h b/include/isa-l_crypto/rolling_hashx.h similarity index 100% rename from include/rolling_hashx.h rename to include/isa-l_crypto/rolling_hashx.h diff --git a/include/sha1_mb.h b/include/isa-l_crypto/sha1_mb.h similarity index 100% rename from include/sha1_mb.h rename to include/isa-l_crypto/sha1_mb.h diff --git a/include/sha256_mb.h b/include/isa-l_crypto/sha256_mb.h similarity index 100% rename from include/sha256_mb.h rename to include/isa-l_crypto/sha256_mb.h diff --git a/include/sha512_mb.h b/include/isa-l_crypto/sha512_mb.h similarity index 100% rename from include/sha512_mb.h rename to include/isa-l_crypto/sha512_mb.h diff --git a/include/sm3_mb.h b/include/isa-l_crypto/sm3_mb.h similarity index 100% rename from include/sm3_mb.h rename to include/isa-l_crypto/sm3_mb.h diff --git a/include/types.h b/include/isa-l_crypto/types.h similarity index 100% rename from include/types.h rename to include/isa-l_crypto/types.h diff --git a/make.inc b/make.inc index b1264dac..36d2c99a 100644 --- a/make.inc +++ b/make.inc @@ -109,7 +109,7 @@ CFLAGS_noarch= -DNOARCH ifeq ($(arch),noarch) host_cpu=base_aliases endif -INCLUDE = $(patsubst %,-I%/,$(subst :, ,$(VPATH))) +INCLUDE = $(patsubst %,-I%/,$(subst :, ,$(VPATH))) -Iinclude/ -Iinclude/isa-l_crypto/ -Iinclude/internal/ CFLAGS = $(CFLAGS_$(arch)) $(CFLAGS_$(CC)) $(DEBUG) -O2 $(DEFINES) $(INCLUDE) ASFLAGS = $(ASFLAGS_$(arch)) $(ASFLAGS_$(CC)) $(DEBUG_$(AS)) $(DEFINES) $(INCLUDE) ARFLAGS = $(ARFLAGS_$(arch)) @@ -300,8 +300,7 @@ install: $(sort $(extern_hdrs)) | $(install_dirs) $(lib_name) $(so_lib_name) isa install -m 644 $(lib_name) $(prefix)/lib/libisal_crypto.a install -m 644 $^ $(prefix)/include/isa-l_crypto/. install -m 664 isa-l_crypto.h $(prefix)/include/. - install -m 664 include/types.h $(prefix)/include/isa-l_crypto/. - install -m 664 include/endian_helper.h $(prefix)/include/isa-l_crypto/. + install -m 664 include/isa-l_crypto/types.h $(prefix)/include/isa-l_crypto/. install -m 664 $(so_lib_name) $(prefix)/lib/$(so_lib_ver) (cd $(prefix)/lib && ln -f -s $(so_lib_ver) $(soname) && ln -f -s $(so_lib_ver) $(so_lib_inst)) ifeq ($(shell uname),Darwin) diff --git a/md5_mb/Makefile.am b/md5_mb/Makefile.am index 65248fd8..e5c469d9 100644 --- a/md5_mb/Makefile.am +++ b/md5_mb/Makefile.am @@ -74,8 +74,8 @@ lsrc_base_aliases += md5_mb/md5_ctx_base.c \ md5_mb/md5_ctx_base_aliases.c src_include += -I $(srcdir)/md5_mb -extern_hdrs += include/md5_mb.h \ - include/multi_buffer.h +extern_hdrs += include/isa-l_crypto/md5_mb.h \ + include/isa-l_crypto/multi_buffer.h other_src += include/datastruct.asm \ md5_mb/md5_job.asm \ @@ -83,8 +83,8 @@ other_src += include/datastruct.asm \ md5_mb/md5_ref.c \ include/reg_sizes.asm \ include/multibinary.asm \ - include/memcpy_inline.h \ - include/intrinreg.h + include/internal/memcpy_inline.h \ + include/internal/intrinreg.h check_tests += md5_mb/md5_mb_test \ md5_mb/md5_mb_rand_test \ diff --git a/mh_sha1/Makefile.am b/mh_sha1/Makefile.am index f67bc123..b0be18e7 100644 --- a/mh_sha1/Makefile.am +++ b/mh_sha1/Makefile.am @@ -66,12 +66,12 @@ lsrc_base_aliases += \ other_src += mh_sha1/mh_sha1_ref.c \ include/reg_sizes.asm \ include/multibinary.asm \ - include/test.h \ - mh_sha1/mh_sha1_internal.h + mh_sha1/mh_sha1_internal.h \ + include/internal/test.h src_include += -I $(srcdir)/mh_sha1 -extern_hdrs += include/mh_sha1.h +extern_hdrs += include/isa-l_crypto/mh_sha1.h check_tests += mh_sha1/mh_sha1_test check_tests += mh_sha1/mh_sha1_param_test diff --git a/mh_sha1_murmur3_x64_128/Makefile.am b/mh_sha1_murmur3_x64_128/Makefile.am index 90589360..9a845541 100644 --- a/mh_sha1_murmur3_x64_128/Makefile.am +++ b/mh_sha1_murmur3_x64_128/Makefile.am @@ -68,14 +68,14 @@ lsrc_base_aliases += $(lsrc_murmur) \ other_src += include/reg_sizes.asm \ include/multibinary.asm \ - include/test.h \ mh_sha1/mh_sha1_internal.h \ mh_sha1_murmur3_x64_128/murmur3_x64_128.c \ - mh_sha1_murmur3_x64_128/mh_sha1_murmur3_x64_128_internal.h + mh_sha1_murmur3_x64_128/mh_sha1_murmur3_x64_128_internal.h \ + include/internal/test.h src_include += -I $(srcdir)/mh_sha1_murmur3_x64_128 -extern_hdrs += include/mh_sha1_murmur3_x64_128.h +extern_hdrs += include/isa-l_crypto/mh_sha1_murmur3_x64_128.h check_tests += mh_sha1_murmur3_x64_128/mh_sha1_murmur3_x64_128_param_test diff --git a/mh_sha256/Makefile.am b/mh_sha256/Makefile.am index 459122f7..ee9483d3 100644 --- a/mh_sha256/Makefile.am +++ b/mh_sha256/Makefile.am @@ -47,8 +47,8 @@ lsrc_x86_64 += $(lsrc_sha256) \ other_src += mh_sha256/mh_sha256_ref.c \ include/reg_sizes.asm \ include/multibinary.asm \ - include/test.h \ - mh_sha256/mh_sha256_internal.h + mh_sha256/mh_sha256_internal.h \ + include/internal/test.h lsrc_aarch64 += $(lsrc_sha256) \ mh_sha256/aarch64/mh_sha256_multibinary.S \ @@ -79,7 +79,7 @@ lsrc_base_aliases += $(lsrc_sha256) \ src_include += -I $(srcdir)/mh_sha256 -extern_hdrs += include/mh_sha256.h +extern_hdrs += include/isa-l_crypto/mh_sha256.h check_tests += mh_sha256/mh_sha256_test check_tests += mh_sha256/mh_sha256_param_test diff --git a/misc/Makefile.am b/misc/Makefile.am index 95fbffe8..62f8fcc9 100644 --- a/misc/Makefile.am +++ b/misc/Makefile.am @@ -29,6 +29,6 @@ lsrc += misc/version.c -extern_hdrs += include/isal_crypto_api.h +extern_hdrs += include/isa-l_crypto/isal_crypto_api.h check_tests += misc/version_test diff --git a/rolling_hash/Makefile.am b/rolling_hash/Makefile.am index 49488abd..03409ae8 100644 --- a/rolling_hash/Makefile.am +++ b/rolling_hash/Makefile.am @@ -49,10 +49,11 @@ lsrc_riscv64 += rolling_hash/rolling_hashx_base.c \ rolling_hash/rolling_hash2_base_aliases.c src_include += -I $(srcdir)/rolling_hash -extern_hdrs += include/rolling_hashx.h +extern_hdrs += include/isa-l_crypto/rolling_hashx.h other_src += rolling_hash/rolling_hash2_table.h -other_src += include/test.h include/types.h +other_src += include/isa-l_crypto/types.h +other_src += include/internal/test.h check_tests += rolling_hash/rolling_hash2_test \ rolling_hash/rolling_hash2_param_test diff --git a/sha1_mb/Makefile.am b/sha1_mb/Makefile.am index 2c87882e..aa5b5b9d 100644 --- a/sha1_mb/Makefile.am +++ b/sha1_mb/Makefile.am @@ -87,8 +87,8 @@ lsrc_base_aliases += sha1_mb/sha1_ctx_base_aliases.c \ src_include += -I $(srcdir)/sha1_mb -extern_hdrs += include/sha1_mb.h \ - include/multi_buffer.h +extern_hdrs += include/isa-l_crypto/sha1_mb.h \ + include/isa-l_crypto/multi_buffer.h other_src += include/datastruct.asm \ include/multibinary.asm \ @@ -96,9 +96,9 @@ other_src += include/datastruct.asm \ sha1_mb/sha1_mb_mgr_datastruct.asm \ include/reg_sizes.asm \ sha1_mb/sha1_ref.c \ - include/memcpy_inline.h \ include/memcpy.asm \ - include/intrinreg.h + include/internal/memcpy_inline.h \ + include/internal/intrinreg.h check_tests += sha1_mb/sha1_mb_test \ sha1_mb/sha1_mb_rand_test \ diff --git a/sha256_mb/Makefile.am b/sha256_mb/Makefile.am index 8dae5cff..67fb8870 100644 --- a/sha256_mb/Makefile.am +++ b/sha256_mb/Makefile.am @@ -87,8 +87,8 @@ lsrc_base_aliases += sha256_mb/sha256_ctx_base_aliases.c \ src_include += -I $(srcdir)/sha256_mb -extern_hdrs += include/sha256_mb.h \ - include/multi_buffer.h +extern_hdrs += include/isa-l_crypto/sha256_mb.h \ + include/isa-l_crypto/multi_buffer.h other_src += include/datastruct.asm \ include/multibinary.asm \ @@ -96,9 +96,9 @@ other_src += include/datastruct.asm \ sha256_mb/sha256_mb_mgr_datastruct.asm \ include/reg_sizes.asm \ sha256_mb/sha256_ref.c \ - include/memcpy_inline.h \ include/memcpy.asm \ - include/intrinreg.h + include/internal/memcpy_inline.h \ + include/internal/intrinreg.h check_tests += sha256_mb/sha256_mb_test \ sha256_mb/sha256_mb_rand_test \ diff --git a/sha512_mb/Makefile.am b/sha512_mb/Makefile.am index dbf403b2..f26ddcb3 100644 --- a/sha512_mb/Makefile.am +++ b/sha512_mb/Makefile.am @@ -78,17 +78,17 @@ lsrc_base_aliases += sha512_mb/sha512_ctx_base.c \ src_include += -I $(srcdir)/sha512_mb -extern_hdrs += include/sha512_mb.h \ - include/multi_buffer.h +extern_hdrs += include/isa-l_crypto/sha512_mb.h \ + include/isa-l_crypto/multi_buffer.h other_src += include/datastruct.asm \ sha512_mb/sha512_job.asm \ sha512_mb/sha512_mb_mgr_datastruct.asm \ include/reg_sizes.asm \ sha512_mb/sha512_ref.c \ - include/memcpy_inline.h \ include/memcpy.asm \ - include/intrinreg.h + include/internal/memcpy_inline.h \ + include/internal/intrinreg.h check_tests += sha512_mb/sha512_mb_test \ sha512_mb/sha512_mb_rand_test \ diff --git a/sm3_mb/Makefile.am b/sm3_mb/Makefile.am index 54792c21..ad7c7d20 100644 --- a/sm3_mb/Makefile.am +++ b/sm3_mb/Makefile.am @@ -59,8 +59,8 @@ lsrc_riscv64 += sm3_mb/sm3_ctx_base.c \ src_include += -I $(srcdir)/sm3_mb -extern_hdrs += include/sm3_mb.h \ - include/multi_buffer.h +extern_hdrs += include/isa-l_crypto/sm3_mb.h \ + include/isa-l_crypto/multi_buffer.h lsrc_x86_64 += sm3_mb/sm3_ctx_avx512.c \ sm3_mb/sm3_mb_mgr_submit_avx512.asm \ @@ -80,12 +80,12 @@ lsrc_x86_64 += sm3_mb/sm3_ctx_avx2_ni.c \ other_src += include/datastruct.asm \ include/multibinary.asm \ include/reg_sizes.asm \ - include/memcpy_inline.h \ include/memcpy.asm \ - include/intrinreg.h \ sm3_mb/sm3_job.asm \ sm3_mb/sm3_mb_mgr_datastruct.asm \ - sm3_mb/sm3_test_helper.c + sm3_mb/sm3_test_helper.c \ + include/internal/memcpy_inline.h \ + include/internal/intrinreg.h check_tests += sm3_mb/sm3_ref_test \ sm3_mb/sm3_mb_param_test diff --git a/tests/extended/Makefile b/tests/extended/Makefile index 386e3840..b3c940db 100644 --- a/tests/extended/Makefile +++ b/tests/extended/Makefile @@ -1,4 +1,4 @@ -CFLAGS += -I ../../include -DNO_COMPAT_ISAL_CRYPTO_API_2_24 +CFLAGS += -I ../../include -I ../../include/isa-l_crypto -I ../../include/internal -DNO_COMPAT_ISAL_CRYPTO_API_2_24 libs += ../../bin/isa-l_crypto.a tests = $(patsubst %test.c, %test, $(wildcard *_test.c)) diff --git a/tests/extended/Makefile.nmake b/tests/extended/Makefile.nmake index 27de8913..a6fb452f 100644 --- a/tests/extended/Makefile.nmake +++ b/tests/extended/Makefile.nmake @@ -30,7 +30,7 @@ tests = md5_mb_over_4GB_test.exe sha1_mb_over_4GB_test.exe \ sha256_mb_over_4GB_test.exe sha512_mb_over_4GB_test.exe -INCLUDES = -I../../include +INCLUDES = -I../../include -I../../include/isa-l_crypto -I../../include/internal LINKFLAGS = /nologo INCLUDES = $(INCLUDES) -Ic:\OpenSSL-Win64\include CFLAGS = -O2 -D NDEBUG /nologo -D_USE_MATH_DEFINES -Qstd=c99 $(INCLUDES) /c -DNO_COMPAT_ISAL_CRYPTO_API_2_24