From 4496be6e29732189769b78f63e491dacb23c961b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 2 Nov 2013 16:01:16 +0100 Subject: Convert ghash to the new crypto algorithm scheme --- src/crypto/mac/CMakeLists.txt | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/crypto/mac/CMakeLists.txt (limited to 'src/crypto/mac/CMakeLists.txt') diff --git a/src/crypto/mac/CMakeLists.txt b/src/crypto/mac/CMakeLists.txt new file mode 100644 index 0000000..7f8664c --- /dev/null +++ b/src/crypto/mac/CMakeLists.txt @@ -0,0 +1,34 @@ +set(MACS "") + +if(WITH_MAC_GHASH) + list(APPEND MACS ghash) +endif(WITH_MAC_GHASH) + +set(MAC_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/macs.c") + +set(MAC_DEFINITIONS "") +set(MAC_IMPLS "") +set(MAC_LIST "") + +foreach(mac ${MACS}) + add_subdirectory(${mac}) + + list(APPEND MAC_SOURCES ${IMPL_SOURCES}) + + set(MAC_LIST "${MAC_LIST}\n{\"${MAC_NAME}\", mac_${mac}_impls},") + set(MAC_IMPLS "${MAC_IMPLS}\nstatic const fastd_mac_t *const mac_${mac}_impls[] = {") + + foreach(impl ${IMPLS}) + set(MAC_DEFINITIONS "${MAC_DEFINITIONS}\nextern const fastd_mac_t fastd_mac_${mac}_${impl};") + set(MAC_IMPLS "${MAC_IMPLS}&fastd_mac_${mac}_${impl}, ") + endforeach(impl) + + set(MAC_IMPLS "${MAC_IMPLS}NULL};") + +endforeach(mac) + + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/macs.c.in ${CMAKE_CURRENT_BINARY_DIR}/macs.c) + + +set(MAC_SOURCES "${MAC_SOURCES}" PARENT_SCOPE) -- cgit v1.2.3