1# We make separate GOAL variables for each algorithm, to make it easy to
2# switch each to the Legacy provider when needed.
3#
4# $TDES_1_GOAL and $TDES_2_GOAL separate FIPSable and non-FIPSable TDES.
5# The latter may become legacy sooner, so it's comfortable to have two
6# variables already now, to switch the non-FIPSable TDES to legacy if needed.
7
8$COMMON_GOAL=../../libcommon.a
9
10$NULL_GOAL=../../libdefault.a
11$AES_GOAL=../../libdefault.a ../../libfips.a
12$TDES_1_GOAL=../../libdefault.a ../../libfips.a
13$TDES_2_GOAL=../../libdefault.a
14$ARIA_GOAL=../../libdefault.a
15$CAMELLIA_GOAL=../../libdefault.a
16$DES_GOAL=../../liblegacy.a
17$BLOWFISH_GOAL=../../liblegacy.a
18$IDEA_GOAL=../../liblegacy.a
19$CAST5_GOAL=../../liblegacy.a
20$RC2_GOAL=../../liblegacy.a
21$RC4_GOAL=../../liblegacy.a
22$RC5_GOAL=../../liblegacy.a
23$SEED_GOAL=../../liblegacy.a
24$SM4_GOAL=../../libdefault.a
25$CHACHA_GOAL=../../libdefault.a
26$CHACHAPOLY_GOAL=../../libdefault.a
27$SIV_GOAL=../../libdefault.a
28$SIV_GCM_GOAL=../../libdefault.a
29
30IF[{- !$disabled{asm} -}]
31  $GHASHDEF_x86=GHASH_ASM
32  $GHASHDEF_x86_sse2=OPENSSL_IA32_SSE2
33
34  $GHASHDEF_x86_64=GHASH_ASM
35  $GHASHDEF_x86_64_sse2=OPENSSL_IA32_SSE2
36
37  # ghash-ia64.s doesn't work on VMS
38  IF[{- $config{target} !~ /^vms-/ -}]
39    $GHASHDEF_ia64=GHASH_ASM
40  ENDIF
41
42  $GHASHDEF_sparcv9=GHASH_ASM
43
44  $GHASHDEF_alpha=GHASH_ASM
45
46  $GHASHDEF_s390x=GHASH_ASM
47
48  $GHASHDEF_armv4=GHASH_ASM
49  $GHASHDEF_aarch64=
50
51  $GHASHDEF_parisc11=GHASH_ASM
52  $GHASHDEF_parisc20_64=$GHASHDEF_parisc11
53
54  $GHASHDEF_ppc32=
55  $GHASHDEF_ppc64=$GHASHDEF_ppc32
56
57  $GHASHDEF_c64xplus=GHASH_ASM
58
59  $GHASHDEF_riscv64=GHASH_ASM
60
61  # Now that we have defined all the arch specific variables, use the
62  # appropriate one, and define the appropriate macros
63
64  IF[$GHASHDEF_{- $target{asm_arch} -}]
65    $GHASHDEF=$GHASHDEF_{- $target{asm_arch} -}
66    IF[{- !$disabled{sse2} -}]
67      IF[$GHASHDEF_{- $target{asm_arch} -}_sse2]
68        $GHASHDEF=$GHASHDEF_{- $target{asm_arch} -}_sse2
69      ENDIF
70    ENDIF
71  ENDIF
72ENDIF
73
74IF[{- !$disabled{asm} -}]
75  IF[{- ($target{perlasm_scheme} // '') ne '31' -}]
76    $AESXTSDEF_s390x=AES_XTS_S390X
77  ENDIF
78
79  # Now that we have defined all the arch specific variables, use the
80  # appropriate one, and define the appropriate macros
81
82  IF[$AESXTSDEF_{- $target{asm_arch} -}]
83    $AESXTSDEF=$AESXTSDEF_{- $target{asm_arch} -}
84  ENDIF
85ENDIF
86
87# This source is common building blocks for all ciphers in all our providers.
88SOURCE[$COMMON_GOAL]=\
89        ciphercommon.c ciphercommon_hw.c ciphercommon_block.c \
90        ciphercommon_gcm.c ciphercommon_gcm_hw.c \
91        ciphercommon_ccm.c ciphercommon_ccm_hw.c
92
93IF[{- !$disabled{des} -}]
94  SOURCE[$TDES_1_GOAL]=cipher_tdes.c cipher_tdes_common.c cipher_tdes_hw.c
95ENDIF
96
97SOURCE[$NULL_GOAL]=\
98        cipher_null.c
99
100SOURCE[$AES_GOAL]=\
101        cipher_aes.c cipher_aes_hw.c \
102        cipher_aes_xts.c cipher_aes_xts_hw.c \
103        cipher_aes_gcm.c cipher_aes_gcm_hw.c \
104        cipher_aes_ccm.c cipher_aes_ccm_hw.c \
105        cipher_aes_wrp.c \
106        cipher_aes_cbc_hmac_sha.c \
107        cipher_aes_cbc_hmac_sha256_hw.c cipher_aes_cbc_hmac_sha1_hw.c \
108        cipher_cts.c
109DEFINE[$AES_GOAL]=$AESXTSDEF
110
111# Extra code to satisfy the FIPS and non-FIPS separation.
112# When the AES-xxx-XTS moves to legacy, cipher_aes_xts_fips.c can be removed.
113SOURCE[$AES_GOAL]=cipher_aes_xts_fips.c
114
115IF[{- !$disabled{siv} -}]
116  DEFINE[$SIV_GCM_GOAL]=$GHASHDEF
117  SOURCE[$SIV_GCM_GOAL]=\
118        cipher_aes_gcm_siv.c cipher_aes_gcm_siv_hw.c \
119        cipher_aes_gcm_siv_polyval.c
120  SOURCE[$SIV_GOAL]=cipher_aes_siv.c cipher_aes_siv_hw.c
121ENDIF
122
123IF[{- !$disabled{des} -}]
124  SOURCE[$TDES_2_GOAL]=\
125      cipher_tdes_default.c cipher_tdes_default_hw.c \
126      cipher_tdes_wrap.c cipher_tdes_wrap_hw.c
127  SOURCE[$DES_GOAL]=\
128      cipher_desx.c cipher_desx_hw.c \
129      cipher_des.c cipher_des_hw.c
130 IF[{- !$disabled{module} -}]
131   SOURCE[$DES_GOAL]=\
132       cipher_tdes_common.c
133 ENDIF
134ENDIF
135
136IF[{- !$disabled{aria} -}]
137  SOURCE[$ARIA_GOAL]=\
138      cipher_aria.c cipher_aria_hw.c \
139      cipher_aria_gcm.c cipher_aria_gcm_hw.c \
140      cipher_aria_ccm.c cipher_aria_ccm_hw.c
141ENDIF
142
143IF[{- !$disabled{camellia} -}]
144  SOURCE[$CAMELLIA_GOAL]=\
145      cipher_camellia.c cipher_camellia_hw.c
146ENDIF
147
148IF[{- !$disabled{bf} -}]
149  SOURCE[$BLOWFISH_GOAL]=\
150      cipher_blowfish.c cipher_blowfish_hw.c
151ENDIF
152
153IF[{- !$disabled{idea} -}]
154  SOURCE[$IDEA_GOAL]=\
155      cipher_idea.c cipher_idea_hw.c
156ENDIF
157
158IF[{- !$disabled{cast} -}]
159  SOURCE[$CAST5_GOAL]=\
160      cipher_cast5.c cipher_cast5_hw.c
161ENDIF
162
163IF[{- !$disabled{seed} -}]
164  SOURCE[$SEED_GOAL]=\
165      cipher_seed.c cipher_seed_hw.c
166ENDIF
167
168IF[{- !$disabled{sm4} -}]
169  SOURCE[$SM4_GOAL]=\
170      cipher_sm4.c cipher_sm4_hw.c \
171      cipher_sm4_gcm.c cipher_sm4_gcm_hw.c \
172      cipher_sm4_ccm.c cipher_sm4_ccm_hw.c \
173      cipher_sm4_xts.c cipher_sm4_xts_hw.c
174
175ENDIF
176
177IF[{- !$disabled{ocb} -}]
178  SOURCE[$AES_GOAL]=\
179       cipher_aes_ocb.c cipher_aes_ocb_hw.c
180ENDIF
181
182IF[{- !$disabled{rc4} -}]
183  SOURCE[$RC4_GOAL]=\
184      cipher_rc4.c cipher_rc4_hw.c
185 IF[{- !$disabled{md5} -}]
186   SOURCE[$RC4_GOAL]=\
187       cipher_rc4_hmac_md5.c cipher_rc4_hmac_md5_hw.c
188 ENDIF
189ENDIF
190
191IF[{- !$disabled{rc5} -}]
192  SOURCE[$RC5_GOAL]=\
193      cipher_rc5.c cipher_rc5_hw.c
194ENDIF
195
196IF[{- !$disabled{rc2} -}]
197  SOURCE[$RC2_GOAL]=\
198      cipher_rc2.c cipher_rc2_hw.c
199ENDIF
200
201IF[{- !$disabled{chacha} -}]
202  SOURCE[$CHACHA_GOAL]=\
203      cipher_chacha20.c cipher_chacha20_hw.c
204 IF[{- !$disabled{poly1305} -}]
205  SOURCE[$CHACHAPOLY_GOAL]=\
206      cipher_chacha20_poly1305.c cipher_chacha20_poly1305_hw.c
207 ENDIF
208ENDIF
209