• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1include_directories(../../include)
2
3if (${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  )
10endif()
11
12if (${ARCH} STREQUAL "x86")
13  set(
14    MODES_ARCH_SOURCES
15
16    ghash-x86.${ASM_EXT}
17  )
18endif()
19
20if (${ARCH} STREQUAL "arm")
21  set(
22    MODES_ARCH_SOURCES
23
24    ghash-armv4.${ASM_EXT}
25    ghashv8-armx.${ASM_EXT}
26  )
27endif()
28
29if (${ARCH} STREQUAL "aarch64")
30  set(
31    MODES_ARCH_SOURCES
32
33    ghashv8-armx.${ASM_EXT}
34  )
35endif()
36
37add_library(
38  modes
39
40  OBJECT
41
42  cbc.c
43  ctr.c
44  ofb.c
45  cfb.c
46  gcm.c
47
48  ${MODES_ARCH_SOURCES}
49)
50
51perlasm(aesni-gcm-x86_64.${ASM_EXT} asm/aesni-gcm-x86_64.pl)
52perlasm(ghash-x86_64.${ASM_EXT} asm/ghash-x86_64.pl)
53perlasm(ghash-x86.${ASM_EXT} asm/ghash-x86.pl)
54perlasm(ghash-armv4.${ASM_EXT} asm/ghash-armv4.pl)
55perlasm(ghashv8-armx.${ASM_EXT} asm/ghashv8-armx.pl)
56
57add_executable(
58  gcm_test
59
60  gcm_test.c
61
62  $<TARGET_OBJECTS:test_support>
63)
64
65target_link_libraries(gcm_test crypto)
66add_dependencies(all_tests gcm_test)
67