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 if (${ARCH} STREQUAL "ppc64le") 43 set( 44 AES_ARCH_SOURCES 45 46 aesp8-ppc.${ASM_EXT} 47 ) 48 endif() 49 50 add_library( 51 aes 52 53 OBJECT 54 55 aes.c 56 key_wrap.c 57 mode_wrappers.c 58 59 ${AES_ARCH_SOURCES} 60 ) 61 62 perlasm(aes-x86_64.${ASM_EXT} asm/aes-x86_64.pl) 63 perlasm(aesni-x86_64.${ASM_EXT} asm/aesni-x86_64.pl) 64 perlasm(bsaes-x86_64.${ASM_EXT} asm/bsaes-x86_64.pl) 65 perlasm(vpaes-x86_64.${ASM_EXT} asm/vpaes-x86_64.pl) 66 perlasm(aes-586.${ASM_EXT} asm/aes-586.pl) 67 perlasm(vpaes-x86.${ASM_EXT} asm/vpaes-x86.pl) 68 perlasm(aesni-x86.${ASM_EXT} asm/aesni-x86.pl) 69 perlasm(aes-armv4.${ASM_EXT} asm/aes-armv4.pl) 70 perlasm(bsaes-armv7.${ASM_EXT} asm/bsaes-armv7.pl) 71 perlasm(aesv8-armx.${ASM_EXT} asm/aesv8-armx.pl) 72 perlasm(aesp8-ppc.${ASM_EXT} asm/aesp8-ppc.pl) 73 74 add_executable( 75 aes_test 76 77 aes_test.cc 78 $<TARGET_OBJECTS:test_support> 79 ) 80 81 target_link_libraries(aes_test crypto) 82 add_dependencies(all_tests aes_test) 83