ac172e84c4e3e3b8b34b45dd91f935704bb5412e
[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 <internal/evp_int.h>
62 #include <openssl/pkcs12.h>
63 #include <openssl/objects.h>
64
65 void openssl_add_all_ciphers_int(void)
66 {
67
68 #ifndef OPENSSL_NO_DES
69     EVP_add_cipher(EVP_des_cfb());
70     EVP_add_cipher(EVP_des_cfb1());
71     EVP_add_cipher(EVP_des_cfb8());
72     EVP_add_cipher(EVP_des_ede_cfb());
73     EVP_add_cipher(EVP_des_ede3_cfb());
74     EVP_add_cipher(EVP_des_ede3_cfb1());
75     EVP_add_cipher(EVP_des_ede3_cfb8());
76
77     EVP_add_cipher(EVP_des_ofb());
78     EVP_add_cipher(EVP_des_ede_ofb());
79     EVP_add_cipher(EVP_des_ede3_ofb());
80
81     EVP_add_cipher(EVP_desx_cbc());
82     EVP_add_cipher_alias(SN_desx_cbc, "DESX");
83     EVP_add_cipher_alias(SN_desx_cbc, "desx");
84
85     EVP_add_cipher(EVP_des_cbc());
86     EVP_add_cipher_alias(SN_des_cbc, "DES");
87     EVP_add_cipher_alias(SN_des_cbc, "des");
88     EVP_add_cipher(EVP_des_ede_cbc());
89     EVP_add_cipher(EVP_des_ede3_cbc());
90     EVP_add_cipher_alias(SN_des_ede3_cbc, "DES3");
91     EVP_add_cipher_alias(SN_des_ede3_cbc, "des3");
92
93     EVP_add_cipher(EVP_des_ecb());
94     EVP_add_cipher(EVP_des_ede());
95     EVP_add_cipher(EVP_des_ede3());
96     EVP_add_cipher(EVP_des_ede3_wrap());
97     EVP_add_cipher_alias(SN_id_smime_alg_CMS3DESwrap, "des3-wrap");
98 #endif
99
100 #ifndef OPENSSL_NO_RC4
101     EVP_add_cipher(EVP_rc4());
102     EVP_add_cipher(EVP_rc4_40());
103 # ifndef OPENSSL_NO_MD5
104     EVP_add_cipher(EVP_rc4_hmac_md5());
105 # endif
106 #endif
107
108 #ifndef OPENSSL_NO_IDEA
109     EVP_add_cipher(EVP_idea_ecb());
110     EVP_add_cipher(EVP_idea_cfb());
111     EVP_add_cipher(EVP_idea_ofb());
112     EVP_add_cipher(EVP_idea_cbc());
113     EVP_add_cipher_alias(SN_idea_cbc, "IDEA");
114     EVP_add_cipher_alias(SN_idea_cbc, "idea");
115 #endif
116
117 #ifndef OPENSSL_NO_SEED
118     EVP_add_cipher(EVP_seed_ecb());
119     EVP_add_cipher(EVP_seed_cfb());
120     EVP_add_cipher(EVP_seed_ofb());
121     EVP_add_cipher(EVP_seed_cbc());
122     EVP_add_cipher_alias(SN_seed_cbc, "SEED");
123     EVP_add_cipher_alias(SN_seed_cbc, "seed");
124 #endif
125
126 #ifndef OPENSSL_NO_RC2
127     EVP_add_cipher(EVP_rc2_ecb());
128     EVP_add_cipher(EVP_rc2_cfb());
129     EVP_add_cipher(EVP_rc2_ofb());
130     EVP_add_cipher(EVP_rc2_cbc());
131     EVP_add_cipher(EVP_rc2_40_cbc());
132     EVP_add_cipher(EVP_rc2_64_cbc());
133     EVP_add_cipher_alias(SN_rc2_cbc, "RC2");
134     EVP_add_cipher_alias(SN_rc2_cbc, "rc2");
135     EVP_add_cipher_alias(SN_rc2_cbc, "rc2-128");
136     EVP_add_cipher_alias(SN_rc2_64_cbc, "rc2-64");
137     EVP_add_cipher_alias(SN_rc2_40_cbc, "rc2-40");
138 #endif
139
140 #ifndef OPENSSL_NO_BF
141     EVP_add_cipher(EVP_bf_ecb());
142     EVP_add_cipher(EVP_bf_cfb());
143     EVP_add_cipher(EVP_bf_ofb());
144     EVP_add_cipher(EVP_bf_cbc());
145     EVP_add_cipher_alias(SN_bf_cbc, "BF");
146     EVP_add_cipher_alias(SN_bf_cbc, "bf");
147     EVP_add_cipher_alias(SN_bf_cbc, "blowfish");
148 #endif
149
150 #ifndef OPENSSL_NO_CAST
151     EVP_add_cipher(EVP_cast5_ecb());
152     EVP_add_cipher(EVP_cast5_cfb());
153     EVP_add_cipher(EVP_cast5_ofb());
154     EVP_add_cipher(EVP_cast5_cbc());
155     EVP_add_cipher_alias(SN_cast5_cbc, "CAST");
156     EVP_add_cipher_alias(SN_cast5_cbc, "cast");
157     EVP_add_cipher_alias(SN_cast5_cbc, "CAST-cbc");
158     EVP_add_cipher_alias(SN_cast5_cbc, "cast-cbc");
159 #endif
160
161 #ifndef OPENSSL_NO_RC5
162     EVP_add_cipher(EVP_rc5_32_12_16_ecb());
163     EVP_add_cipher(EVP_rc5_32_12_16_cfb());
164     EVP_add_cipher(EVP_rc5_32_12_16_ofb());
165     EVP_add_cipher(EVP_rc5_32_12_16_cbc());
166     EVP_add_cipher_alias(SN_rc5_cbc, "rc5");
167     EVP_add_cipher_alias(SN_rc5_cbc, "RC5");
168 #endif
169
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
228 #ifndef OPENSSL_NO_CAMELLIA
229     EVP_add_cipher(EVP_camellia_128_ecb());
230     EVP_add_cipher(EVP_camellia_128_cbc());
231     EVP_add_cipher(EVP_camellia_128_cfb());
232     EVP_add_cipher(EVP_camellia_128_cfb1());
233     EVP_add_cipher(EVP_camellia_128_cfb8());
234     EVP_add_cipher(EVP_camellia_128_ofb());
235     EVP_add_cipher_alias(SN_camellia_128_cbc, "CAMELLIA128");
236     EVP_add_cipher_alias(SN_camellia_128_cbc, "camellia128");
237     EVP_add_cipher(EVP_camellia_192_ecb());
238     EVP_add_cipher(EVP_camellia_192_cbc());
239     EVP_add_cipher(EVP_camellia_192_cfb());
240     EVP_add_cipher(EVP_camellia_192_cfb1());
241     EVP_add_cipher(EVP_camellia_192_cfb8());
242     EVP_add_cipher(EVP_camellia_192_ofb());
243     EVP_add_cipher_alias(SN_camellia_192_cbc, "CAMELLIA192");
244     EVP_add_cipher_alias(SN_camellia_192_cbc, "camellia192");
245     EVP_add_cipher(EVP_camellia_256_ecb());
246     EVP_add_cipher(EVP_camellia_256_cbc());
247     EVP_add_cipher(EVP_camellia_256_cfb());
248     EVP_add_cipher(EVP_camellia_256_cfb1());
249     EVP_add_cipher(EVP_camellia_256_cfb8());
250     EVP_add_cipher(EVP_camellia_256_ofb());
251     EVP_add_cipher_alias(SN_camellia_256_cbc, "CAMELLIA256");
252     EVP_add_cipher_alias(SN_camellia_256_cbc, "camellia256");
253     EVP_add_cipher(EVP_camellia_128_ctr());
254     EVP_add_cipher(EVP_camellia_192_ctr());
255     EVP_add_cipher(EVP_camellia_256_ctr());
256 #endif
257
258 #ifndef OPENSSL_NO_CHACHA
259     EVP_add_cipher(EVP_chacha20());
260 # ifndef OPENSSL_NO_POLY1305
261     EVP_add_cipher(EVP_chacha20_poly1305());
262 # endif
263 #endif
264 }