1 include_directories(../../include) 2 3 if (${ARCH} STREQUAL "x86_64") 4 set( 5 AES_ARCH_SOURCES 6 7 aes-x86_64.${ASM_EXT} 8 aesni-x86_64.${ASM_EXT} 9 bsaes-x86_64.${ASM_EXT} 10 vpaes-x86_64.${ASM_EXT} 11 ) 12 endif() 13 14 if (${ARCH} STREQUAL "x86") 15 set( 16 AES_ARCH_SOURCES 17 18 aes-586.${ASM_EXT} 19 vpaes-x86.${ASM_EXT} 20 aesni-x86.${ASM_EXT} 21 ) 22 endif() 23 24 if (${ARCH} STREQUAL "arm") 25 set( 26 AES_ARCH_SOURCES 27 28 aes-armv4.${ASM_EXT} 29 bsaes-armv7.${ASM_EXT} 30 aesv8-armx.${ASM_EXT} 31 ) 32 endif() 33 34 if (${ARCH} STREQUAL "aarch64") 35 set( 36 AES_ARCH_SOURCES 37 38 aesv8-armx.${ASM_EXT} 39 ) 40 endif() 41 42 add_library( 43 aes 44 45 OBJECT 46 47 aes.c 48 mode_wrappers.c 49 50 ${AES_ARCH_SOURCES} 51 ) 52 53 perlasm(aes-x86_64.${ASM_EXT} asm/aes-x86_64.pl) 54 perlasm(aesni-x86_64.${ASM_EXT} asm/aesni-x86_64.pl) 55 perlasm(bsaes-x86_64.${ASM_EXT} asm/bsaes-x86_64.pl) 56 perlasm(vpaes-x86_64.${ASM_EXT} asm/vpaes-x86_64.pl) 57 perlasm(aes-586.${ASM_EXT} asm/aes-586.pl) 58 perlasm(vpaes-x86.${ASM_EXT} asm/vpaes-x86.pl) 59 perlasm(aesni-x86.${ASM_EXT} asm/aesni-x86.pl) 60 perlasm(aes-armv4.${ASM_EXT} asm/aes-armv4.pl) 61 perlasm(bsaes-armv7.${ASM_EXT} asm/bsaes-armv7.pl) 62 perlasm(aesv8-armx.${ASM_EXT} asm/aesv8-armx.pl) 63 64 add_executable( 65 aes_test 66 67 aes_test.cc 68 $<TARGET_OBJECTS:test_support> 69 ) 70 71 target_link_libraries(aes_test crypto) 72 add_dependencies(all_tests aes_test) 73