aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorBrent Cook <bcook@openbsd.org>2016-04-09 12:08:26 -0500
committerBrent Cook <bcook@openbsd.org>2016-04-09 12:08:26 -0500
commit752ad82d33bef07591ae323e17de2cb8f0e50e20 (patch)
treedfbea04269c52cc6f31c6731edcc192d5da07616 /crypto
parent2510a5e6f98360bb7cd4a52ecf2274656fe75dcc (diff)
parente1f8a1e160be5cda14986e75a00b7d5f5ca87225 (diff)
downloadportable-752ad82d33bef07591ae323e17de2cb8f0e50e20.tar.gz
portable-752ad82d33bef07591ae323e17de2cb8f0e50e20.tar.bz2
portable-752ad82d33bef07591ae323e17de2cb8f0e50e20.zip
Land #188, add ASM support for cmake builds
Diffstat (limited to 'crypto')
-rw-r--r--crypto/CMakeLists.txt115
1 files changed, 107 insertions, 8 deletions
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt
index 24c6821..4086168 100644
--- a/crypto/CMakeLists.txt
+++ b/crypto/CMakeLists.txt
@@ -8,16 +8,107 @@ include_directories(
8 modes 8 modes
9) 9)
10 10
11if(HOST_ASM_ELF_X86_64)
12 set(
13 ASM_X86_64_ELF_SRC
14 aes/aes-elf-x86_64.s
15 aes/bsaes-elf-x86_64.s
16 aes/vpaes-elf-x86_64.s
17 aes/aesni-elf-x86_64.s
18 aes/aesni-sha1-elf-x86_64.s
19 bn/modexp512-elf-x86_64.s
20 bn/mont-elf-x86_64.s
21 bn/mont5-elf-x86_64.s
22 bn/gf2m-elf-x86_64.s
23 camellia/cmll-elf-x86_64.s
24 md5/md5-elf-x86_64.s
25 modes/ghash-elf-x86_64.s
26 rc4/rc4-elf-x86_64.s
27 rc4/rc4-md5-elf-x86_64.s
28 sha/sha1-elf-x86_64.s
29 sha/sha256-elf-x86_64.S
30 sha/sha512-elf-x86_64.S
31 whrlpool/wp-elf-x86_64.s
32 cpuid-elf-x86_64.S
33 )
34 add_definitions(-DAES_ASM)
35 add_definitions(-DBSAES_ASM)
36 add_definitions(-DVPAES_ASM)
37 add_definitions(-DOPENSSL_IA32_SSE2)
38 add_definitions(-DOPENSSL_BN_ASM_MONT)
39 add_definitions(-DOPENSSL_BN_ASM_MONT5)
40 add_definitions(-DOPENSSL_BN_ASM_GF2m)
41 add_definitions(-DMD5_ASM)
42 add_definitions(-DGHASH_ASM)
43 add_definitions(-DRSA_ASM)
44 add_definitions(-DSHA1_ASM)
45 add_definitions(-DSHA256_ASM)
46 add_definitions(-DSHA512_ASM)
47 add_definitions(-DWHIRLPOOL_ASM)
48 add_definitions(-DOPENSSL_CPUID_OBJ)
49 set(CRYPTO_SRC ${CRYPTO_SRC} ${ASM_X86_64_ELF_SRC})
50 set_property(SOURCE ${ASM_X86_64_ELF_SRC} PROPERTY LANGUAGE C)
51endif()
52
53if(HOST_ASM_MACOSX_X86_64)
54 set(
55 ASM_X86_64_MACOSX_SRC
56 aes/aes-macosx-x86_64.s
57 aes/bsaes-macosx-x86_64.s
58 aes/vpaes-macosx-x86_64.s
59 aes/aesni-macosx-x86_64.s
60 aes/aesni-sha1-macosx-x86_64.s
61 bn/modexp512-macosx-x86_64.s
62 bn/mont-macosx-x86_64.s
63 bn/mont5-macosx-x86_64.s
64 bn/gf2m-macosx-x86_64.s
65 camellia/cmll-macosx-x86_64.s
66 md5/md5-macosx-x86_64.s
67 modes/ghash-macosx-x86_64.s
68 rc4/rc4-macosx-x86_64.s
69 rc4/rc4-md5-macosx-x86_64.s
70 sha/sha1-macosx-x86_64.s
71 sha/sha256-macosx-x86_64.S
72 sha/sha512-macosx-x86_64.S
73 whrlpool/wp-macosx-x86_64.s
74 cpuid-macosx-x86_64.S
75 )
76 add_definitions(-DAES_ASM)
77 add_definitions(-DBSAES_ASM)
78 add_definitions(-DVPAES_ASM)
79 add_definitions(-DOPENSSL_IA32_SSE2)
80 add_definitions(-DOPENSSL_BN_ASM_MONT)
81 add_definitions(-DOPENSSL_BN_ASM_MONT5)
82 add_definitions(-DOPENSSL_BN_ASM_GF2m)
83 add_definitions(-DMD5_ASM)
84 add_definitions(-DGHASH_ASM)
85 add_definitions(-DRSA_ASM)
86 add_definitions(-DSHA1_ASM)
87 add_definitions(-DSHA256_ASM)
88 add_definitions(-DSHA512_ASM)
89 add_definitions(-DWHIRLPOOL_ASM)
90 add_definitions(-DOPENSSL_CPUID_OBJ)
91 set(CRYPTO_SRC ${CRYPTO_SRC} ${ASM_X86_64_MACOSX_SRC})
92 set_property(SOURCE ${ASM_X86_64_MACOSX_SRC} PROPERTY LANGUAGE C)
93endif()
94
95if((NOT HOST_ASM_ELF_X86_64) AND (NOT HOST_ASM_MACOSX_X86_64))
96 set(
97 CRYPTO_SRC
98 ${CRYPTO_SRC}
99 aes/aes_cbc.c
100 aes/aes_core.c
101 camellia/camellia.c
102 camellia/cmll_cbc.c
103 rc4/rc4_enc.c
104 rc4/rc4_skey.c
105 whrlpool/wp_block.c
106 )
107endif()
108
11set( 109set(
12 CRYPTO_SRC 110 CRYPTO_SRC
13 111 ${CRYPTO_SRC}
14 aes/aes_cbc.c
15 aes/aes_core.c
16 camellia/camellia.c
17 camellia/cmll_cbc.c
18 rc4/rc4_enc.c
19 rc4/rc4_skey.c
20 whrlpool/wp_block.c
21 cpt_err.c 112 cpt_err.c
22 cryptlib.c 113 cryptlib.c
23 cversion.c 114 cversion.c
@@ -643,6 +734,14 @@ if(NOT HAVE_TIMINGSAFE_MEMCMP)
643 set(CRYPTO_SRC ${CRYPTO_SRC} compat/timingsafe_memcmp.c) 734 set(CRYPTO_SRC ${CRYPTO_SRC} compat/timingsafe_memcmp.c)
644endif() 735endif()
645 736
737if(NOT ENABLE_ASM)
738 add_definitions(-DOPENSSL_NO_ASM)
739else()
740 if(CMAKE_HOST_WIN32)
741 add_definitions(-DOPENSSL_NO_ASM)
742 endif()
743endif()
744
646if (BUILD_SHARED) 745if (BUILD_SHARED)
647 add_library(crypto-objects OBJECT ${CRYPTO_SRC}) 746 add_library(crypto-objects OBJECT ${CRYPTO_SRC})
648 add_library(crypto STATIC $<TARGET_OBJECTS:crypto-objects>) 747 add_library(crypto STATIC $<TARGET_OBJECTS:crypto-objects>)