2018-01-14 17:17:34 +11:00
|
|
|
###############################################################################
|
|
|
|
cmake_minimum_required(VERSION 3.7.0)
|
|
|
|
project(cruft-crypto CXX)
|
|
|
|
|
|
|
|
|
2018-12-02 18:33:14 +11:00
|
|
|
list (APPEND components
|
|
|
|
hash/blake
|
|
|
|
hash/blake2
|
|
|
|
hash/md2
|
|
|
|
hash/md4
|
|
|
|
hash/md5
|
|
|
|
hash/md6
|
|
|
|
hash/ripemd
|
|
|
|
hash/sha1
|
|
|
|
hash/sha2
|
2019-02-09 14:54:50 +11:00
|
|
|
hash/tiger
|
2018-12-02 18:33:14 +11:00
|
|
|
hash/pbkdf2
|
|
|
|
hash/hmac
|
|
|
|
hash/hotp
|
|
|
|
stream/chacha
|
|
|
|
stream/rabbit
|
|
|
|
stream/rc4
|
|
|
|
stream/salsa
|
|
|
|
block/rc2
|
|
|
|
block/rc5
|
|
|
|
block/rc6
|
|
|
|
block/speck
|
|
|
|
block/tea
|
|
|
|
block/xtea
|
|
|
|
block/xxtea
|
|
|
|
)
|
2018-01-14 17:17:34 +11:00
|
|
|
|
|
|
|
|
2018-12-02 18:33:14 +11:00
|
|
|
###############################################################################
|
|
|
|
list (APPEND sources fwd.hpp)
|
|
|
|
foreach (c ${components})
|
|
|
|
list (APPEND sources "${c}.cpp" "${c}.hpp")
|
|
|
|
endforeach()
|
2018-01-14 17:17:34 +11:00
|
|
|
|
|
|
|
|
|
|
|
option (TESTS "enable unit testing" ON)
|
|
|
|
|
|
|
|
if (TESTS)
|
|
|
|
include (CTest)
|
|
|
|
enable_testing ()
|
|
|
|
|
2018-12-02 18:33:14 +11:00
|
|
|
foreach (t ${components})
|
2018-01-14 17:17:34 +11:00
|
|
|
string(REPLACE "/" "_" name "test/${t}")
|
2018-01-22 19:51:16 +11:00
|
|
|
add_executable(crypto_${name} test/${t}.cpp)
|
|
|
|
target_link_libraries(crypto_${name} PRIVATE cruft-crypto)
|
|
|
|
target_include_directories(crypto_${name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
add_test(NAME crypto_${name} COMMAND crypto_${name})
|
2018-01-14 17:17:34 +11:00
|
|
|
endforeach()
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
add_library (cruft-crypto STATIC ${sources})
|
2018-08-05 14:51:17 +10:00
|
|
|
target_link_libraries (cruft-crypto INTERFACE cruft)
|
2018-01-14 17:17:34 +11:00
|
|
|
|
|
|
|
|
2019-02-04 20:12:08 +11:00
|
|
|
##-----------------------------------------------------------------------------
|
|
|
|
add_executable (crypto_bench tools/bench.cpp)
|
|
|
|
target_link_libraries (crypto_bench cruft-crypto)
|
|
|
|
|
|
|
|
|
2018-01-14 17:17:34 +11:00
|
|
|
##-----------------------------------------------------------------------------
|
|
|
|
add_executable (crypto_hash tools/hash.cpp)
|
|
|
|
target_link_libraries (crypto_hash cruft-crypto)
|
|
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
configure_file(libcruft-crypto.pc.in libcruft-crypto.pc)
|
|
|
|
configure_file(Doxyfile.in Doxyfile)
|