2014-06-20 20:00:00 +01:00
|
|
|
include_directories(. .. ../../include)
|
|
|
|
|
|
|
|
if (${ARCH} STREQUAL "x86_64")
|
|
|
|
set(
|
|
|
|
MODES_ARCH_SOURCES
|
|
|
|
|
|
|
|
aesni-gcm-x86_64.${ASM_EXT}
|
|
|
|
ghash-x86_64.${ASM_EXT}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (${ARCH} STREQUAL "x86")
|
|
|
|
set(
|
|
|
|
MODES_ARCH_SOURCES
|
|
|
|
|
|
|
|
ghash-x86.${ASM_EXT}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (${ARCH} STREQUAL "arm")
|
|
|
|
set(
|
|
|
|
MODES_ARCH_SOURCES
|
|
|
|
|
|
|
|
ghash-armv4.${ASM_EXT}
|
2015-01-09 23:44:37 +00:00
|
|
|
ghashv8-armx.${ASM_EXT}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (${ARCH} STREQUAL "aarch64")
|
|
|
|
set(
|
|
|
|
MODES_ARCH_SOURCES
|
|
|
|
|
|
|
|
ghashv8-armx.${ASM_EXT}
|
2014-06-20 20:00:00 +01:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_library(
|
|
|
|
modes
|
|
|
|
|
|
|
|
OBJECT
|
|
|
|
|
|
|
|
cbc.c
|
|
|
|
ctr.c
|
|
|
|
ofb.c
|
|
|
|
cfb.c
|
|
|
|
gcm.c
|
|
|
|
|
|
|
|
${MODES_ARCH_SOURCES}
|
|
|
|
)
|
|
|
|
|
|
|
|
perlasm(aesni-gcm-x86_64.${ASM_EXT} asm/aesni-gcm-x86_64.pl)
|
|
|
|
perlasm(ghash-x86_64.${ASM_EXT} asm/ghash-x86_64.pl)
|
|
|
|
perlasm(ghash-x86.${ASM_EXT} asm/ghash-x86.pl)
|
|
|
|
perlasm(ghash-armv4.${ASM_EXT} asm/ghash-armv4.pl)
|
2015-01-09 23:44:37 +00:00
|
|
|
perlasm(ghashv8-armx.${ASM_EXT} asm/ghashv8-armx.pl)
|
2014-06-20 20:00:00 +01:00
|
|
|
|
|
|
|
add_executable(
|
|
|
|
gcm_test
|
|
|
|
|
|
|
|
gcm_test.c
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(gcm_test crypto)
|