Implement Aria GCM/CCM Modes and TLS cipher suites
[openssl.git] / crypto / evp / c_allc.c
1 /*
2  * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
3  *
4  * Licensed under the OpenSSL license (the "License").  You may not use
5  * this file except in compliance with the License.  You can obtain a copy
6  * in the file LICENSE in the source distribution or at
7  * https://www.openssl.org/source/license.html
8  */
9
10 #include <stdio.h>
11 #include "internal/cryptlib.h"
12 #include <openssl/evp.h>
13 #include "internal/evp_int.h"
14 #include <openssl/pkcs12.h>
15 #include <openssl/objects.h>
16
17 void openssl_add_all_ciphers_int(void)
18 {
19
20 #ifndef OPENSSL_NO_DES
21     EVP_add_cipher(EVP_des_cfb());
22     EVP_add_cipher(EVP_des_cfb1());
23     EVP_add_cipher(EVP_des_cfb8());
24     EVP_add_cipher(EVP_des_ede_cfb());
25     EVP_add_cipher(EVP_des_ede3_cfb());
26     EVP_add_cipher(EVP_des_ede3_cfb1());
27     EVP_add_cipher(EVP_des_ede3_cfb8());
28
29     EVP_add_cipher(EVP_des_ofb());
30     EVP_add_cipher(EVP_des_ede_ofb());
31     EVP_add_cipher(EVP_des_ede3_ofb());
32
33     EVP_add_cipher(EVP_desx_cbc());
34     EVP_add_cipher_alias(SN_desx_cbc, "DESX");
35     EVP_add_cipher_alias(SN_desx_cbc, "desx");
36
37     EVP_add_cipher(EVP_des_cbc());
38     EVP_add_cipher_alias(SN_des_cbc, "DES");
39     EVP_add_cipher_alias(SN_des_cbc, "des");
40     EVP_add_cipher(EVP_des_ede_cbc());
41     EVP_add_cipher(EVP_des_ede3_cbc());
42     EVP_add_cipher_alias(SN_des_ede3_cbc, "DES3");
43     EVP_add_cipher_alias(SN_des_ede3_cbc, "des3");
44
45     EVP_add_cipher(EVP_des_ecb());
46     EVP_add_cipher(EVP_des_ede());
47     EVP_add_cipher_alias(SN_des_ede_ecb, "DES-EDE-ECB");
48     EVP_add_cipher_alias(SN_des_ede_ecb, "des-ede-ecb");
49     EVP_add_cipher(EVP_des_ede3());
50     EVP_add_cipher_alias(SN_des_ede3_ecb, "DES-EDE3-ECB");
51     EVP_add_cipher_alias(SN_des_ede3_ecb, "des-ede3-ecb");
52     EVP_add_cipher(EVP_des_ede3_wrap());
53     EVP_add_cipher_alias(SN_id_smime_alg_CMS3DESwrap, "des3-wrap");
54 #endif
55
56 #ifndef OPENSSL_NO_RC4
57     EVP_add_cipher(EVP_rc4());
58     EVP_add_cipher(EVP_rc4_40());
59 # ifndef OPENSSL_NO_MD5
60     EVP_add_cipher(EVP_rc4_hmac_md5());
61 # endif
62 #endif
63
64 #ifndef OPENSSL_NO_IDEA
65     EVP_add_cipher(EVP_idea_ecb());
66     EVP_add_cipher(EVP_idea_cfb());
67     EVP_add_cipher(EVP_idea_ofb());
68     EVP_add_cipher(EVP_idea_cbc());
69     EVP_add_cipher_alias(SN_idea_cbc, "IDEA");
70     EVP_add_cipher_alias(SN_idea_cbc, "idea");
71 #endif
72
73 #ifndef OPENSSL_NO_SEED
74     EVP_add_cipher(EVP_seed_ecb());
75     EVP_add_cipher(EVP_seed_cfb());
76     EVP_add_cipher(EVP_seed_ofb());
77     EVP_add_cipher(EVP_seed_cbc());
78     EVP_add_cipher_alias(SN_seed_cbc, "SEED");
79     EVP_add_cipher_alias(SN_seed_cbc, "seed");
80 #endif
81
82 #ifndef OPENSSL_NO_RC2
83     EVP_add_cipher(EVP_rc2_ecb());
84     EVP_add_cipher(EVP_rc2_cfb());
85     EVP_add_cipher(EVP_rc2_ofb());
86     EVP_add_cipher(EVP_rc2_cbc());
87     EVP_add_cipher(EVP_rc2_40_cbc());
88     EVP_add_cipher(EVP_rc2_64_cbc());
89     EVP_add_cipher_alias(SN_rc2_cbc, "RC2");
90     EVP_add_cipher_alias(SN_rc2_cbc, "rc2");
91     EVP_add_cipher_alias(SN_rc2_cbc, "rc2-128");
92     EVP_add_cipher_alias(SN_rc2_64_cbc, "rc2-64");
93     EVP_add_cipher_alias(SN_rc2_40_cbc, "rc2-40");
94 #endif
95
96 #ifndef OPENSSL_NO_BF
97     EVP_add_cipher(EVP_bf_ecb());
98     EVP_add_cipher(EVP_bf_cfb());
99     EVP_add_cipher(EVP_bf_ofb());
100     EVP_add_cipher(EVP_bf_cbc());
101     EVP_add_cipher_alias(SN_bf_cbc, "BF");
102     EVP_add_cipher_alias(SN_bf_cbc, "bf");
103     EVP_add_cipher_alias(SN_bf_cbc, "blowfish");
104 #endif
105
106 #ifndef OPENSSL_NO_CAST
107     EVP_add_cipher(EVP_cast5_ecb());
108     EVP_add_cipher(EVP_cast5_cfb());
109     EVP_add_cipher(EVP_cast5_ofb());
110     EVP_add_cipher(EVP_cast5_cbc());
111     EVP_add_cipher_alias(SN_cast5_cbc, "CAST");
112     EVP_add_cipher_alias(SN_cast5_cbc, "cast");
113     EVP_add_cipher_alias(SN_cast5_cbc, "CAST-cbc");
114     EVP_add_cipher_alias(SN_cast5_cbc, "cast-cbc");
115 #endif
116
117 #ifndef OPENSSL_NO_RC5
118     EVP_add_cipher(EVP_rc5_32_12_16_ecb());
119     EVP_add_cipher(EVP_rc5_32_12_16_cfb());
120     EVP_add_cipher(EVP_rc5_32_12_16_ofb());
121     EVP_add_cipher(EVP_rc5_32_12_16_cbc());
122     EVP_add_cipher_alias(SN_rc5_cbc, "rc5");
123     EVP_add_cipher_alias(SN_rc5_cbc, "RC5");
124 #endif
125
126     EVP_add_cipher(EVP_aes_128_ecb());
127     EVP_add_cipher(EVP_aes_128_cbc());
128     EVP_add_cipher(EVP_aes_128_cfb());
129     EVP_add_cipher(EVP_aes_128_cfb1());
130     EVP_add_cipher(EVP_aes_128_cfb8());
131     EVP_add_cipher(EVP_aes_128_ofb());
132     EVP_add_cipher(EVP_aes_128_ctr());
133     EVP_add_cipher(EVP_aes_128_gcm());
134 #ifndef OPENSSL_NO_OCB
135     EVP_add_cipher(EVP_aes_128_ocb());
136 #endif
137     EVP_add_cipher(EVP_aes_128_xts());
138     EVP_add_cipher(EVP_aes_128_ccm());
139     EVP_add_cipher(EVP_aes_128_wrap());
140     EVP_add_cipher_alias(SN_id_aes128_wrap, "aes128-wrap");
141     EVP_add_cipher(EVP_aes_128_wrap_pad());
142     EVP_add_cipher_alias(SN_aes_128_cbc, "AES128");
143     EVP_add_cipher_alias(SN_aes_128_cbc, "aes128");
144     EVP_add_cipher(EVP_aes_192_ecb());
145     EVP_add_cipher(EVP_aes_192_cbc());
146     EVP_add_cipher(EVP_aes_192_cfb());
147     EVP_add_cipher(EVP_aes_192_cfb1());
148     EVP_add_cipher(EVP_aes_192_cfb8());
149     EVP_add_cipher(EVP_aes_192_ofb());
150     EVP_add_cipher(EVP_aes_192_ctr());
151     EVP_add_cipher(EVP_aes_192_gcm());
152 #ifndef OPENSSL_NO_OCB
153     EVP_add_cipher(EVP_aes_192_ocb());
154 #endif
155     EVP_add_cipher(EVP_aes_192_ccm());
156     EVP_add_cipher(EVP_aes_192_wrap());
157     EVP_add_cipher_alias(SN_id_aes192_wrap, "aes192-wrap");
158     EVP_add_cipher(EVP_aes_192_wrap_pad());
159     EVP_add_cipher_alias(SN_aes_192_cbc, "AES192");
160     EVP_add_cipher_alias(SN_aes_192_cbc, "aes192");
161     EVP_add_cipher(EVP_aes_256_ecb());
162     EVP_add_cipher(EVP_aes_256_cbc());
163     EVP_add_cipher(EVP_aes_256_cfb());
164     EVP_add_cipher(EVP_aes_256_cfb1());
165     EVP_add_cipher(EVP_aes_256_cfb8());
166     EVP_add_cipher(EVP_aes_256_ofb());
167     EVP_add_cipher(EVP_aes_256_ctr());
168     EVP_add_cipher(EVP_aes_256_gcm());
169 #ifndef OPENSSL_NO_OCB
170     EVP_add_cipher(EVP_aes_256_ocb());
171 #endif
172     EVP_add_cipher(EVP_aes_256_xts());
173     EVP_add_cipher(EVP_aes_256_ccm());
174     EVP_add_cipher(EVP_aes_256_wrap());
175     EVP_add_cipher_alias(SN_id_aes256_wrap, "aes256-wrap");
176     EVP_add_cipher(EVP_aes_256_wrap_pad());
177     EVP_add_cipher_alias(SN_aes_256_cbc, "AES256");
178     EVP_add_cipher_alias(SN_aes_256_cbc, "aes256");
179     EVP_add_cipher(EVP_aes_128_cbc_hmac_sha1());
180     EVP_add_cipher(EVP_aes_256_cbc_hmac_sha1());
181     EVP_add_cipher(EVP_aes_128_cbc_hmac_sha256());
182     EVP_add_cipher(EVP_aes_256_cbc_hmac_sha256());
183
184 #ifndef OPENSSL_NO_ARIA
185     EVP_add_cipher(EVP_aria_128_ecb());
186     EVP_add_cipher(EVP_aria_128_cbc());
187     EVP_add_cipher(EVP_aria_128_cfb());
188     EVP_add_cipher(EVP_aria_128_cfb1());
189     EVP_add_cipher(EVP_aria_128_cfb8());
190     EVP_add_cipher(EVP_aria_128_ctr());
191     EVP_add_cipher(EVP_aria_128_ofb());
192     EVP_add_cipher(EVP_aria_128_gcm());
193     EVP_add_cipher(EVP_aria_128_ccm());
194     EVP_add_cipher_alias(SN_aria_128_cbc, "ARIA128");
195     EVP_add_cipher_alias(SN_aria_128_cbc, "aria128");
196     EVP_add_cipher(EVP_aria_192_ecb());
197     EVP_add_cipher(EVP_aria_192_cbc());
198     EVP_add_cipher(EVP_aria_192_cfb());
199     EVP_add_cipher(EVP_aria_192_cfb1());
200     EVP_add_cipher(EVP_aria_192_cfb8());
201     EVP_add_cipher(EVP_aria_192_ctr());
202     EVP_add_cipher(EVP_aria_192_ofb());
203     EVP_add_cipher(EVP_aria_192_gcm());
204     EVP_add_cipher(EVP_aria_192_ccm());
205     EVP_add_cipher_alias(SN_aria_192_cbc, "ARIA192");
206     EVP_add_cipher_alias(SN_aria_192_cbc, "aria192");
207     EVP_add_cipher(EVP_aria_256_ecb());
208     EVP_add_cipher(EVP_aria_256_cbc());
209     EVP_add_cipher(EVP_aria_256_cfb());
210     EVP_add_cipher(EVP_aria_256_cfb1());
211     EVP_add_cipher(EVP_aria_256_cfb8());
212     EVP_add_cipher(EVP_aria_256_ctr());
213     EVP_add_cipher(EVP_aria_256_ofb());
214     EVP_add_cipher(EVP_aria_256_gcm());
215     EVP_add_cipher(EVP_aria_256_ccm());
216     EVP_add_cipher_alias(SN_aria_256_cbc, "ARIA256");
217     EVP_add_cipher_alias(SN_aria_256_cbc, "aria256");
218 #endif
219
220 #ifndef OPENSSL_NO_CAMELLIA
221     EVP_add_cipher(EVP_camellia_128_ecb());
222     EVP_add_cipher(EVP_camellia_128_cbc());
223     EVP_add_cipher(EVP_camellia_128_cfb());
224     EVP_add_cipher(EVP_camellia_128_cfb1());
225     EVP_add_cipher(EVP_camellia_128_cfb8());
226     EVP_add_cipher(EVP_camellia_128_ofb());
227     EVP_add_cipher_alias(SN_camellia_128_cbc, "CAMELLIA128");
228     EVP_add_cipher_alias(SN_camellia_128_cbc, "camellia128");
229     EVP_add_cipher(EVP_camellia_192_ecb());
230     EVP_add_cipher(EVP_camellia_192_cbc());
231     EVP_add_cipher(EVP_camellia_192_cfb());
232     EVP_add_cipher(EVP_camellia_192_cfb1());
233     EVP_add_cipher(EVP_camellia_192_cfb8());
234     EVP_add_cipher(EVP_camellia_192_ofb());
235     EVP_add_cipher_alias(SN_camellia_192_cbc, "CAMELLIA192");
236     EVP_add_cipher_alias(SN_camellia_192_cbc, "camellia192");
237     EVP_add_cipher(EVP_camellia_256_ecb());
238     EVP_add_cipher(EVP_camellia_256_cbc());
239     EVP_add_cipher(EVP_camellia_256_cfb());
240     EVP_add_cipher(EVP_camellia_256_cfb1());
241     EVP_add_cipher(EVP_camellia_256_cfb8());
242     EVP_add_cipher(EVP_camellia_256_ofb());
243     EVP_add_cipher_alias(SN_camellia_256_cbc, "CAMELLIA256");
244     EVP_add_cipher_alias(SN_camellia_256_cbc, "camellia256");
245     EVP_add_cipher(EVP_camellia_128_ctr());
246     EVP_add_cipher(EVP_camellia_192_ctr());
247     EVP_add_cipher(EVP_camellia_256_ctr());
248 #endif
249
250 #ifndef OPENSSL_NO_CHACHA
251     EVP_add_cipher(EVP_chacha20());
252 # ifndef OPENSSL_NO_POLY1305
253     EVP_add_cipher(EVP_chacha20_poly1305());
254 # endif
255 #endif
256 }