• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1include_directories(../../include)
2
3if (${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  )
12endif()
13
14if (${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  )
22endif()
23
24if (${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  )
32endif()
33
34if (${ARCH} STREQUAL "aarch64")
35  set(
36    AES_ARCH_SOURCES
37
38    aesv8-armx.${ASM_EXT}
39  )
40endif()
41
42add_library(
43  aes
44
45  OBJECT
46
47  aes.c
48  mode_wrappers.c
49
50  ${AES_ARCH_SOURCES}
51)
52
53perlasm(aes-x86_64.${ASM_EXT} asm/aes-x86_64.pl)
54perlasm(aesni-x86_64.${ASM_EXT} asm/aesni-x86_64.pl)
55perlasm(bsaes-x86_64.${ASM_EXT} asm/bsaes-x86_64.pl)
56perlasm(vpaes-x86_64.${ASM_EXT} asm/vpaes-x86_64.pl)
57perlasm(aes-586.${ASM_EXT} asm/aes-586.pl)
58perlasm(vpaes-x86.${ASM_EXT} asm/vpaes-x86.pl)
59perlasm(aesni-x86.${ASM_EXT} asm/aesni-x86.pl)
60perlasm(aes-armv4.${ASM_EXT} asm/aes-armv4.pl)
61perlasm(bsaes-armv7.${ASM_EXT} asm/bsaes-armv7.pl)
62perlasm(aesv8-armx.${ASM_EXT} asm/aesv8-armx.pl)
63
64add_executable(
65  aes_test
66
67  aes_test.cc
68  $<TARGET_OBJECTS:test_support>
69)
70
71target_link_libraries(aes_test crypto)
72add_dependencies(all_tests aes_test)
73