Remove /* foo.c */ comments
[openssl.git] / crypto / evp / c_allc.c
1 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
2  * All rights reserved.
3  *
4  * This package is an SSL implementation written
5  * by Eric Young (eay@cryptsoft.com).
6  * The implementation was written so as to conform with Netscapes SSL.
7  *
8  * This library is free for commercial and non-commercial use as long as
9  * the following conditions are aheared to.  The following conditions
10  * apply to all code found in this distribution, be it the RC4, RSA,
11  * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
12  * included with this distribution is covered by the same copyright terms
13  * except that the holder is Tim Hudson (tjh@cryptsoft.com).
14  *
15  * Copyright remains Eric Young's, and as such any Copyright notices in
16  * the code are not to be removed.
17  * If this package is used in a product, Eric Young should be given attribution
18  * as the author of the parts of the library used.
19  * This can be in the form of a textual message at program startup or
20  * in documentation (online or textual) provided with the package.
21  *
22  * Redistribution and use in source and binary forms, with or without
23  * modification, are permitted provided that the following conditions
24  * are met:
25  * 1. Redistributions of source code must retain the copyright
26  *    notice, this list of conditions and the following disclaimer.
27  * 2. Redistributions in binary form must reproduce the above copyright
28  *    notice, this list of conditions and the following disclaimer in the
29  *    documentation and/or other materials provided with the distribution.
30  * 3. All advertising materials mentioning features or use of this software
31  *    must display the following acknowledgement:
32  *    "This product includes cryptographic software written by
33  *     Eric Young (eay@cryptsoft.com)"
34  *    The word 'cryptographic' can be left out if the rouines from the library
35  *    being used are not cryptographic related :-).
36  * 4. If you include any Windows specific code (or a derivative thereof) from
37  *    the apps directory (application code) you must include an acknowledgement:
38  *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
39  *
40  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
41  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
43  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
44  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
45  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
46  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
48  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
49  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
50  * SUCH DAMAGE.
51  *
52  * The licence and distribution terms for any publically available version or
53  * derivative of this code cannot be changed.  i.e. this code cannot simply be
54  * copied and put under another distribution licence
55  * [including the GNU Public Licence.]
56  */
57
58 #include <stdio.h>
59 #include "internal/cryptlib.h"
60 #include <openssl/evp.h>
61 #include <openssl/pkcs12.h>
62 #include <openssl/objects.h>
63
64 void OpenSSL_add_all_ciphers(void)
65 {
66
67 #ifndef OPENSSL_NO_DES
68     EVP_add_cipher(EVP_des_cfb());
69     EVP_add_cipher(EVP_des_cfb1());
70     EVP_add_cipher(EVP_des_cfb8());
71     EVP_add_cipher(EVP_des_ede_cfb());
72     EVP_add_cipher(EVP_des_ede3_cfb());
73     EVP_add_cipher(EVP_des_ede3_cfb1());
74     EVP_add_cipher(EVP_des_ede3_cfb8());
75
76     EVP_add_cipher(EVP_des_ofb());
77     EVP_add_cipher(EVP_des_ede_ofb());
78     EVP_add_cipher(EVP_des_ede3_ofb());
79
80     EVP_add_cipher(EVP_desx_cbc());
81     EVP_add_cipher_alias(SN_desx_cbc, "DESX");
82     EVP_add_cipher_alias(SN_desx_cbc, "desx");
83
84     EVP_add_cipher(EVP_des_cbc());
85     EVP_add_cipher_alias(SN_des_cbc, "DES");
86     EVP_add_cipher_alias(SN_des_cbc, "des");
87     EVP_add_cipher(EVP_des_ede_cbc());
88     EVP_add_cipher(EVP_des_ede3_cbc());
89     EVP_add_cipher_alias(SN_des_ede3_cbc, "DES3");
90     EVP_add_cipher_alias(SN_des_ede3_cbc, "des3");
91
92     EVP_add_cipher(EVP_des_ecb());
93     EVP_add_cipher(EVP_des_ede());
94     EVP_add_cipher(EVP_des_ede3());
95     EVP_add_cipher(EVP_des_ede3_wrap());
96     EVP_add_cipher_alias(SN_id_smime_alg_CMS3DESwrap, "des3-wrap");
97 #endif
98
99 #ifndef OPENSSL_NO_RC4
100     EVP_add_cipher(EVP_rc4());
101     EVP_add_cipher(EVP_rc4_40());
102 # ifndef OPENSSL_NO_MD5
103     EVP_add_cipher(EVP_rc4_hmac_md5());
104 # endif
105 #endif
106
107 #ifndef OPENSSL_NO_IDEA
108     EVP_add_cipher(EVP_idea_ecb());
109     EVP_add_cipher(EVP_idea_cfb());
110     EVP_add_cipher(EVP_idea_ofb());
111     EVP_add_cipher(EVP_idea_cbc());
112     EVP_add_cipher_alias(SN_idea_cbc, "IDEA");
113     EVP_add_cipher_alias(SN_idea_cbc, "idea");
114 #endif
115
116 #ifndef OPENSSL_NO_SEED
117     EVP_add_cipher(EVP_seed_ecb());
118     EVP_add_cipher(EVP_seed_cfb());
119     EVP_add_cipher(EVP_seed_ofb());
120     EVP_add_cipher(EVP_seed_cbc());
121     EVP_add_cipher_alias(SN_seed_cbc, "SEED");
122     EVP_add_cipher_alias(SN_seed_cbc, "seed");
123 #endif
124
125 #ifndef OPENSSL_NO_RC2
126     EVP_add_cipher(EVP_rc2_ecb());
127     EVP_add_cipher(EVP_rc2_cfb());
128     EVP_add_cipher(EVP_rc2_ofb());
129     EVP_add_cipher(EVP_rc2_cbc());
130     EVP_add_cipher(EVP_rc2_40_cbc());
131     EVP_add_cipher(EVP_rc2_64_cbc());
132     EVP_add_cipher_alias(SN_rc2_cbc, "RC2");
133     EVP_add_cipher_alias(SN_rc2_cbc, "rc2");
134     EVP_add_cipher_alias(SN_rc2_cbc, "rc2-128");
135     EVP_add_cipher_alias(SN_rc2_64_cbc, "rc2-64");
136     EVP_add_cipher_alias(SN_rc2_40_cbc, "rc2-40");
137 #endif
138
139 #ifndef OPENSSL_NO_BF
140     EVP_add_cipher(EVP_bf_ecb());
141     EVP_add_cipher(EVP_bf_cfb());
142     EVP_add_cipher(EVP_bf_ofb());
143     EVP_add_cipher(EVP_bf_cbc());
144     EVP_add_cipher_alias(SN_bf_cbc, "BF");
145     EVP_add_cipher_alias(SN_bf_cbc, "bf");
146     EVP_add_cipher_alias(SN_bf_cbc, "blowfish");
147 #endif
148
149 #ifndef OPENSSL_NO_CAST
150     EVP_add_cipher(EVP_cast5_ecb());
151     EVP_add_cipher(EVP_cast5_cfb());
152     EVP_add_cipher(EVP_cast5_ofb());
153     EVP_add_cipher(EVP_cast5_cbc());
154     EVP_add_cipher_alias(SN_cast5_cbc, "CAST");
155     EVP_add_cipher_alias(SN_cast5_cbc, "cast");
156     EVP_add_cipher_alias(SN_cast5_cbc, "CAST-cbc");
157     EVP_add_cipher_alias(SN_cast5_cbc, "cast-cbc");
158 #endif
159
160 #ifndef OPENSSL_NO_RC5
161     EVP_add_cipher(EVP_rc5_32_12_16_ecb());
162     EVP_add_cipher(EVP_rc5_32_12_16_cfb());
163     EVP_add_cipher(EVP_rc5_32_12_16_ofb());
164     EVP_add_cipher(EVP_rc5_32_12_16_cbc());
165     EVP_add_cipher_alias(SN_rc5_cbc, "rc5");
166     EVP_add_cipher_alias(SN_rc5_cbc, "RC5");
167 #endif
168
169 #ifndef OPENSSL_NO_AES
170     EVP_add_cipher(EVP_aes_128_ecb());
171     EVP_add_cipher(EVP_aes_128_cbc());
172     EVP_add_cipher(EVP_aes_128_cfb());
173     EVP_add_cipher(EVP_aes_128_cfb1());
174     EVP_add_cipher(EVP_aes_128_cfb8());
175     EVP_add_cipher(EVP_aes_128_ofb());
176     EVP_add_cipher(EVP_aes_128_ctr());
177     EVP_add_cipher(EVP_aes_128_gcm());
178 # ifndef OPENSSL_NO_OCB
179     EVP_add_cipher(EVP_aes_128_ocb());
180 # endif
181     EVP_add_cipher(EVP_aes_128_xts());
182     EVP_add_cipher(EVP_aes_128_ccm());
183     EVP_add_cipher(EVP_aes_128_wrap());
184     EVP_add_cipher_alias(SN_id_aes128_wrap, "aes128-wrap");
185     EVP_add_cipher(EVP_aes_128_wrap_pad());
186     EVP_add_cipher_alias(SN_aes_128_cbc, "AES128");
187     EVP_add_cipher_alias(SN_aes_128_cbc, "aes128");
188     EVP_add_cipher(EVP_aes_192_ecb());
189     EVP_add_cipher(EVP_aes_192_cbc());
190     EVP_add_cipher(EVP_aes_192_cfb());
191     EVP_add_cipher(EVP_aes_192_cfb1());
192     EVP_add_cipher(EVP_aes_192_cfb8());
193     EVP_add_cipher(EVP_aes_192_ofb());
194     EVP_add_cipher(EVP_aes_192_ctr());
195     EVP_add_cipher(EVP_aes_192_gcm());
196 # ifndef OPENSSL_NO_OCB
197     EVP_add_cipher(EVP_aes_192_ocb());
198 # endif
199     EVP_add_cipher(EVP_aes_192_ccm());
200     EVP_add_cipher(EVP_aes_192_wrap());
201     EVP_add_cipher_alias(SN_id_aes192_wrap, "aes192-wrap");
202     EVP_add_cipher(EVP_aes_192_wrap_pad());
203     EVP_add_cipher_alias(SN_aes_192_cbc, "AES192");
204     EVP_add_cipher_alias(SN_aes_192_cbc, "aes192");
205     EVP_add_cipher(EVP_aes_256_ecb());
206     EVP_add_cipher(EVP_aes_256_cbc());
207     EVP_add_cipher(EVP_aes_256_cfb());
208     EVP_add_cipher(EVP_aes_256_cfb1());
209     EVP_add_cipher(EVP_aes_256_cfb8());
210     EVP_add_cipher(EVP_aes_256_ofb());
211     EVP_add_cipher(EVP_aes_256_ctr());
212     EVP_add_cipher(EVP_aes_256_gcm());
213 # ifndef OPENSSL_NO_OCB
214     EVP_add_cipher(EVP_aes_256_ocb());
215 # endif
216     EVP_add_cipher(EVP_aes_256_xts());
217     EVP_add_cipher(EVP_aes_256_ccm());
218     EVP_add_cipher(EVP_aes_256_wrap());
219     EVP_add_cipher_alias(SN_id_aes256_wrap, "aes256-wrap");
220     EVP_add_cipher(EVP_aes_256_wrap_pad());
221     EVP_add_cipher_alias(SN_aes_256_cbc, "AES256");
222     EVP_add_cipher_alias(SN_aes_256_cbc, "aes256");
223     EVP_add_cipher(EVP_aes_128_cbc_hmac_sha1());
224     EVP_add_cipher(EVP_aes_256_cbc_hmac_sha1());
225     EVP_add_cipher(EVP_aes_128_cbc_hmac_sha256());
226     EVP_add_cipher(EVP_aes_256_cbc_hmac_sha256());
227 #endif
228
229 #ifndef OPENSSL_NO_CAMELLIA
230     EVP_add_cipher(EVP_camellia_128_ecb());
231     EVP_add_cipher(EVP_camellia_128_cbc());
232     EVP_add_cipher(EVP_camellia_128_cfb());
233     EVP_add_cipher(EVP_camellia_128_cfb1());
234     EVP_add_cipher(EVP_camellia_128_cfb8());
235     EVP_add_cipher(EVP_camellia_128_ofb());
236     EVP_add_cipher_alias(SN_camellia_128_cbc, "CAMELLIA128");
237     EVP_add_cipher_alias(SN_camellia_128_cbc, "camellia128");
238     EVP_add_cipher(EVP_camellia_192_ecb());
239     EVP_add_cipher(EVP_camellia_192_cbc());
240     EVP_add_cipher(EVP_camellia_192_cfb());
241     EVP_add_cipher(EVP_camellia_192_cfb1());
242     EVP_add_cipher(EVP_camellia_192_cfb8());
243     EVP_add_cipher(EVP_camellia_192_ofb());
244     EVP_add_cipher_alias(SN_camellia_192_cbc, "CAMELLIA192");
245     EVP_add_cipher_alias(SN_camellia_192_cbc, "camellia192");
246     EVP_add_cipher(EVP_camellia_256_ecb());
247     EVP_add_cipher(EVP_camellia_256_cbc());
248     EVP_add_cipher(EVP_camellia_256_cfb());
249     EVP_add_cipher(EVP_camellia_256_cfb1());
250     EVP_add_cipher(EVP_camellia_256_cfb8());
251     EVP_add_cipher(EVP_camellia_256_ofb());
252     EVP_add_cipher_alias(SN_camellia_256_cbc, "CAMELLIA256");
253     EVP_add_cipher_alias(SN_camellia_256_cbc, "camellia256");
254     EVP_add_cipher(EVP_camellia_128_ctr());
255     EVP_add_cipher(EVP_camellia_192_ctr());
256     EVP_add_cipher(EVP_camellia_256_ctr());
257 #endif
258
259 #ifndef OPENSSL_NO_CHACHA
260     EVP_add_cipher(EVP_chacha20());
261 # ifndef OPENSSL_NO_POLY1305
262     EVP_add_cipher(EVP_chacha20_poly1305());
263 # endif
264 #endif
265 }