1 include_directories(. .. ../../include) 2 3 if (${ARCH} STREQUAL "x86_64") 4 set( 5 MODES_ARCH_SOURCES 6 7 aesni-gcm-x86_64.${ASM_EXT} 8 ghash-x86_64.${ASM_EXT} 9 ) 10 endif() 11 12 if (${ARCH} STREQUAL "x86") 13 set( 14 MODES_ARCH_SOURCES 15 16 ghash-x86.${ASM_EXT} 17 ) 18 endif() 19 20 if (${ARCH} STREQUAL "arm") 21 set( 22 MODES_ARCH_SOURCES 23 24 ghash-armv4.${ASM_EXT} 25 ) 26 endif() 27 28 add_library( 29 modes 30 31 OBJECT 32 33 cbc.c 34 ctr.c 35 ofb.c 36 cfb.c 37 gcm.c 38 39 ${MODES_ARCH_SOURCES} 40 ) 41 42 perlasm(aesni-gcm-x86_64.${ASM_EXT} asm/aesni-gcm-x86_64.pl) 43 perlasm(ghash-x86_64.${ASM_EXT} asm/ghash-x86_64.pl) 44 perlasm(ghash-x86.${ASM_EXT} asm/ghash-x86.pl) 45 perlasm(ghash-armv4.${ASM_EXT} asm/ghash-armv4.pl) 46 47 add_executable( 48 gcm_test 49 50 gcm_test.c 51 ) 52 53 target_link_libraries(gcm_test crypto) 54