mirror of
https://github.com/henrydcase/pqc.git
synced 2024-11-22 15:39:07 +00:00
Defines structure of the CMake
This commit is contained in:
parent
0450bc3215
commit
67f275c898
111
CMakeLists.txt
111
CMakeLists.txt
@ -83,44 +83,97 @@ set(CMAKE_C_FLAGS "${C_CXX_FLAGS} -D${ARCH}")
|
|||||||
set(CMAKE_CXX_FLAGS "${C_CXX_FLAGS} -D${ARCH}")
|
set(CMAKE_CXX_FLAGS "${C_CXX_FLAGS} -D${ARCH}")
|
||||||
|
|
||||||
add_library(
|
add_library(
|
||||||
pqclean
|
common
|
||||||
|
OBJECT
|
||||||
|
|
||||||
SHARED
|
common/fips202.c
|
||||||
|
common/sp800-185.c
|
||||||
common/fips202.c
|
common/randombytes.c
|
||||||
common/sp800-185.c
|
|
||||||
common/randombytes.c
|
|
||||||
|
|
||||||
crypto_sign/dilithium2/clean/ntt.c
|
|
||||||
crypto_sign/dilithium2/clean/packing.c
|
|
||||||
crypto_sign/dilithium2/clean/poly.c
|
|
||||||
crypto_sign/dilithium2/clean/polyvec.c
|
|
||||||
crypto_sign/dilithium2/clean/reduce.c
|
|
||||||
crypto_sign/dilithium2/clean/rounding.c
|
|
||||||
crypto_sign/dilithium2/clean/sign.c
|
|
||||||
crypto_sign/dilithium2/clean/symmetric-shake.c
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(
|
function(define_crypto_alg name namespace src inc)
|
||||||
pqclean PRIVATE
|
add_library(
|
||||||
common
|
pqclean_${name}
|
||||||
|
OBJECT
|
||||||
|
${src}
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(
|
||||||
|
pqclean_${name} PRIVATE
|
||||||
|
common
|
||||||
|
)
|
||||||
|
|
||||||
|
target_compile_definitions(
|
||||||
|
pqclean_${name} PRIVATE
|
||||||
|
-DPQCLEAN_NAMESPACE=${namespace}
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(
|
||||||
|
pqclean_test_${name}
|
||||||
|
OBJECT
|
||||||
|
test/crypto_sign/testvectors.c
|
||||||
|
)
|
||||||
|
|
||||||
|
target_compile_definitions(
|
||||||
|
pqclean_test_${name} PRIVATE
|
||||||
|
-DPQCLEAN_NAMESPACE=${namespace}
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(
|
||||||
|
pqclean_test_${name} PRIVATE
|
||||||
|
common
|
||||||
|
${inc}
|
||||||
|
)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
set(
|
||||||
|
SRC_CLEAN_DILITHIUM2
|
||||||
|
crypto_sign/dilithium2/clean/ntt.c
|
||||||
|
crypto_sign/dilithium2/clean/packing.c
|
||||||
|
crypto_sign/dilithium2/clean/poly.c
|
||||||
|
crypto_sign/dilithium2/clean/polyvec.c
|
||||||
|
crypto_sign/dilithium2/clean/reduce.c
|
||||||
|
crypto_sign/dilithium2/clean/rounding.c
|
||||||
|
crypto_sign/dilithium2/clean/sign.c
|
||||||
|
crypto_sign/dilithium2/clean/symmetric-shake.c
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(
|
set(
|
||||||
test
|
INC_CLEAN_DILITHIUM2
|
||||||
|
crypto_sign/dilithium2/clean
|
||||||
test/crypto_sign/testvectors.c
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(
|
define_crypto_alg(dilithium2_clean
|
||||||
test PRIVATE
|
PQCLEAN_DILITHIUM2_CLEAN "${SRC_CLEAN_DILITHIUM2}" "${INC_CLEAN_DILITHIUM2}")
|
||||||
common
|
|
||||||
crypto_sign/dilithium2/clean
|
add_library(
|
||||||
|
pqclean
|
||||||
|
SHARED
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(
|
||||||
|
pqclean_s
|
||||||
|
STATIC
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
test
|
pqclean
|
||||||
pqclean
|
common
|
||||||
|
pqclean_dilithium2_clean
|
||||||
)
|
)
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPQCLEAN_NAMESPACE=PQCLEAN_DILITHIUM2_CLEAN")
|
target_link_libraries(
|
||||||
|
pqclean_s
|
||||||
|
common
|
||||||
|
pqclean_dilithium2_clean
|
||||||
|
)
|
||||||
|
|
||||||
|
add_executable(
|
||||||
|
test
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(
|
||||||
|
test
|
||||||
|
pqclean_s
|
||||||
|
pqclean_test_dilithium2_clean
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user