1 /* $OpenBSD: evp.h,v 1.83 2021/05/10 17:00:32 tb Exp $ */
2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3  * All rights reserved.
4  *
5  * This package is an SSL implementation written
6  * by Eric Young (eay@cryptsoft.com).
7  * The implementation was written so as to conform with Netscapes SSL.
8  *
9  * This library is free for commercial and non-commercial use as core.stdc.config.c_long as
10  * the following conditions are aheared to.  The following conditions
11  * apply to all code found in this distribution, be it the RC4, RSA,
12  * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
13  * included with this distribution is covered by the same copyright terms
14  * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15  *
16  * Copyright remains Eric Young's, and as such any Copyright notices in
17  * the code are not to be removed.
18  * If this package is used in a product, Eric Young should be given attribution
19  * as the author of the parts of the library used.
20  * This can be in the form of a textual message at program startup or
21  * in documentation (online or textual) provided with the package.
22  *
23  * Redistribution and use in source and binary forms, with or without
24  * modification, are permitted provided that the following conditions
25  * are met:
26  * 1. Redistributions of source code must retain the copyright
27  *    notice, this list of conditions and the following disclaimer.
28  * 2. Redistributions in binary form must reproduce the above copyright
29  *    notice, this list of conditions and the following disclaimer in the
30  *    documentation and/or other materials provided with the distribution.
31  * 3. All advertising materials mentioning features or use of this software
32  *    must display the following acknowledgement:
33  *    "This product includes cryptographic software written by
34  *     Eric Young (eay@cryptsoft.com)"
35  *    The word 'cryptographic' can be left out if the rouines from the library
36  *    being used are not cryptographic related :-).
37  * 4. If you include any Windows specific code (or a derivative thereof) from
38  *    the apps directory (application code) you must include an acknowledgement:
39  *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40  *
41  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51  * SUCH DAMAGE.
52  *
53  * The licence and distribution terms for any publically available version or
54  * derivative of this code cannot be changed.  i.e. this code cannot simply be
55  * copied and put under another distribution licence
56  * [including the GNU Public Licence.]
57  */
58 module libressl_d.openssl.evp;
59 
60 
61 private static import core.stdc.config;
62 private static import libressl_d.openssl.asn1;
63 private static import libressl_d.openssl.dh;
64 private static import libressl_d.openssl.dsa;
65 private static import libressl_d.openssl.ec;
66 private static import libressl_d.openssl.ecdsa;
67 private static import libressl_d.openssl.gost;
68 private static import libressl_d.openssl.rsa;
69 private static import libressl_d.openssl.x509;
70 public import libressl_d.openssl.bio;
71 public import libressl_d.openssl.objects;
72 public import libressl_d.openssl.opensslconf;
73 public import libressl_d.openssl.ossl_typ;
74 
75 version (OPENSSL_NO_BIO) {
76 } else {
77 	public import libressl_d.openssl.bio;
78 }
79 
80 /*
81 enum EVP_RC2_KEY_SIZE = 16;
82 enum EVP_RC4_KEY_SIZE = 16;
83 enum EVP_BLOWFISH_KEY_SIZE = 16;
84 enum EVP_CAST5_KEY_SIZE = 16;
85 enum EVP_RC5_32_12_16_KEY_SIZE = 16;
86  */
87 
88 /**
89  * longest known is SHA512
90  */
91 enum EVP_MAX_MD_SIZE = 64;
92 
93 enum EVP_MAX_KEY_LENGTH = 64;
94 enum EVP_MAX_IV_LENGTH = 16;
95 enum EVP_MAX_BLOCK_LENGTH = 32;
96 
97 enum PKCS5_SALT_LEN = 8;
98 /* Default PKCS#5 iteration count */
99 enum PKCS5_DEFAULT_ITER = 2048;
100 
101 enum EVP_PK_RSA = 0x0001;
102 enum EVP_PK_DSA = 0x0002;
103 enum EVP_PK_DH = 0x0004;
104 enum EVP_PK_EC = 0x0008;
105 enum EVP_PKT_SIGN = 0x0010;
106 enum EVP_PKT_ENC = 0x0020;
107 enum EVP_PKT_EXCH = 0x0040;
108 enum EVP_PKS_RSA = 0x0100;
109 enum EVP_PKS_DSA = 0x0200;
110 enum EVP_PKS_EC = 0x0400;
111 
112 /**
113  * <= 512 bit key
114  */
115 enum EVP_PKT_EXP = 0x1000;
116 
117 alias EVP_PKEY_NONE = libressl_d.openssl.objects.NID_undef;
118 alias EVP_PKEY_RSA = libressl_d.openssl.objects.NID_rsaEncryption;
119 alias EVP_PKEY_RSA_PSS = libressl_d.openssl.objects.NID_rsassaPss;
120 alias EVP_PKEY_RSA2 = libressl_d.openssl.objects.NID_rsa;
121 alias EVP_PKEY_DSA = libressl_d.openssl.objects.NID_dsa;
122 alias EVP_PKEY_DSA1 = libressl_d.openssl.objects.NID_dsa_2;
123 alias EVP_PKEY_DSA2 = libressl_d.openssl.objects.NID_dsaWithSHA;
124 alias EVP_PKEY_DSA3 = libressl_d.openssl.objects.NID_dsaWithSHA1;
125 alias EVP_PKEY_DSA4 = libressl_d.openssl.objects.NID_dsaWithSHA1_2;
126 alias EVP_PKEY_DH = libressl_d.openssl.objects.NID_dhKeyAgreement;
127 alias EVP_PKEY_EC = libressl_d.openssl.objects.NID_X9_62_id_ecPublicKey;
128 alias EVP_PKEY_GOSTR01 = libressl_d.openssl.objects.NID_id_GostR3410_2001;
129 alias EVP_PKEY_GOSTIMIT = libressl_d.openssl.objects.NID_id_Gost28147_89_MAC;
130 alias EVP_PKEY_HMAC = libressl_d.openssl.objects.NID_hmac;
131 alias EVP_PKEY_CMAC = libressl_d.openssl.objects.NID_cmac;
132 alias EVP_PKEY_GOSTR12_256 = libressl_d.openssl.objects.NID_id_tc26_gost3410_2012_256;
133 alias EVP_PKEY_GOSTR12_512 = libressl_d.openssl.objects.NID_id_tc26_gost3410_2012_512;
134 
135 extern (C):
136 nothrow @nogc:
137 
138 /**
139  * Type needs to be a bit field
140  * Sub-type needs to be for variations on the method, as in, can it do
141  * arbitrary encryption....
142  */
143 struct evp_pkey_st
144 {
145 	int type;
146 	int save_type;
147 	int references;
148 	const (libressl_d.openssl.ossl_typ.EVP_PKEY_ASN1_METHOD)* ameth;
149 	libressl_d.openssl.ossl_typ.ENGINE* engine;
150 
151 	union pkey_
152 	{
153 		char* ptr_;
154 
155 		version (OPENSSL_NO_RSA) {
156 		} else {
157 			/**
158 			 * RSA
159 			 */
160 			libressl_d.openssl.rsa.rsa_st* rsa;
161 		}
162 
163 		version (OPENSSL_NO_DSA) {
164 		} else {
165 			/**
166 			 * DSA
167 			 */
168 			libressl_d.openssl.dsa.dsa_st* dsa;
169 		}
170 
171 		version (OPENSSL_NO_DH) {
172 		} else {
173 			/**
174 			 * DH
175 			 */
176 			libressl_d.openssl.dh.dh_st* dh;
177 		}
178 
179 		version (OPENSSL_NO_EC) {
180 		} else {
181 			/**
182 			 * ECC
183 			 */
184 			libressl_d.openssl.ec.ec_key_st* ec;
185 		}
186 
187 		version (OPENSSL_NO_GOST) {
188 		} else {
189 			/**
190 			 * GOST
191 			 */
192 			libressl_d.openssl.gost.gost_key_st* gost;
193 		}
194 	}
195 
196 	pkey_ pkey;
197 	int save_parameters;
198 
199 	/**
200 	 * [ 0 ]
201 	 */
202 	libressl_d.openssl.x509.stack_st_X509_ATTRIBUTE* attributes;
203 }
204 
205 enum EVP_PKEY_MO_SIGN = 0x0001;
206 enum EVP_PKEY_MO_VERIFY = 0x0002;
207 enum EVP_PKEY_MO_ENCRYPT = 0x0004;
208 enum EVP_PKEY_MO_DECRYPT = 0x0008;
209 
210 alias evp_sign_method = extern (C) nothrow @nogc int function(int type, const (ubyte)* m, uint m_length, ubyte* sigret, uint* siglen, void* key);
211 alias evp_verify_method = extern (C) nothrow @nogc int function(int type, const (ubyte)* m, uint m_length, const (ubyte)* sigbuf, uint siglen, void* key);
212 
213 //static if (!__traits(compiles, libressl_d.openssl.ossl_typ.EVP_MD))
214 version (all) {
215 	struct env_md_st
216 	{
217 		int type;
218 		int pkey_type;
219 		int md_size;
220 		core.stdc.config.c_ulong flags;
221 		int function(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx) init;
222 		int function(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx, const (void)* data, size_t count) update;
223 		int function(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx, ubyte* md) final_;
224 		int function(libressl_d.openssl.ossl_typ.EVP_MD_CTX* to, const (libressl_d.openssl.ossl_typ.EVP_MD_CTX)* from) copy;
225 		int function(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx) cleanup;
226 
227 		.evp_sign_method* sign;
228 		evp_verify_method* verify;
229 
230 		/**
231 		 * EVP_PKEY_xxx
232 		 */
233 		int[5] required_pkey_type;
234 
235 		int block_size;
236 
237 		/**
238 		 * how big does the ctx.md_data need to be
239 		 */
240 		int ctx_size;
241 
242 		/**
243 		 * control function
244 		 */
245 		int function(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx, int cmd, int p1, void* p2) md_ctrl;
246 	}
247 
248 	/**
249 	 * digest can only handle a single
250 	 * block
251 	 */
252 	enum EVP_MD_FLAG_ONESHOT = 0x0001;
253 
254 	/**
255 	 * digest is a "clone" digest used
256 	 * which is a copy of an existing
257 	 * one for a specific public key type.
258 	 * EVP_dss1() etc
259 	 */
260 	enum EVP_MD_FLAG_PKEY_DIGEST = 0x0002;
261 
262 	/**
263 	 * Digest uses EVP_PKEY_METHOD for signing instead of MD specific signing
264 	 */
265 	enum EVP_MD_FLAG_PKEY_METHOD_SIGNATURE = 0x0004;
266 
267 	/**
268 	 * DigestAlgorithmIdentifier flags...
269 	 */
270 	enum EVP_MD_FLAG_DIGALGID_MASK = 0x0018;
271 
272 	/**
273 	 * null or absent parameter accepted. Use null
274 	 */
275 	enum EVP_MD_FLAG_DIGALGID_NULL = 0x0000;
276 
277 	/**
278 	 * null or absent parameter accepted. Use null for PKCS#1 otherwise absent
279 	 */
280 	enum EVP_MD_FLAG_DIGALGID_ABSENT = 0x0008;
281 
282 	/**
283 	 * Custom handling via ctrl
284 	 */
285 	enum EVP_MD_FLAG_DIGALGID_CUSTOM = 0x0018;
286 
287 	/**
288 	 * Note if suitable for use in FIPS mode
289 	 */
290 	enum EVP_MD_FLAG_FIPS = 0x0400;
291 
292 	/* Digest ctrls */
293 
294 	enum EVP_MD_CTRL_DIGALGID = 0x01;
295 	enum EVP_MD_CTRL_MICALG = 0x02;
296 	enum EVP_MD_CTRL_SET_KEY = 0x03;
297 	enum EVP_MD_CTRL_GOST_SET_SBOX = 0x04;
298 
299 	/**
300 	 * Minimum Algorithm specific ctrl value
301 	 */
302 	enum EVP_MD_CTRL_ALG_CTRL = 0x1000;
303 
304 	//#define EVP_PKEY_NULL_method null, null, { 0, 0, 0, 0 }
305 
306 	version (OPENSSL_NO_DSA) {
307 		//#define EVP_PKEY_DSA_method EVP_PKEY_NULL_method
308 	} else {
309 		//#define EVP_PKEY_DSA_method cast(.evp_sign_method*)(libressl_d.openssl.dsa.DSA_sign), cast(.evp_verify_method*)(libressl_d.openssl.dsa.DSA_verify), { .EVP_PKEY_DSA, .EVP_PKEY_DSA2, .EVP_PKEY_DSA3, .EVP_PKEY_DSA4, 0 }
310 	}
311 
312 	version (OPENSSL_NO_ECDSA) {
313 		//#define EVP_PKEY_ECDSA_method EVP_PKEY_NULL_method
314 	} else {
315 		//#define EVP_PKEY_ECDSA_method cast(.evp_sign_method*)(libressl_d.openssl.ecdsa.ECDSA_sign), cast(.evp_verify_method*)(libressl_d.openssl.ecdsa.ECDSA_verify), { .EVP_PKEY_EC, 0, 0, 0 }
316 	}
317 
318 	version (OPENSSL_NO_RSA) {
319 		//#define EVP_PKEY_RSA_method EVP_PKEY_NULL_method
320 		//#define EVP_PKEY_RSA_ASN1_OCTET_STRING_method EVP_PKEY_NULL_method
321 	} else {
322 		//#define EVP_PKEY_RSA_method cast(.evp_sign_method*)(libressl_d.openssl.rsa.RSA_sign), cast(.evp_verify_method*)(libressl_d.openssl.rsa.RSA_verify), { .EVP_PKEY_RSA, .EVP_PKEY_RSA2, 0, 0 }
323 		//#define EVP_PKEY_RSA_ASN1_OCTET_STRING_method cast(.evp_sign_method*)(libressl_d.openssl.rsa.RSA_sign_ASN1_OCTET_STRING), cast(.evp_verify_method*)(libressl_d.openssl.rsa.RSA_verify_ASN1_OCTET_STRING), { .EVP_PKEY_RSA, .EVP_PKEY_RSA2, 0, 0 }
324 	}
325 }
326 
327 struct env_md_ctx_st
328 {
329 	const (libressl_d.openssl.ossl_typ.EVP_MD)* digest;
330 
331 	/**
332 	 * functional reference if 'digest' is ENGINE-provided
333 	 */
334 	libressl_d.openssl.ossl_typ.ENGINE* engine;
335 
336 	core.stdc.config.c_ulong flags;
337 	void* md_data;
338 
339 	/**
340 	 * Public key context for sign/verify
341 	 */
342 	libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* pctx;
343 
344 	/**
345 	 * Update function: usually copied from EVP_MD
346 	 */
347 	int function(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx, const (void)* data, size_t count) update;
348 }
349 
350 /* values for EVP_MD_CTX flags */
351 
352 /**
353  * digest update will be called
354  * once only
355  */
356 enum EVP_MD_CTX_FLAG_ONESHOT = 0x0001;
357 
358 /**
359  * context has already been
360  * cleaned
361  */
362 enum EVP_MD_CTX_FLAG_CLEANED = 0x0002;
363 
364 /**
365  * Don't free up ctx.md_data
366  * in EVP_MD_CTX_cleanup
367  */
368 enum EVP_MD_CTX_FLAG_REUSE = 0x0004;
369 
370 /*
371  * FIPS and pad options are ignored in 1.0.0, definitions are here
372  * so we don't accidentally reuse the values for other purposes.
373  */
374 
375 /**
376  * Allow use of non FIPS digest
377  * in FIPS mode
378  */
379 enum EVP_MD_CTX_FLAG_NON_FIPS_ALLOW = 0x0008;
380 
381 /*
382  * The following PAD options are also currently ignored in 1.0.0, digest
383  * parameters are handled through EVP_DigestSign*() and EVP_DigestVerify*()
384  * instead.
385  */
386 
387 /**
388  * RSA mode to use
389  */
390 enum EVP_MD_CTX_FLAG_PAD_MASK = 0xF0;
391 
392 /**
393  * PKCS#1 v1.5 mode
394  */
395 enum EVP_MD_CTX_FLAG_PAD_PKCS1 = 0x00;
396 
397 /**
398  * X9.31 mode
399  */
400 enum EVP_MD_CTX_FLAG_PAD_X931 = 0x10;
401 
402 /**
403  * PSS mode
404  */
405 enum EVP_MD_CTX_FLAG_PAD_PSS = 0x20;
406 
407 /**
408  * Don't initialize md_data
409  */
410 enum EVP_MD_CTX_FLAG_NO_INIT = 0x0100;
411 
412 struct evp_cipher_st
413 {
414 	int nid;
415 	int block_size;
416 
417 	/**
418 	 * Default value for variable length ciphers
419 	 */
420 	int key_len;
421 
422 	int iv_len;
423 
424 	/**
425 	 * Various flags
426 	 */
427 	core.stdc.config.c_ulong flags;
428 
429 	/**
430 	 * init key
431 	 */
432 	int function(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, const (ubyte)* key, const (ubyte)* iv, int enc) init;
433 
434 	/**
435 	 * encrypt/decrypt data
436 	 */
437 	int function(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, ubyte* out_, const (ubyte)* in_, size_t inl) do_cipher;
438 
439 	/**
440 	 * cleanup ctx
441 	 */
442 	int function(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX*) cleanup;
443 
444 	/**
445 	 * how big ctx.cipher_data needs to be
446 	 */
447 	int ctx_size;
448 
449 	/**
450 	 * Populate a ASN1_TYPE with parameters
451 	 */
452 	int function(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX*, libressl_d.openssl.asn1.ASN1_TYPE*) set_asn1_parameters;
453 
454 	/**
455 	 * Get parameters from a ASN1_TYPE
456 	 */
457 	int function(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX*, libressl_d.openssl.asn1.ASN1_TYPE*) get_asn1_parameters;
458 
459 	/**
460 	 * Miscellaneous operations
461 	 */
462 	int function(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX*, int type, int arg, void* ptr_) ctrl;
463 
464 	/**
465 	 * Application data
466 	 */
467 	void* app_data;
468 }
469 
470 /* Values for cipher flags */
471 
472 /* Modes for ciphers */
473 
474 enum EVP_CIPH_STREAM_CIPHER = 0x00;
475 enum EVP_CIPH_ECB_MODE = 0x01;
476 enum EVP_CIPH_CBC_MODE = 0x02;
477 enum EVP_CIPH_CFB_MODE = 0x03;
478 enum EVP_CIPH_OFB_MODE = 0x04;
479 enum EVP_CIPH_CTR_MODE = 0x05;
480 enum EVP_CIPH_GCM_MODE = 0x06;
481 enum EVP_CIPH_CCM_MODE = 0x07;
482 enum EVP_CIPH_XTS_MODE = 0x010001;
483 enum EVP_CIPH_WRAP_MODE = 0x010002;
484 enum EVP_CIPH_MODE = 0x0F0007;
485 
486 /**
487  * Set if variable length cipher
488  */
489 enum EVP_CIPH_VARIABLE_LENGTH = 0x08;
490 
491 /**
492  * Set if the iv handling should be done by the cipher itself
493  */
494 enum EVP_CIPH_CUSTOM_IV = 0x10;
495 
496 /**
497  * Set if the cipher's init() function should be called if key is null
498  */
499 enum EVP_CIPH_ALWAYS_CALL_INIT = 0x20;
500 
501 /**
502  * Call ctrl() to init cipher parameters
503  */
504 enum EVP_CIPH_CTRL_INIT = 0x40;
505 
506 /**
507  * Don't use standard key length function
508  */
509 enum EVP_CIPH_CUSTOM_KEY_LENGTH = 0x80;
510 
511 /**
512  * Don't use standard block padding
513  */
514 enum EVP_CIPH_NO_PADDING = 0x0100;
515 
516 /**
517  * cipher handles random key generation
518  */
519 enum EVP_CIPH_RAND_KEY = 0x0200;
520 
521 /**
522  * cipher has its own additional copying logic
523  */
524 enum EVP_CIPH_CUSTOM_COPY = 0x0400;
525 
526 /**
527  * Allow use default ASN1 get/set iv
528  */
529 enum EVP_CIPH_FLAG_DEFAULT_ASN1 = 0x1000;
530 
531 /**
532  * Buffer length in bits not bytes: CFB1 mode only
533  */
534 enum EVP_CIPH_FLAG_LENGTH_BITS = 0x2000;
535 
536 /**
537  * Note if suitable for use in FIPS mode
538  */
539 enum EVP_CIPH_FLAG_FIPS = 0x4000;
540 
541 /**
542  * Allow non FIPS cipher in FIPS mode
543  */
544 enum EVP_CIPH_FLAG_NON_FIPS_ALLOW = 0x8000;
545 
546 /*
547  * Cipher handles any and all padding logic as well
548  * as finalisation.
549  */
550 enum EVP_CIPH_FLAG_CUSTOM_CIPHER = 0x100000;
551 enum EVP_CIPH_FLAG_AEAD_CIPHER = 0x200000;
552 
553 /**
554  * Cipher context flag to indicate that we can handle wrap mode: if allowed in
555  * older applications, it could overflow buffers.
556  */
557 enum EVP_CIPHER_CTX_FLAG_WRAP_ALLOW = 0x01;
558 
559 /* ctrl() values */
560 
561 enum EVP_CTRL_INIT = 0x00;
562 enum EVP_CTRL_SET_KEY_LENGTH = 0x01;
563 enum EVP_CTRL_GET_RC2_KEY_BITS = 0x02;
564 enum EVP_CTRL_SET_RC2_KEY_BITS = 0x03;
565 enum EVP_CTRL_GET_RC5_ROUNDS = 0x04;
566 enum EVP_CTRL_SET_RC5_ROUNDS = 0x05;
567 enum EVP_CTRL_RAND_KEY = 0x06;
568 enum EVP_CTRL_PBE_PRF_NID = 0x07;
569 enum EVP_CTRL_COPY = 0x08;
570 enum EVP_CTRL_GCM_SET_IVLEN = 0x09;
571 enum EVP_CTRL_GCM_GET_TAG = 0x10;
572 enum EVP_CTRL_GCM_SET_TAG = 0x11;
573 enum EVP_CTRL_GCM_SET_IV_FIXED = 0x12;
574 enum EVP_CTRL_GCM_IV_GEN = 0x13;
575 enum EVP_CTRL_CCM_SET_IVLEN = .EVP_CTRL_GCM_SET_IVLEN;
576 enum EVP_CTRL_CCM_GET_TAG = .EVP_CTRL_GCM_GET_TAG;
577 enum EVP_CTRL_CCM_SET_TAG = .EVP_CTRL_GCM_SET_TAG;
578 enum EVP_CTRL_CCM_SET_L = 0x14;
579 enum EVP_CTRL_CCM_SET_MSGLEN = 0x15;
580 
581 /**
582  * AEAD cipher deduces payload length and returns number of bytes
583  * required to store MAC and eventual padding. Subsequent call to
584  * EVP_Cipher even appends/verifies MAC.
585  */
586 enum EVP_CTRL_AEAD_TLS1_AAD = 0x16;
587 
588 /**
589  * Used by composite AEAD ciphers, no-op in GCM, CCM...
590  */
591 enum EVP_CTRL_AEAD_SET_MAC_KEY = 0x17;
592 
593 /**
594  * Set the GCM invocation field, decrypt only
595  */
596 enum EVP_CTRL_GCM_SET_IV_INV = 0x18;
597 
598 /**
599  * Set the S-BOX NID for GOST ciphers
600  */
601 enum EVP_CTRL_GOST_SET_SBOX = 0x19;
602 
603 /* GCM TLS constants */
604 /**
605  * Length of fixed part of IV derived from PRF
606  */
607 enum EVP_GCM_TLS_FIXED_IV_LEN = 4;
608 
609 /**
610  * Length of explicit part of IV part of TLS records
611  */
612 enum EVP_GCM_TLS_EXPLICIT_IV_LEN = 8;
613 
614 /**
615  * Length of tag for TLS
616  */
617 enum EVP_GCM_TLS_TAG_LEN = 16;
618 
619 struct evp_cipher_info_st
620 {
621 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* cipher;
622 	ubyte[.EVP_MAX_IV_LENGTH] iv;
623 }
624 
625 alias EVP_CIPHER_INFO = .evp_cipher_info_st;
626 
627 struct evp_cipher_ctx_st
628 {
629 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* cipher;
630 
631 	/**
632 	 * functional reference if 'cipher' is ENGINE-provided
633 	 */
634 	libressl_d.openssl.ossl_typ.ENGINE* engine;
635 
636 	/**
637 	 * encrypt or decrypt
638 	 */
639 	int encrypt;
640 
641 	/**
642 	 * number we have left
643 	 */
644 	int buf_len;
645 
646 	/**
647 	 * original iv
648 	 */
649 	ubyte[.EVP_MAX_IV_LENGTH] oiv;
650 
651 	/**
652 	 * working iv
653 	 */
654 	ubyte[.EVP_MAX_IV_LENGTH] iv;
655 
656 	/**
657 	 * saved partial block
658 	 */
659 	ubyte[.EVP_MAX_BLOCK_LENGTH] buf;
660 
661 	/**
662 	 * used by cfb/ofb/ctr mode
663 	 */
664 	int num;
665 
666 	/**
667 	 * application stuff
668 	 */
669 	void* app_data;
670 
671 	/**
672 	 * May change for variable length cipher
673 	 */
674 	int key_len;
675 
676 	/**
677 	 * Various flags
678 	 */
679 	core.stdc.config.c_ulong flags;
680 
681 	/**
682 	 * per EVP data
683 	 */
684 	void* cipher_data;
685 
686 	int final_used;
687 	int block_mask;
688 
689 	/**
690 	 * possible final block
691 	 */
692 	ubyte[.EVP_MAX_BLOCK_LENGTH] final_;
693 }
694 
695 struct evp_Encode_Ctx_st
696 {
697 	/**
698 	 * number saved in a partial encode/decode
699 	 */
700 	int num;
701 
702 	/**
703 	 * The length is either the output line length
704 	 * (in input bytes) or the shortest input line
705 	 * length that is ok.  Once decoding begins,
706 	 * the length is adjusted up each time a longer
707 	 * line is decoded
708 	 */
709 	int length_;
710 
711 	/**
712 	 * data to encode
713 	 */
714 	ubyte[80] enc_data;
715 
716 	/**
717 	 * number read on current line
718 	 */
719 	int line_num;
720 
721 	int expect_nl;
722 }
723 
724 alias EVP_ENCODE_CTX = .evp_Encode_Ctx_st;
725 
726 /**
727  * Password based encryption function
728  */
729 alias EVP_PBE_KEYGEN = extern (C) nothrow @nogc int function(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, const (char)* pass, int passlen, libressl_d.openssl.asn1.ASN1_TYPE* param, const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* cipher, const (libressl_d.openssl.ossl_typ.EVP_MD)* md, int en_de);
730 
731 version (OPENSSL_NO_RSA) {
732 } else {
733 	pragma(inline, true)
734 	int EVP_PKEY_assign_RSA(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey, char* rsa)
735 
736 		do
737 		{
738 			return .EVP_PKEY_assign(pkey, .EVP_PKEY_RSA, rsa);
739 		}
740 }
741 
742 version (OPENSSL_NO_DSA) {
743 } else {
744 	pragma(inline, true)
745 	int EVP_PKEY_assign_DSA(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey, char* dsa)
746 
747 		do
748 		{
749 			return .EVP_PKEY_assign(pkey, .EVP_PKEY_DSA, dsa);
750 		}
751 }
752 
753 version (OPENSSL_NO_DH) {
754 } else {
755 	pragma(inline, true)
756 	int EVP_PKEY_assign_DH(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey, char* dh)
757 
758 		do
759 		{
760 			return .EVP_PKEY_assign(pkey, .EVP_PKEY_DH, dh);
761 		}
762 }
763 
764 version (OPENSSL_NO_EC) {
765 } else {
766 	pragma(inline, true)
767 	int EVP_PKEY_assign_EC_KEY(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey, char* eckey)
768 
769 		do
770 		{
771 			return .EVP_PKEY_assign(pkey, .EVP_PKEY_EC, eckey);
772 		}
773 }
774 
775 version (OPENSSL_NO_GOST) {
776 } else {
777 	pragma(inline, true)
778 	int EVP_PKEY_assign_GOST(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey, char* gostkey)
779 
780 		do
781 		{
782 			return .EVP_PKEY_assign(pkey, .EVP_PKEY_GOSTR01, gostkey);
783 		}
784 }
785 
786 /* Add some extra combinations */
787 pragma(inline, true)
788 const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_get_digestbynid(int a)
789 
790 	do
791 	{
792 		return .EVP_get_digestbyname(libressl_d.openssl.objects.OBJ_nid2sn(a));
793 	}
794 
795 pragma(inline, true)
796 const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_get_digestbyobj(const (libressl_d.openssl.asn1.ASN1_OBJECT)* a)
797 
798 	do
799 	{
800 		return .EVP_get_digestbynid(libressl_d.openssl.objects.OBJ_obj2nid(a));
801 	}
802 
803 pragma(inline, true)
804 const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_get_cipherbynid(int a)
805 
806 	do
807 	{
808 		return .EVP_get_cipherbyname(libressl_d.openssl.objects.OBJ_nid2sn(a));
809 	}
810 
811 pragma(inline, true)
812 const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_get_cipherbyobj(const (libressl_d.openssl.asn1.ASN1_OBJECT)* a)
813 
814 	do
815 	{
816 		return EVP_get_cipherbynid(libressl_d.openssl.objects.OBJ_obj2nid(a));
817 	}
818 
819 int EVP_MD_type(const (libressl_d.openssl.ossl_typ.EVP_MD)* md);
820 
821 pragma(inline, true)
822 int EVP_MD_nid(const (libressl_d.openssl.ossl_typ.EVP_MD)* e)
823 
824 	do
825 	{
826 		return .EVP_MD_type(e);
827 	}
828 
829 pragma(inline, true)
830 const (char)* EVP_MD_name(const (libressl_d.openssl.ossl_typ.EVP_MD)* e)
831 
832 	do
833 	{
834 		return libressl_d.openssl.objects.OBJ_nid2sn(.EVP_MD_nid(e));
835 	}
836 
837 int EVP_MD_pkey_type(const (libressl_d.openssl.ossl_typ.EVP_MD)* md);
838 int EVP_MD_size(const (libressl_d.openssl.ossl_typ.EVP_MD)* md);
839 int EVP_MD_block_size(const (libressl_d.openssl.ossl_typ.EVP_MD)* md);
840 core.stdc.config.c_ulong EVP_MD_flags(const (libressl_d.openssl.ossl_typ.EVP_MD)* md);
841 
842 const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_MD_CTX_md(const (libressl_d.openssl.ossl_typ.EVP_MD_CTX)* ctx);
843 
844 pragma(inline, true)
845 int EVP_MD_CTX_size(const (libressl_d.openssl.ossl_typ.EVP_MD_CTX)* e)
846 
847 	do
848 	{
849 		return .EVP_MD_size(.EVP_MD_CTX_md(e));
850 	}
851 
852 pragma(inline, true)
853 int EVP_MD_CTX_block_size(const (libressl_d.openssl.ossl_typ.EVP_MD_CTX)* e)
854 
855 	do
856 	{
857 		return .EVP_MD_block_size(.EVP_MD_CTX_md(e));
858 	}
859 
860 pragma(inline, true)
861 int EVP_MD_CTX_type(const (libressl_d.openssl.ossl_typ.EVP_MD_CTX)* e)
862 
863 	do
864 	{
865 		return .EVP_MD_type(.EVP_MD_CTX_md(e));
866 	}
867 
868 int EVP_CIPHER_nid(const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* cipher);
869 
870 pragma(inline, true)
871 const (char)* EVP_CIPHER_name(const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* e)
872 
873 	do
874 	{
875 		return libressl_d.openssl.objects.OBJ_nid2sn(.EVP_CIPHER_nid(e));
876 	}
877 
878 int EVP_CIPHER_block_size(const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* cipher);
879 int EVP_CIPHER_key_length(const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* cipher);
880 int EVP_CIPHER_iv_length(const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* cipher);
881 core.stdc.config.c_ulong EVP_CIPHER_flags(const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* cipher);
882 
883 pragma(inline, true)
884 core.stdc.config.c_ulong EVP_CIPHER_mode(const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* e)
885 
886 	do
887 	{
888 		return .EVP_CIPHER_flags(e) & .EVP_CIPH_MODE;
889 	}
890 
891 const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_CIPHER_CTX_cipher(const (libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX)* ctx);
892 int EVP_CIPHER_CTX_encrypting(const (libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX)* ctx);
893 int EVP_CIPHER_CTX_nid(const (libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX)* ctx);
894 int EVP_CIPHER_CTX_block_size(const (libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX)* ctx);
895 int EVP_CIPHER_CTX_key_length(const (libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX)* ctx);
896 int EVP_CIPHER_CTX_iv_length(const (libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX)* ctx);
897 int EVP_CIPHER_CTX_get_iv(const (libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX)* ctx, ubyte* iv, size_t len);
898 int EVP_CIPHER_CTX_set_iv(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, const (ubyte)* iv, size_t len);
899 int EVP_CIPHER_CTX_copy(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* out_, const (libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX)* in_);
900 void* EVP_CIPHER_CTX_get_app_data(const (libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX)* ctx);
901 void EVP_CIPHER_CTX_set_app_data(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, void* data);
902 
903 pragma(inline, true)
904 int EVP_CIPHER_CTX_type(const (libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX)* c)
905 
906 	do
907 	{
908 		return .EVP_CIPHER_type(.EVP_CIPHER_CTX_cipher(c));
909 	}
910 
911 core.stdc.config.c_ulong EVP_CIPHER_CTX_flags(const (libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX)* ctx);
912 
913 pragma(inline, true)
914 core.stdc.config.c_ulong EVP_CIPHER_CTX_mode(const (libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX)* e)
915 
916 	do
917 	{
918 		return .EVP_CIPHER_CTX_flags(e) & .EVP_CIPH_MODE;
919 	}
920 
921 pragma(inline, true)
922 pure nothrow @safe @nogc @live
923 auto EVP_ENCODE_LENGTH(L)(L l)
924 
925 	do
926 	{
927 		return ((l + 2) / 3 * 4) + (((l / 48) + 1) * 2) + 80;
928 	}
929 
930 pragma(inline, true)
931 pure nothrow @safe @nogc @live
932 auto EVP_DECODE_LENGTH(L)(L l)
933 
934 	do
935 	{
936 		return ((l + 3) / 4 * 3) + 80;
937 	}
938 
939 alias EVP_SignInit_ex = .EVP_DigestInit_ex;
940 alias EVP_SignInit = .EVP_DigestInit;
941 alias EVP_SignUpdate = .EVP_DigestUpdate;
942 alias EVP_VerifyInit_ex = .EVP_DigestInit_ex;
943 alias EVP_VerifyInit = .EVP_DigestInit;
944 alias EVP_VerifyUpdate = .EVP_DigestUpdate;
945 alias EVP_OpenUpdate = .EVP_DecryptUpdate;
946 alias EVP_SealUpdate = .EVP_EncryptUpdate;
947 alias EVP_DigestSignUpdate = .EVP_DigestUpdate;
948 alias EVP_DigestVerifyUpdate = .EVP_DigestUpdate;
949 
950 pragma(inline, true)
951 core.stdc.config.c_long BIO_set_md(libressl_d.openssl.bio.BIO* b, char* md)
952 
953 	do
954 	{
955 		return libressl_d.openssl.bio.BIO_ctrl(b, libressl_d.openssl.bio.BIO_C_SET_MD, 0, md);
956 	}
957 
958 pragma(inline, true)
959 core.stdc.config.c_long BIO_get_md(libressl_d.openssl.bio.BIO* b, char* mdp)
960 
961 	do
962 	{
963 		return libressl_d.openssl.bio.BIO_ctrl(b, libressl_d.openssl.bio.BIO_C_GET_MD, 0, mdp);
964 	}
965 
966 pragma(inline, true)
967 core.stdc.config.c_long BIO_get_md_ctx(libressl_d.openssl.bio.BIO* b, char* mdcp)
968 
969 	do
970 	{
971 		return libressl_d.openssl.bio.BIO_ctrl(b, libressl_d.openssl.bio.BIO_C_GET_MD_CTX, 0, mdcp);
972 	}
973 
974 pragma(inline, true)
975 core.stdc.config.c_long BIO_set_md_ctx(libressl_d.openssl.bio.BIO* b, char* mdcp)
976 
977 	do
978 	{
979 		return libressl_d.openssl.bio.BIO_ctrl(b, libressl_d.openssl.bio.BIO_C_SET_MD_CTX, 0, mdcp);
980 	}
981 
982 pragma(inline, true)
983 core.stdc.config.c_long BIO_get_cipher_status(libressl_d.openssl.bio.BIO* b)
984 
985 	do
986 	{
987 		return libressl_d.openssl.bio.BIO_ctrl(b, libressl_d.openssl.bio.BIO_C_GET_CIPHER_STATUS, 0, null);
988 	}
989 
990 pragma(inline, true)
991 core.stdc.config.c_long BIO_get_cipher_ctx(libressl_d.openssl.bio.BIO* b, char* c_pp)
992 
993 	do
994 	{
995 		return libressl_d.openssl.bio.BIO_ctrl(b, libressl_d.openssl.bio.BIO_C_GET_CIPHER_CTX, 0, c_pp);
996 	}
997 
998 int EVP_Cipher(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* c, ubyte* out_, const (ubyte)* in_, uint inl);
999 
1000 //#define EVP_add_cipher_alias(n, alias) libressl_d.openssl.objects.OBJ_NAME_add(alias, libressl_d.openssl.objects.OBJ_NAME_TYPE_CIPHER_METH | libressl_d.openssl.objects.OBJ_NAME_ALIAS, n)
1001 //#define EVP_add_digest_alias(n, alias) libressl_d.openssl.objects.OBJ_NAME_add(alias, libressl_d.openssl.objects.OBJ_NAME_TYPE_MD_METH | libressl_d.openssl.objects.OBJ_NAME_ALIAS, n)
1002 //#define EVP_delete_cipher_alias(alias) libressl_d.openssl.objects.OBJ_NAME_remove(alias, libressl_d.openssl.objects.OBJ_NAME_TYPE_CIPHER_METH | libressl_d.openssl.objects.OBJ_NAME_ALIAS);
1003 //#define EVP_delete_digest_alias(alias) libressl_d.openssl.objects.OBJ_NAME_remove(alias, libressl_d.openssl.objects.OBJ_NAME_TYPE_MD_METH | libressl_d.openssl.objects.OBJ_NAME_ALIAS);
1004 
1005 libressl_d.openssl.ossl_typ.EVP_MD_CTX* EVP_MD_CTX_new();
1006 void EVP_MD_CTX_free(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx);
1007 void EVP_MD_CTX_init(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx);
1008 int EVP_MD_CTX_reset(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx);
1009 libressl_d.openssl.ossl_typ.EVP_MD_CTX* EVP_MD_CTX_create();
1010 void EVP_MD_CTX_destroy(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx);
1011 int EVP_MD_CTX_cleanup(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx);
1012 int EVP_MD_CTX_copy_ex(libressl_d.openssl.ossl_typ.EVP_MD_CTX* out_, const (libressl_d.openssl.ossl_typ.EVP_MD_CTX)* in_);
1013 void EVP_MD_CTX_set_flags(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx, int flags);
1014 void EVP_MD_CTX_clear_flags(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx, int flags);
1015 int EVP_MD_CTX_ctrl(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx, int type, int arg, void* ptr_);
1016 int EVP_MD_CTX_test_flags(const (libressl_d.openssl.ossl_typ.EVP_MD_CTX)* ctx, int flags);
1017 
1018 int EVP_DigestInit_ex(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx, const (libressl_d.openssl.ossl_typ.EVP_MD)* type, libressl_d.openssl.ossl_typ.ENGINE* impl);
1019 int EVP_DigestUpdate(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx, const (void)* d, size_t cnt);
1020 int EVP_DigestFinal_ex(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx, ubyte* md, uint* s);
1021 int EVP_Digest(const (void)* data, size_t count, ubyte* md, uint* size, const (libressl_d.openssl.ossl_typ.EVP_MD)* type, libressl_d.openssl.ossl_typ.ENGINE* impl);
1022 
1023 int EVP_MD_CTX_copy(libressl_d.openssl.ossl_typ.EVP_MD_CTX* out_, const (libressl_d.openssl.ossl_typ.EVP_MD_CTX)* in_);
1024 int EVP_DigestInit(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx, const (libressl_d.openssl.ossl_typ.EVP_MD)* type);
1025 int EVP_DigestFinal(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx, ubyte* md, uint* s);
1026 
1027 int EVP_read_pw_string(char* buf, int length, const (char)* prompt, int verify);
1028 int EVP_read_pw_string_min(char* buf, int minlen, int maxlen, const (char)* prompt, int verify);
1029 void EVP_set_pw_prompt(const (char)* prompt);
1030 char* EVP_get_pw_prompt();
1031 
1032 int EVP_BytesToKey(const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* type, const (libressl_d.openssl.ossl_typ.EVP_MD)* md, const (ubyte)* salt, const (ubyte)* data, int datal, int count, ubyte* key, ubyte* iv);
1033 
1034 void EVP_CIPHER_CTX_set_flags(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, int flags);
1035 void EVP_CIPHER_CTX_clear_flags(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, int flags);
1036 int EVP_CIPHER_CTX_test_flags(const (libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX)* ctx, int flags);
1037 
1038 int EVP_EncryptInit(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* cipher, const (ubyte)* key, const (ubyte)* iv);
1039 int EVP_EncryptInit_ex(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* cipher, libressl_d.openssl.ossl_typ.ENGINE* impl, const (ubyte)* key, const (ubyte)* iv);
1040 int EVP_EncryptUpdate(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, ubyte* out_, int* outl, const (ubyte)* in_, int inl);
1041 int EVP_EncryptFinal_ex(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, ubyte* out_, int* outl);
1042 
1043 version (LIBRESSL_INTERNAL) {
1044 } else {
1045 	int EVP_EncryptFinal(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, ubyte* out_, int* outl);
1046 }
1047 
1048 int EVP_DecryptInit(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* cipher, const (ubyte)* key, const (ubyte)* iv);
1049 int EVP_DecryptInit_ex(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* cipher, libressl_d.openssl.ossl_typ.ENGINE* impl, const (ubyte)* key, const (ubyte)* iv);
1050 int EVP_DecryptUpdate(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, ubyte* out_, int* outl, const (ubyte)* in_, int inl);
1051 int EVP_DecryptFinal_ex(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, ubyte* outm, int* outl);
1052 
1053 version (LIBRESSL_INTERNAL) {
1054 } else {
1055 	int EVP_DecryptFinal(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, ubyte* outm, int* outl);
1056 }
1057 
1058 int EVP_CipherInit(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* cipher, const (ubyte)* key, const (ubyte)* iv, int enc);
1059 int EVP_CipherInit_ex(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* cipher, libressl_d.openssl.ossl_typ.ENGINE* impl, const (ubyte)* key, const (ubyte)* iv, int enc);
1060 int EVP_CipherUpdate(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, ubyte* out_, int* outl, const (ubyte)* in_, int inl);
1061 int EVP_CipherFinal_ex(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, ubyte* outm, int* outl);
1062 
1063 version (LIBRESSL_INTERNAL) {
1064 } else {
1065 	int EVP_CipherFinal(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, ubyte* outm, int* outl);
1066 }
1067 
1068 int EVP_SignFinal(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx, ubyte* md, uint* s, libressl_d.openssl.ossl_typ.EVP_PKEY* pkey);
1069 
1070 int EVP_VerifyFinal(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx, const (ubyte)* sigbuf, uint siglen, libressl_d.openssl.ossl_typ.EVP_PKEY* pkey);
1071 
1072 int EVP_DigestSignInit(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx, libressl_d.openssl.ossl_typ.EVP_PKEY_CTX** pctx, const (libressl_d.openssl.ossl_typ.EVP_MD)* type, libressl_d.openssl.ossl_typ.ENGINE* e, libressl_d.openssl.ossl_typ.EVP_PKEY* pkey);
1073 int EVP_DigestSignFinal(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx, ubyte* sigret, size_t* siglen);
1074 
1075 int EVP_DigestSign(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx, ubyte* sigret, size_t* siglen, const (ubyte)* tbs, size_t tbslen);
1076 
1077 int EVP_DigestVerifyInit(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx, libressl_d.openssl.ossl_typ.EVP_PKEY_CTX** pctx, const (libressl_d.openssl.ossl_typ.EVP_MD)* type, libressl_d.openssl.ossl_typ.ENGINE* e, libressl_d.openssl.ossl_typ.EVP_PKEY* pkey);
1078 int EVP_DigestVerifyFinal(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx, const (ubyte)* sig, size_t siglen);
1079 
1080 int EVP_DigestVerify(libressl_d.openssl.ossl_typ.EVP_MD_CTX* ctx, const (ubyte)* sigret, size_t siglen, const (ubyte)* tbs, size_t tbslen);
1081 
1082 int EVP_OpenInit(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* type, const (ubyte)* ek, int ekl, const (ubyte)* iv, libressl_d.openssl.ossl_typ.EVP_PKEY* priv);
1083 int EVP_OpenFinal(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, ubyte* out_, int* outl);
1084 
1085 int EVP_SealInit(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* type, ubyte** ek, int* ekl, ubyte* iv, libressl_d.openssl.ossl_typ.EVP_PKEY** pubk, int npubk);
1086 int EVP_SealFinal(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, ubyte* out_, int* outl);
1087 
1088 .EVP_ENCODE_CTX* EVP_ENCODE_CTX_new();
1089 void EVP_ENCODE_CTX_free(.EVP_ENCODE_CTX* ctx);
1090 void EVP_EncodeInit(.EVP_ENCODE_CTX* ctx);
1091 int EVP_EncodeUpdate(.EVP_ENCODE_CTX* ctx, ubyte* out_, int* outl, const (ubyte)* in_, int inl);
1092 void EVP_EncodeFinal(.EVP_ENCODE_CTX* ctx, ubyte* out_, int* outl);
1093 int EVP_EncodeBlock(ubyte* t, const (ubyte)* f, int n);
1094 
1095 void EVP_DecodeInit(.EVP_ENCODE_CTX* ctx);
1096 int EVP_DecodeUpdate(.EVP_ENCODE_CTX* ctx, ubyte* out_, int* outl, const (ubyte)* in_, int inl);
1097 int EVP_DecodeFinal(.EVP_ENCODE_CTX* ctx, ubyte* out_, int* outl);
1098 int EVP_DecodeBlock(ubyte* t, const (ubyte)* f, int n);
1099 
1100 void EVP_CIPHER_CTX_init(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* a);
1101 int EVP_CIPHER_CTX_cleanup(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* a);
1102 libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* EVP_CIPHER_CTX_new();
1103 void EVP_CIPHER_CTX_free(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* a);
1104 int EVP_CIPHER_CTX_reset(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* a);
1105 int EVP_CIPHER_CTX_set_key_length(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* x, int keylen);
1106 int EVP_CIPHER_CTX_set_padding(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* c, int pad);
1107 int EVP_CIPHER_CTX_ctrl(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, int type, int arg, void* ptr_);
1108 int EVP_CIPHER_CTX_rand_key(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, ubyte* key);
1109 
1110 version (OPENSSL_NO_BIO) {
1111 } else {
1112 	const (libressl_d.openssl.bio.BIO_METHOD)* BIO_f_md();
1113 	const (libressl_d.openssl.bio.BIO_METHOD)* BIO_f_base64();
1114 	const (libressl_d.openssl.bio.BIO_METHOD)* BIO_f_cipher();
1115 	int BIO_set_cipher(libressl_d.openssl.bio.BIO* b, const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* c, const (ubyte)* k, const (ubyte)* i, int enc);
1116 }
1117 
1118 const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_md_null();
1119 
1120 version (OPENSSL_NO_MD4) {
1121 } else {
1122 	const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_md4();
1123 }
1124 
1125 version (OPENSSL_NO_MD5) {
1126 } else {
1127 	const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_md5();
1128 	const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_md5_sha1();
1129 }
1130 
1131 version (OPENSSL_NO_SHA) {
1132 } else {
1133 	const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_sha1();
1134 	const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_dss();
1135 	const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_dss1();
1136 	const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_ecdsa();
1137 }
1138 
1139 version (OPENSSL_NO_SHA256) {
1140 } else {
1141 	const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_sha224();
1142 	const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_sha256();
1143 }
1144 
1145 version (OPENSSL_NO_SHA512) {
1146 } else {
1147 	const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_sha384();
1148 	const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_sha512();
1149 }
1150 
1151 version (OPENSSL_NO_SM3) {
1152 } else {
1153 	const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_sm3();
1154 }
1155 
1156 version (OPENSSL_NO_RIPEMD) {
1157 } else {
1158 	const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_ripemd160();
1159 }
1160 
1161 version (OPENSSL_NO_WHIRLPOOL) {
1162 } else {
1163 	const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_whirlpool();
1164 }
1165 
1166 version (OPENSSL_NO_GOST) {
1167 } else {
1168 	const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_gostr341194();
1169 	const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_gost2814789imit();
1170 	const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_streebog256();
1171 	const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_streebog512();
1172 }
1173 
1174 /**
1175  * does nothing :-\)
1176  */
1177 const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_enc_null();
1178 
1179 version (OPENSSL_NO_DES) {
1180 } else {
1181 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_des_ecb();
1182 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_des_ede();
1183 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_des_ede3();
1184 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_des_ede_ecb();
1185 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_des_ede3_ecb();
1186 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_des_cfb64();
1187 	alias EVP_des_cfb = .EVP_des_cfb64;
1188 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_des_cfb1();
1189 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_des_cfb8();
1190 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_des_ede_cfb64();
1191 	alias EVP_des_ede_cfb = .EVP_des_ede_cfb64;
1192 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_des_ede3_cfb64();
1193 	alias EVP_des_ede3_cfb = .EVP_des_ede3_cfb64;
1194 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_des_ede3_cfb1();
1195 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_des_ede3_cfb8();
1196 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_des_ofb();
1197 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_des_ede_ofb();
1198 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_des_ede3_ofb();
1199 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_des_cbc();
1200 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_des_ede_cbc();
1201 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_des_ede3_cbc();
1202 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_desx_cbc();
1203 }
1204 
1205 version (OPENSSL_NO_RC4) {
1206 } else {
1207 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_rc4();
1208 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_rc4_40();
1209 
1210 	version (OPENSSL_NO_MD5) {
1211 	} else {
1212 		const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_rc4_hmac_md5();
1213 	}
1214 }
1215 
1216 version (OPENSSL_NO_IDEA) {
1217 } else {
1218 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_idea_ecb();
1219 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_idea_cfb64();
1220 	alias EVP_idea_cfb = .EVP_idea_cfb64;
1221 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_idea_ofb();
1222 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_idea_cbc();
1223 }
1224 
1225 version (OPENSSL_NO_RC2) {
1226 } else {
1227 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_rc2_ecb();
1228 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_rc2_cbc();
1229 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_rc2_40_cbc();
1230 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_rc2_64_cbc();
1231 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_rc2_cfb64();
1232 	alias EVP_rc2_cfb = .EVP_rc2_cfb64;
1233 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_rc2_ofb();
1234 }
1235 
1236 version (OPENSSL_NO_BF) {
1237 } else {
1238 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_bf_ecb();
1239 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_bf_cbc();
1240 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_bf_cfb64();
1241 	alias EVP_bf_cfb = .EVP_bf_cfb64;
1242 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_bf_ofb();
1243 }
1244 
1245 version (OPENSSL_NO_CAST) {
1246 } else {
1247 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_cast5_ecb();
1248 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_cast5_cbc();
1249 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_cast5_cfb64();
1250 	alias EVP_cast5_cfb = .EVP_cast5_cfb64;
1251 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_cast5_ofb();
1252 }
1253 
1254 version (OPENSSL_NO_AES) {
1255 } else {
1256 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_128_ecb();
1257 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_128_cbc();
1258 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_128_cfb1();
1259 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_128_cfb8();
1260 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_128_cfb128();
1261 	alias EVP_aes_128_cfb = .EVP_aes_128_cfb128;
1262 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_128_ofb();
1263 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_128_ctr();
1264 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_128_ccm();
1265 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_128_gcm();
1266 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_128_wrap();
1267 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_128_xts();
1268 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_192_ecb();
1269 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_192_cbc();
1270 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_192_cfb1();
1271 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_192_cfb8();
1272 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_192_cfb128();
1273 	alias EVP_aes_192_cfb = .EVP_aes_192_cfb128;
1274 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_192_ofb();
1275 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_192_ctr();
1276 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_192_ccm();
1277 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_192_gcm();
1278 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_192_wrap();
1279 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_256_ecb();
1280 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_256_cbc();
1281 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_256_cfb1();
1282 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_256_cfb8();
1283 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_256_cfb128();
1284 	alias EVP_aes_256_cfb = .EVP_aes_256_cfb128;
1285 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_256_ofb();
1286 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_256_ctr();
1287 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_256_ccm();
1288 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_256_gcm();
1289 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_256_wrap();
1290 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_256_xts();
1291 
1292 	version (OPENSSL_NO_SHA) {
1293 	} else {
1294 		version (OPENSSL_NO_SHA1) {
1295 		} else {
1296 			const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_128_cbc_hmac_sha1();
1297 			const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_aes_256_cbc_hmac_sha1();
1298 		}
1299 	}
1300 }
1301 
1302 version (OPENSSL_NO_CAMELLIA) {
1303 } else {
1304 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_camellia_128_ecb();
1305 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_camellia_128_cbc();
1306 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_camellia_128_cfb1();
1307 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_camellia_128_cfb8();
1308 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_camellia_128_cfb128();
1309 	alias EVP_camellia_128_cfb = .EVP_camellia_128_cfb128;
1310 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_camellia_128_ofb();
1311 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_camellia_192_ecb();
1312 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_camellia_192_cbc();
1313 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_camellia_192_cfb1();
1314 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_camellia_192_cfb8();
1315 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_camellia_192_cfb128();
1316 	alias EVP_camellia_192_cfb = .EVP_camellia_192_cfb128;
1317 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_camellia_192_ofb();
1318 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_camellia_256_ecb();
1319 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_camellia_256_cbc();
1320 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_camellia_256_cfb1();
1321 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_camellia_256_cfb8();
1322 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_camellia_256_cfb128();
1323 	alias EVP_camellia_256_cfb = .EVP_camellia_256_cfb128;
1324 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_camellia_256_ofb();
1325 }
1326 
1327 version (OPENSSL_NO_CHACHA) {
1328 } else {
1329 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_chacha20();
1330 }
1331 
1332 version (OPENSSL_NO_GOST) {
1333 } else {
1334 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_gost2814789_ecb();
1335 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_gost2814789_cfb64();
1336 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_gost2814789_cnt();
1337 }
1338 
1339 version (OPENSSL_NO_SM4) {
1340 } else {
1341 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_sm4_ecb();
1342 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_sm4_cbc();
1343 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_sm4_cfb128();
1344 	alias EVP_sm4_cfb = .EVP_sm4_cfb128;
1345 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_sm4_ofb();
1346 	const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_sm4_ctr();
1347 }
1348 
1349 void OPENSSL_add_all_algorithms_noconf();
1350 void OPENSSL_add_all_algorithms_conf();
1351 
1352 version (OPENSSL_LOAD_CONF) {
1353 	alias OpenSSL_add_all_algorithms = .OPENSSL_add_all_algorithms_conf;
1354 } else {
1355 	alias OpenSSL_add_all_algorithms = .OPENSSL_add_all_algorithms_noconf;
1356 }
1357 
1358 void OpenSSL_add_all_ciphers();
1359 void OpenSSL_add_all_digests();
1360 
1361 alias SSLeay_add_all_algorithms = .OpenSSL_add_all_algorithms;
1362 alias SSLeay_add_all_ciphers = .OpenSSL_add_all_ciphers;
1363 alias SSLeay_add_all_digests = .OpenSSL_add_all_digests;
1364 
1365 int EVP_add_cipher(const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* cipher);
1366 int EVP_add_digest(const (libressl_d.openssl.ossl_typ.EVP_MD)* digest);
1367 
1368 const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* EVP_get_cipherbyname(const (char)* name);
1369 const (libressl_d.openssl.ossl_typ.EVP_MD)* EVP_get_digestbyname(const (char)* name);
1370 void EVP_cleanup();
1371 
1372 void EVP_CIPHER_do_all(void function(const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* ciph, const (char)* from, const (char)* to, void* x) fn, void* arg);
1373 void EVP_CIPHER_do_all_sorted(void function(const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* ciph, const (char)* from, const (char)* to, void* x) fn, void* arg);
1374 
1375 void EVP_MD_do_all(void function(const (libressl_d.openssl.ossl_typ.EVP_MD)* ciph, const (char)* from, const (char)* to, void* x) fn, void* arg);
1376 void EVP_MD_do_all_sorted(void function(const (libressl_d.openssl.ossl_typ.EVP_MD)* ciph, const (char)* from, const (char)* to, void* x) fn, void* arg);
1377 
1378 int EVP_PKEY_decrypt_old(ubyte* dec_key, const (ubyte)* enc_key, int enc_key_len, libressl_d.openssl.ossl_typ.EVP_PKEY* private_key);
1379 int EVP_PKEY_encrypt_old(ubyte* enc_key, const (ubyte)* key, int key_len, libressl_d.openssl.ossl_typ.EVP_PKEY* pub_key);
1380 int EVP_PKEY_type(int type);
1381 int EVP_PKEY_id(const (libressl_d.openssl.ossl_typ.EVP_PKEY)* pkey);
1382 int EVP_PKEY_base_id(const (libressl_d.openssl.ossl_typ.EVP_PKEY)* pkey);
1383 int EVP_PKEY_bits(const (libressl_d.openssl.ossl_typ.EVP_PKEY)* pkey);
1384 int EVP_PKEY_size(const (libressl_d.openssl.ossl_typ.EVP_PKEY)* pkey);
1385 int EVP_PKEY_set_type(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey, int type);
1386 int EVP_PKEY_set_type_str(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey, const (char)* str, int len);
1387 int EVP_PKEY_assign(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey, int type, void* key);
1388 void* EVP_PKEY_get0(const (libressl_d.openssl.ossl_typ.EVP_PKEY)* pkey);
1389 const (ubyte)* EVP_PKEY_get0_hmac(const (libressl_d.openssl.ossl_typ.EVP_PKEY)* pkey, size_t* len);
1390 
1391 version (OPENSSL_NO_RSA) {
1392 } else {
1393 	libressl_d.openssl.rsa.rsa_st* EVP_PKEY_get0_RSA(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey);
1394 	libressl_d.openssl.rsa.rsa_st* EVP_PKEY_get1_RSA(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey);
1395 	int EVP_PKEY_set1_RSA(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey, libressl_d.openssl.rsa.rsa_st* key);
1396 }
1397 
1398 version (OPENSSL_NO_DSA) {
1399 } else {
1400 	libressl_d.openssl.dsa.dsa_st* EVP_PKEY_get0_DSA(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey);
1401 	libressl_d.openssl.dsa.dsa_st* EVP_PKEY_get1_DSA(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey);
1402 	int EVP_PKEY_set1_DSA(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey, libressl_d.openssl.dsa.dsa_st* key);
1403 }
1404 
1405 version (OPENSSL_NO_DH) {
1406 } else {
1407 	libressl_d.openssl.dh.dh_st* EVP_PKEY_get0_DH(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey);
1408 	libressl_d.openssl.dh.dh_st* EVP_PKEY_get1_DH(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey);
1409 	int EVP_PKEY_set1_DH(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey, libressl_d.openssl.dh.dh_st* key);
1410 }
1411 
1412 version (OPENSSL_NO_EC) {
1413 } else {
1414 	libressl_d.openssl.ec.ec_key_st* EVP_PKEY_get0_EC_KEY(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey);
1415 	libressl_d.openssl.ec.ec_key_st* EVP_PKEY_get1_EC_KEY(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey);
1416 	int EVP_PKEY_set1_EC_KEY(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey, libressl_d.openssl.ec.ec_key_st* key);
1417 }
1418 
1419 libressl_d.openssl.ossl_typ.EVP_PKEY* EVP_PKEY_new();
1420 void EVP_PKEY_free(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey);
1421 int EVP_PKEY_up_ref(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey);
1422 
1423 libressl_d.openssl.ossl_typ.EVP_PKEY* d2i_PublicKey(int type, libressl_d.openssl.ossl_typ.EVP_PKEY** a, const (ubyte)** pp, core.stdc.config.c_long length_);
1424 int i2d_PublicKey(libressl_d.openssl.ossl_typ.EVP_PKEY* a, ubyte** pp);
1425 
1426 libressl_d.openssl.ossl_typ.EVP_PKEY* d2i_PrivateKey(int type, libressl_d.openssl.ossl_typ.EVP_PKEY** a, const (ubyte)** pp, core.stdc.config.c_long length_);
1427 libressl_d.openssl.ossl_typ.EVP_PKEY* d2i_AutoPrivateKey(libressl_d.openssl.ossl_typ.EVP_PKEY** a, const (ubyte)** pp, core.stdc.config.c_long length_);
1428 int i2d_PrivateKey(libressl_d.openssl.ossl_typ.EVP_PKEY* a, ubyte** pp);
1429 
1430 int EVP_PKEY_copy_parameters(libressl_d.openssl.ossl_typ.EVP_PKEY* to, const (libressl_d.openssl.ossl_typ.EVP_PKEY)* from);
1431 int EVP_PKEY_missing_parameters(const (libressl_d.openssl.ossl_typ.EVP_PKEY)* pkey);
1432 int EVP_PKEY_save_parameters(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey, int mode);
1433 int EVP_PKEY_cmp_parameters(const (libressl_d.openssl.ossl_typ.EVP_PKEY)* a, const (libressl_d.openssl.ossl_typ.EVP_PKEY)* b);
1434 
1435 int EVP_PKEY_cmp(const (libressl_d.openssl.ossl_typ.EVP_PKEY)* a, const (libressl_d.openssl.ossl_typ.EVP_PKEY)* b);
1436 
1437 int EVP_PKEY_print_public(libressl_d.openssl.bio.BIO* out_, const (libressl_d.openssl.ossl_typ.EVP_PKEY)* pkey, int indent, libressl_d.openssl.ossl_typ.ASN1_PCTX* pctx);
1438 int EVP_PKEY_print_private(libressl_d.openssl.bio.BIO* out_, const (libressl_d.openssl.ossl_typ.EVP_PKEY)* pkey, int indent, libressl_d.openssl.ossl_typ.ASN1_PCTX* pctx);
1439 int EVP_PKEY_print_params(libressl_d.openssl.bio.BIO* out_, const (libressl_d.openssl.ossl_typ.EVP_PKEY)* pkey, int indent, libressl_d.openssl.ossl_typ.ASN1_PCTX* pctx);
1440 
1441 int EVP_PKEY_get_default_digest_nid(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey, int* pnid);
1442 
1443 int EVP_CIPHER_type(const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* ctx);
1444 
1445 /* calls methods */
1446 int EVP_CIPHER_param_to_asn1(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* c, libressl_d.openssl.asn1.ASN1_TYPE* type);
1447 int EVP_CIPHER_asn1_to_param(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* c, libressl_d.openssl.asn1.ASN1_TYPE* type);
1448 
1449 /* These are used by EVP_CIPHER methods */
1450 int EVP_CIPHER_set_asn1_iv(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* c, libressl_d.openssl.asn1.ASN1_TYPE* type);
1451 int EVP_CIPHER_get_asn1_iv(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* c, libressl_d.openssl.asn1.ASN1_TYPE* type);
1452 
1453 /* PKCS5 password based encryption */
1454 int PKCS5_PBE_keyivgen(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, const (char)* pass, int passlen, libressl_d.openssl.asn1.ASN1_TYPE* param, const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* cipher, const (libressl_d.openssl.ossl_typ.EVP_MD)* md, int en_de);
1455 int PKCS5_PBKDF2_HMAC_SHA1(const (char)* pass, int passlen, const (ubyte)* salt, int saltlen, int iter, int keylen, ubyte* out_);
1456 int PKCS5_PBKDF2_HMAC(const (char)* pass, int passlen, const (ubyte)* salt, int saltlen, int iter, const (libressl_d.openssl.ossl_typ.EVP_MD)* digest, int keylen, ubyte* out_);
1457 int PKCS5_v2_PBE_keyivgen(libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, const (char)* pass, int passlen, libressl_d.openssl.asn1.ASN1_TYPE* param, const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* cipher, const (libressl_d.openssl.ossl_typ.EVP_MD)* md, int en_de);
1458 
1459 void PKCS5_PBE_add();
1460 
1461 int EVP_PBE_CipherInit(libressl_d.openssl.asn1.ASN1_OBJECT* pbe_obj, const (char)* pass, int passlen, libressl_d.openssl.asn1.ASN1_TYPE* param, libressl_d.openssl.ossl_typ.EVP_CIPHER_CTX* ctx, int en_de);
1462 
1463 /* PBE type */
1464 
1465 /**
1466  * Can appear as the outermost AlgorithmIdentifier
1467  */
1468 enum EVP_PBE_TYPE_OUTER = 0x00;
1469 
1470 /**
1471  * Is an PRF type OID
1472  */
1473 enum EVP_PBE_TYPE_PRF = 0x01;
1474 
1475 int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid, int md_nid, .EVP_PBE_KEYGEN* keygen);
1476 int EVP_PBE_alg_add(int nid, const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* cipher, const (libressl_d.openssl.ossl_typ.EVP_MD)* md, .EVP_PBE_KEYGEN* keygen);
1477 int EVP_PBE_find(int type, int pbe_nid, int* pcnid, int* pmnid, .EVP_PBE_KEYGEN** pkeygen);
1478 void EVP_PBE_cleanup();
1479 
1480 enum ASN1_PKEY_ALIAS = 0x01;
1481 enum ASN1_PKEY_DYNAMIC = 0x02;
1482 enum ASN1_PKEY_SIGPARAM_NULL = 0x04;
1483 
1484 enum ASN1_PKEY_CTRL_PKCS7_SIGN = 0x01;
1485 enum ASN1_PKEY_CTRL_PKCS7_ENCRYPT = 0x02;
1486 enum ASN1_PKEY_CTRL_DEFAULT_MD_NID = 0x03;
1487 enum ASN1_PKEY_CTRL_CMS_SIGN = 0x05;
1488 enum ASN1_PKEY_CTRL_CMS_ENVELOPE = 0x07;
1489 enum ASN1_PKEY_CTRL_CMS_RI_TYPE = 0x08;
1490 
1491 int EVP_PKEY_asn1_get_count();
1492 const (libressl_d.openssl.ossl_typ.EVP_PKEY_ASN1_METHOD)* EVP_PKEY_asn1_get0(int idx);
1493 const (libressl_d.openssl.ossl_typ.EVP_PKEY_ASN1_METHOD)* EVP_PKEY_asn1_find(libressl_d.openssl.ossl_typ.ENGINE** pe, int type);
1494 const (libressl_d.openssl.ossl_typ.EVP_PKEY_ASN1_METHOD)* EVP_PKEY_asn1_find_str(libressl_d.openssl.ossl_typ.ENGINE** pe, const (char)* str, int len);
1495 int EVP_PKEY_asn1_add0(const (libressl_d.openssl.ossl_typ.EVP_PKEY_ASN1_METHOD)* ameth);
1496 int EVP_PKEY_asn1_add_alias(int to, int from);
1497 int EVP_PKEY_asn1_get0_info(int* ppkey_id, int* pkey_base_id, int* ppkey_flags, const (char)** pinfo, const (char)** ppem_str, const (libressl_d.openssl.ossl_typ.EVP_PKEY_ASN1_METHOD)* ameth);
1498 
1499 const (libressl_d.openssl.ossl_typ.EVP_PKEY_ASN1_METHOD)* EVP_PKEY_get0_asn1(const (libressl_d.openssl.ossl_typ.EVP_PKEY)* pkey);
1500 libressl_d.openssl.ossl_typ.EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id, int flags, const (char)* pem_str, const (char)* info);
1501 void EVP_PKEY_asn1_copy(libressl_d.openssl.ossl_typ.EVP_PKEY_ASN1_METHOD* dst, const (libressl_d.openssl.ossl_typ.EVP_PKEY_ASN1_METHOD)* src);
1502 void EVP_PKEY_asn1_free(libressl_d.openssl.ossl_typ.EVP_PKEY_ASN1_METHOD* ameth);
1503 void EVP_PKEY_asn1_set_public(libressl_d.openssl.ossl_typ.EVP_PKEY_ASN1_METHOD* ameth, int function(libressl_d.openssl.ossl_typ.EVP_PKEY* pk, libressl_d.openssl.ossl_typ.X509_PUBKEY* pub) pub_decode, int function(libressl_d.openssl.ossl_typ.X509_PUBKEY* pub, const (libressl_d.openssl.ossl_typ.EVP_PKEY)* pk) pub_encode, int function(const (libressl_d.openssl.ossl_typ.EVP_PKEY)* a, const (libressl_d.openssl.ossl_typ.EVP_PKEY)* b) pub_cmp, int function(libressl_d.openssl.bio.BIO* out_, const (libressl_d.openssl.ossl_typ.EVP_PKEY)* pkey, int indent, libressl_d.openssl.ossl_typ.ASN1_PCTX* pctx) pub_print, int function(const (libressl_d.openssl.ossl_typ.EVP_PKEY)* pk) pkey_size, int function(const (libressl_d.openssl.ossl_typ.EVP_PKEY)* pk) pkey_bits);
1504 void EVP_PKEY_asn1_set_private(libressl_d.openssl.ossl_typ.EVP_PKEY_ASN1_METHOD* ameth, int function(libressl_d.openssl.ossl_typ.EVP_PKEY* pk, const (libressl_d.openssl.ossl_typ.PKCS8_PRIV_KEY_INFO)* p8inf) priv_decode, int function(libressl_d.openssl.ossl_typ.PKCS8_PRIV_KEY_INFO* p8, const (libressl_d.openssl.ossl_typ.EVP_PKEY)* pk) priv_encode, int function(libressl_d.openssl.bio.BIO* out_, const (libressl_d.openssl.ossl_typ.EVP_PKEY)* pkey, int indent, libressl_d.openssl.ossl_typ.ASN1_PCTX* pctx) priv_print);
1505 void EVP_PKEY_asn1_set_param(libressl_d.openssl.ossl_typ.EVP_PKEY_ASN1_METHOD* ameth, int function(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey, const (ubyte)** pder, int derlen) param_decode, int function(const (libressl_d.openssl.ossl_typ.EVP_PKEY)* pkey, ubyte** pder) param_encode, int function(const (libressl_d.openssl.ossl_typ.EVP_PKEY)* pk) param_missing, int function(libressl_d.openssl.ossl_typ.EVP_PKEY* to, const (libressl_d.openssl.ossl_typ.EVP_PKEY)* from) param_copy, int function(const (libressl_d.openssl.ossl_typ.EVP_PKEY)* a, const (libressl_d.openssl.ossl_typ.EVP_PKEY)* b) param_cmp, int function(libressl_d.openssl.bio.BIO* out_, const (libressl_d.openssl.ossl_typ.EVP_PKEY)* pkey, int indent, libressl_d.openssl.ossl_typ.ASN1_PCTX* pctx) param_print);
1506 
1507 void EVP_PKEY_asn1_set_free(libressl_d.openssl.ossl_typ.EVP_PKEY_ASN1_METHOD* ameth, void function(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey) pkey_free);
1508 void EVP_PKEY_asn1_set_ctrl(libressl_d.openssl.ossl_typ.EVP_PKEY_ASN1_METHOD* ameth, int function(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey, int op, core.stdc.config.c_long arg1, void* arg2) pkey_ctrl);
1509 
1510 enum EVP_PKEY_OP_UNDEFINED = 0;
1511 enum EVP_PKEY_OP_PARAMGEN = 1 << 1;
1512 enum EVP_PKEY_OP_KEYGEN = 1 << 2;
1513 enum EVP_PKEY_OP_SIGN = 1 << 3;
1514 enum EVP_PKEY_OP_VERIFY = 1 << 4;
1515 enum EVP_PKEY_OP_VERIFYRECOVER = 1 << 5;
1516 enum EVP_PKEY_OP_SIGNCTX = 1 << 6;
1517 enum EVP_PKEY_OP_VERIFYCTX = 1 << 7;
1518 enum EVP_PKEY_OP_ENCRYPT = 1 << 8;
1519 enum EVP_PKEY_OP_DECRYPT = 1 << 9;
1520 enum EVP_PKEY_OP_DERIVE = 1 << 10;
1521 
1522 enum EVP_PKEY_OP_TYPE_SIG = .EVP_PKEY_OP_SIGN | .EVP_PKEY_OP_VERIFY | .EVP_PKEY_OP_VERIFYRECOVER | .EVP_PKEY_OP_SIGNCTX | .EVP_PKEY_OP_VERIFYCTX;
1523 
1524 enum EVP_PKEY_OP_TYPE_CRYPT = .EVP_PKEY_OP_ENCRYPT | .EVP_PKEY_OP_DECRYPT;
1525 
1526 //enum EVP_PKEY_OP_TYPE_NOGEN = EVP_PKEY_OP_SIG | EVP_PKEY_OP_CRYPT | .EVP_PKEY_OP_DERIVE;
1527 
1528 enum EVP_PKEY_OP_TYPE_GEN = .EVP_PKEY_OP_PARAMGEN | .EVP_PKEY_OP_KEYGEN;
1529 
1530 pragma(inline, true)
1531 int EVP_PKEY_CTX_set_signature_md(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, void* md)
1532 
1533 	do
1534 	{
1535 		return .EVP_PKEY_CTX_ctrl(ctx, -1, .EVP_PKEY_OP_TYPE_SIG, .EVP_PKEY_CTRL_MD, 0, md);
1536 	}
1537 
1538 pragma(inline, true)
1539 int EVP_PKEY_CTX_get_signature_md(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, void* pmd)
1540 
1541 	do
1542 	{
1543 		return .EVP_PKEY_CTX_ctrl(ctx, -1, .EVP_PKEY_OP_TYPE_SIG, .EVP_PKEY_CTRL_GET_MD, 0, pmd);
1544 	}
1545 
1546 enum EVP_PKEY_CTRL_MD = 1;
1547 enum EVP_PKEY_CTRL_PEER_KEY = 2;
1548 
1549 enum EVP_PKEY_CTRL_PKCS7_ENCRYPT = 3;
1550 enum EVP_PKEY_CTRL_PKCS7_DECRYPT = 4;
1551 
1552 enum EVP_PKEY_CTRL_PKCS7_SIGN = 5;
1553 
1554 enum EVP_PKEY_CTRL_SET_MAC_KEY = 6;
1555 
1556 enum EVP_PKEY_CTRL_DIGESTINIT = 7;
1557 
1558 /**
1559  * Used by GOST key encryption in TLS
1560  */
1561 enum EVP_PKEY_CTRL_SET_IV = 8;
1562 
1563 enum EVP_PKEY_CTRL_CMS_ENCRYPT = 9;
1564 enum EVP_PKEY_CTRL_CMS_DECRYPT = 10;
1565 enum EVP_PKEY_CTRL_CMS_SIGN = 11;
1566 
1567 enum EVP_PKEY_CTRL_CIPHER = 12;
1568 
1569 enum EVP_PKEY_CTRL_GET_MD = 13;
1570 
1571 enum EVP_PKEY_ALG_CTRL = 0x1000;
1572 
1573 enum EVP_PKEY_FLAG_AUTOARGLEN = 2;
1574 
1575 /**
1576  * Method handles all operations: don't assume any digest related
1577  * defaults.
1578  */
1579 enum EVP_PKEY_FLAG_SIGCTX_CUSTOM = 4;
1580 
1581 const (libressl_d.openssl.ossl_typ.EVP_PKEY_METHOD)* EVP_PKEY_meth_find(int type);
1582 libressl_d.openssl.ossl_typ.EVP_PKEY_METHOD* EVP_PKEY_meth_new(int id, int flags);
1583 void EVP_PKEY_meth_get0_info(int* ppkey_id, int* pflags, const (libressl_d.openssl.ossl_typ.EVP_PKEY_METHOD)* meth);
1584 void EVP_PKEY_meth_copy(libressl_d.openssl.ossl_typ.EVP_PKEY_METHOD* dst, const (libressl_d.openssl.ossl_typ.EVP_PKEY_METHOD)* src);
1585 void EVP_PKEY_meth_free(libressl_d.openssl.ossl_typ.EVP_PKEY_METHOD* pmeth);
1586 int EVP_PKEY_meth_add0(const (libressl_d.openssl.ossl_typ.EVP_PKEY_METHOD)* pmeth);
1587 
1588 libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* EVP_PKEY_CTX_new(libressl_d.openssl.ossl_typ.EVP_PKEY* pkey, libressl_d.openssl.ossl_typ.ENGINE* e);
1589 libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* EVP_PKEY_CTX_new_id(int id, libressl_d.openssl.ossl_typ.ENGINE* e);
1590 libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* EVP_PKEY_CTX_dup(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx);
1591 void EVP_PKEY_CTX_free(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx);
1592 
1593 int EVP_PKEY_CTX_ctrl(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, int keytype, int optype, int cmd, int p1, void* p2);
1594 int EVP_PKEY_CTX_ctrl_str(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, const (char)* type, const (char)* value);
1595 
1596 int EVP_PKEY_CTX_get_operation(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx);
1597 void EVP_PKEY_CTX_set0_keygen_info(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, int* dat, int datlen);
1598 
1599 libressl_d.openssl.ossl_typ.EVP_PKEY* EVP_PKEY_new_mac_key(int type, libressl_d.openssl.ossl_typ.ENGINE* e, const (ubyte)* key, int keylen);
1600 libressl_d.openssl.ossl_typ.EVP_PKEY* EVP_PKEY_new_CMAC_key(libressl_d.openssl.ossl_typ.ENGINE* e, const (ubyte)* priv, size_t len, const (libressl_d.openssl.ossl_typ.EVP_CIPHER)* cipher);
1601 
1602 void EVP_PKEY_CTX_set_data(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, void* data);
1603 void* EVP_PKEY_CTX_get_data(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx);
1604 libressl_d.openssl.ossl_typ.EVP_PKEY* EVP_PKEY_CTX_get0_pkey(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx);
1605 
1606 libressl_d.openssl.ossl_typ.EVP_PKEY* EVP_PKEY_CTX_get0_peerkey(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx);
1607 
1608 void EVP_PKEY_CTX_set_app_data(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, void* data);
1609 void* EVP_PKEY_CTX_get_app_data(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx);
1610 
1611 int EVP_PKEY_sign_init(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx);
1612 int EVP_PKEY_sign(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, ubyte* sig, size_t* siglen, const (ubyte)* tbs, size_t tbslen);
1613 int EVP_PKEY_verify_init(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx);
1614 int EVP_PKEY_verify(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, const (ubyte)* sig, size_t siglen, const (ubyte)* tbs, size_t tbslen);
1615 int EVP_PKEY_verify_recover_init(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx);
1616 int EVP_PKEY_verify_recover(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, ubyte* rout, size_t* routlen, const (ubyte)* sig, size_t siglen);
1617 int EVP_PKEY_encrypt_init(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx);
1618 int EVP_PKEY_encrypt(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, ubyte* out_, size_t* outlen, const (ubyte)* in_, size_t inlen);
1619 int EVP_PKEY_decrypt_init(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx);
1620 int EVP_PKEY_decrypt(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, ubyte* out_, size_t* outlen, const (ubyte)* in_, size_t inlen);
1621 
1622 int EVP_PKEY_derive_init(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx);
1623 int EVP_PKEY_derive_set_peer(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, libressl_d.openssl.ossl_typ.EVP_PKEY* peer);
1624 int EVP_PKEY_derive(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, ubyte* key, size_t* keylen);
1625 
1626 alias EVP_PKEY_gen_cb = extern (C) nothrow @nogc int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx);
1627 
1628 int EVP_PKEY_paramgen_init(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx);
1629 int EVP_PKEY_paramgen(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, libressl_d.openssl.ossl_typ.EVP_PKEY** ppkey);
1630 int EVP_PKEY_keygen_init(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx);
1631 int EVP_PKEY_keygen(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, libressl_d.openssl.ossl_typ.EVP_PKEY** ppkey);
1632 
1633 void EVP_PKEY_CTX_set_cb(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, .EVP_PKEY_gen_cb* cb);
1634 .EVP_PKEY_gen_cb* EVP_PKEY_CTX_get_cb(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx);
1635 
1636 int EVP_PKEY_CTX_get_keygen_info(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, int idx);
1637 
1638 void EVP_PKEY_meth_set_init(libressl_d.openssl.ossl_typ.EVP_PKEY_METHOD* pmeth, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx) init);
1639 
1640 void EVP_PKEY_meth_set_copy(libressl_d.openssl.ossl_typ.EVP_PKEY_METHOD* pmeth, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* dst, libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* src) copy);
1641 
1642 void EVP_PKEY_meth_set_cleanup(libressl_d.openssl.ossl_typ.EVP_PKEY_METHOD* pmeth, void function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx) cleanup);
1643 
1644 void EVP_PKEY_meth_set_paramgen(libressl_d.openssl.ossl_typ.EVP_PKEY_METHOD* pmeth, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx) paramgen_init, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, libressl_d.openssl.ossl_typ.EVP_PKEY* pkey) paramgen);
1645 
1646 void EVP_PKEY_meth_set_keygen(libressl_d.openssl.ossl_typ.EVP_PKEY_METHOD* pmeth, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx) keygen_init, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, libressl_d.openssl.ossl_typ.EVP_PKEY* pkey) keygen);
1647 
1648 void EVP_PKEY_meth_set_sign(libressl_d.openssl.ossl_typ.EVP_PKEY_METHOD* pmeth, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx) sign_init, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, ubyte* sig, size_t* siglen, const (ubyte)* tbs, size_t tbslen) sign);
1649 
1650 void EVP_PKEY_meth_set_verify(libressl_d.openssl.ossl_typ.EVP_PKEY_METHOD* pmeth, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx) verify_init, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, const (ubyte)* sig, size_t siglen, const (ubyte)* tbs, size_t tbslen) verify);
1651 
1652 void EVP_PKEY_meth_set_verify_recover(libressl_d.openssl.ossl_typ.EVP_PKEY_METHOD* pmeth, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx) verify_recover_init, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, ubyte* sig, size_t* siglen, const (ubyte)* tbs, size_t tbslen) verify_recover);
1653 
1654 void EVP_PKEY_meth_set_signctx(libressl_d.openssl.ossl_typ.EVP_PKEY_METHOD* pmeth, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, libressl_d.openssl.ossl_typ.EVP_MD_CTX* mctx) signctx_init, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, ubyte* sig, size_t* siglen, libressl_d.openssl.ossl_typ.EVP_MD_CTX* mctx) signctx);
1655 
1656 void EVP_PKEY_meth_set_verifyctx(libressl_d.openssl.ossl_typ.EVP_PKEY_METHOD* pmeth, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, libressl_d.openssl.ossl_typ.EVP_MD_CTX* mctx) verifyctx_init, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, const (ubyte)* sig, int siglen, libressl_d.openssl.ossl_typ.EVP_MD_CTX* mctx) verifyctx);
1657 
1658 void EVP_PKEY_meth_set_encrypt(libressl_d.openssl.ossl_typ.EVP_PKEY_METHOD* pmeth, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx) encrypt_init, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, ubyte* out_, size_t* outlen, const (ubyte)* in_, size_t inlen) encryptfn);
1659 
1660 void EVP_PKEY_meth_set_decrypt(libressl_d.openssl.ossl_typ.EVP_PKEY_METHOD* pmeth, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx) decrypt_init, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, ubyte* out_, size_t* outlen, const (ubyte)* in_, size_t inlen) decrypt);
1661 
1662 void EVP_PKEY_meth_set_derive(libressl_d.openssl.ossl_typ.EVP_PKEY_METHOD* pmeth, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx) derive_init, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, ubyte* key, size_t* keylen) derive);
1663 
1664 void EVP_PKEY_meth_set_ctrl(libressl_d.openssl.ossl_typ.EVP_PKEY_METHOD* pmeth, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, int type, int p1, void* p2) ctrl, int function(libressl_d.openssl.ossl_typ.EVP_PKEY_CTX* ctx, const (char)* type, const (char)* value) ctrl_str);
1665 
1666 /*
1667  * Authenticated Encryption with Additional Data.
1668  *
1669  * AEAD couples confidentiality and integrity in a single primtive. AEAD
1670  * algorithms take a key and then can seal and open individual messages. Each
1671  * message has a unique, per-message nonce and, optionally, additional data
1672  * which is authenticated but not included in the output.
1673  */
1674 
1675 struct evp_aead_st;
1676 alias EVP_AEAD = .evp_aead_st;
1677 
1678 version (OPENSSL_NO_AES) {
1679 } else {
1680 	/**
1681 	 * EVP_aes_128_gcm is AES-128 in Galois Counter Mode.
1682 	 */
1683 	const (.EVP_AEAD)* EVP_aead_aes_128_gcm();
1684 
1685 	/**
1686 	 * EVP_aes_256_gcm is AES-256 in Galois Counter Mode.
1687 	 */
1688 	const (.EVP_AEAD)* EVP_aead_aes_256_gcm();
1689 }
1690 
1691 version (OPENSSL_NO_CHACHA) {
1692 } else {
1693 	version (OPENSSL_NO_POLY1305) {
1694 	} else {
1695 		/**
1696 		 * EVP_aead_chacha20_poly1305 is ChaCha20 with a Poly1305 authenticator.
1697 		 */
1698 		const (.EVP_AEAD)* EVP_aead_chacha20_poly1305();
1699 
1700 		/**
1701 		 * EVP_aead_xchacha20_poly1305 is XChaCha20 with a Poly1305 authenticator.
1702 		 */
1703 		const (.EVP_AEAD)* EVP_aead_xchacha20_poly1305();
1704 	}
1705 }
1706 
1707 /**
1708  * EVP_AEAD_key_length returns the length of the keys used.
1709  */
1710 size_t EVP_AEAD_key_length(const (.EVP_AEAD)* aead);
1711 
1712 /**
1713  * EVP_AEAD_nonce_length returns the length of the per-message nonce.
1714  */
1715 size_t EVP_AEAD_nonce_length(const (.EVP_AEAD)* aead);
1716 
1717 /**
1718  * EVP_AEAD_max_overhead returns the maximum number of additional bytes added
1719  * by the act of sealing data with the AEAD.
1720  */
1721 size_t EVP_AEAD_max_overhead(const (.EVP_AEAD)* aead);
1722 
1723 /**
1724  * EVP_AEAD_max_tag_len returns the maximum tag length when using this AEAD.
1725  * This * is the largest value that can be passed as a tag length to
1726  * EVP_AEAD_CTX_init.
1727  */
1728 size_t EVP_AEAD_max_tag_len(const (.EVP_AEAD)* aead);
1729 
1730 /**
1731  * An EVP_AEAD_CTX represents an AEAD algorithm configured with a specific key
1732  * and message-independent IV.
1733  */
1734 struct evp_aead_ctx_st
1735 {
1736 	const (.EVP_AEAD)* aead;
1737 
1738 	/**
1739 	 * aead_state is an opaque pointer to the AEAD specific state.
1740 	 */
1741 	void* aead_state;
1742 }
1743 
1744 alias EVP_AEAD_CTX = .evp_aead_ctx_st;
1745 
1746 /**
1747  * EVP_AEAD_MAX_TAG_LENGTH is the maximum tag length used by any AEAD
1748  * defined in this header.
1749  */
1750 enum EVP_AEAD_MAX_TAG_LENGTH = 16;
1751 
1752 /**
1753  * EVP_AEAD_DEFAULT_TAG_LENGTH is a magic value that can be passed to
1754  * EVP_AEAD_CTX_init to indicate that the default tag length for an AEAD
1755  * should be used.
1756  */
1757 enum EVP_AEAD_DEFAULT_TAG_LENGTH = 0;
1758 
1759 /**
1760  * EVP_AEAD_init initializes the context for the given AEAD algorithm.
1761  * The implementation argument may be null to choose the default implementation.
1762  * Authentication tags may be truncated by passing a tag length. A tag length
1763  * of zero indicates the default tag length should be used.
1764  */
1765 int EVP_AEAD_CTX_init(.EVP_AEAD_CTX* ctx, const (.EVP_AEAD)* aead, const (ubyte)* key, size_t key_len, size_t tag_len, libressl_d.openssl.ossl_typ.ENGINE* impl);
1766 
1767 /**
1768  * EVP_AEAD_CTX_cleanup frees any data allocated for this context.
1769  */
1770 void EVP_AEAD_CTX_cleanup(.EVP_AEAD_CTX* ctx);
1771 
1772 /**
1773  * EVP_AEAD_CTX_seal encrypts and authenticates the input and authenticates
1774  * any additional data (AD), the result being written as output. One is
1775  * returned on success, otherwise zero.
1776  *
1777  * This function may be called (with the same EVP_AEAD_CTX) concurrently with
1778  * itself or EVP_AEAD_CTX_open.
1779  *
1780  * At most max_out_len bytes are written as output and, in order to ensure
1781  * success, this value should be the length of the input plus the result of
1782  * EVP_AEAD_overhead. On successful return, out_len is set to the actual
1783  * number of bytes written.
1784  *
1785  * The length of the nonce is must be equal to the result of
1786  * EVP_AEAD_nonce_length for this AEAD.
1787  *
1788  * EVP_AEAD_CTX_seal never results in a partial output. If max_out_len is
1789  * insufficient, zero will be returned and out_len will be set to zero.
1790  *
1791  * If the input and output are aliased then out must be <= in.
1792  */
1793 int EVP_AEAD_CTX_seal(const (.EVP_AEAD_CTX)* ctx, ubyte* out_, size_t* out_len, size_t max_out_len, const (ubyte)* nonce, size_t nonce_len, const (ubyte)* in_, size_t in_len, const (ubyte)* ad, size_t ad_len);
1794 
1795 /**
1796  * EVP_AEAD_CTX_open authenticates the input and additional data, decrypting
1797  * the input and writing it as output. One is returned on success, otherwise
1798  * zero.
1799  *
1800  * This function may be called (with the same EVP_AEAD_CTX) concurrently with
1801  * itself or EVP_AEAD_CTX_seal.
1802  *
1803  * At most the number of input bytes are written as output. In order to ensure
1804  * success, max_out_len should be at least the same as the input length. On
1805  * successful return out_len is set to the actual number of bytes written.
1806  *
1807  * The length of nonce must be equal to the result of EVP_AEAD_nonce_length
1808  * for this AEAD.
1809  *
1810  * EVP_AEAD_CTX_open never results in a partial output. If max_out_len is
1811  * insufficient, zero will be returned and out_len will be set to zero.
1812  *
1813  * If the input and output are aliased then out must be <= in.
1814  */
1815 int EVP_AEAD_CTX_open(const (.EVP_AEAD_CTX)* ctx, ubyte* out_, size_t* out_len, size_t max_out_len, const (ubyte)* nonce, size_t nonce_len, const (ubyte)* in_, size_t in_len, const (ubyte)* ad, size_t ad_len);
1816 
1817 void EVP_add_alg_module();
1818 
1819 /* BEGIN ERROR CODES */
1820 /**
1821  * The following lines are auto generated by the script mkerr.pl. Any changes
1822  * made after this point may be overwritten when the script is next run.
1823  */
1824 void ERR_load_EVP_strings();
1825 
1826 /* Error codes for the EVP functions. */
1827 
1828 /* Function codes. */
1829 enum EVP_F_AEAD_AES_GCM_INIT = 187;
1830 enum EVP_F_AEAD_AES_GCM_OPEN = 188;
1831 enum EVP_F_AEAD_AES_GCM_SEAL = 189;
1832 enum EVP_F_AEAD_CHACHA20_POLY1305_INIT = 192;
1833 enum EVP_F_AEAD_CHACHA20_POLY1305_OPEN = 193;
1834 enum EVP_F_AEAD_CHACHA20_POLY1305_SEAL = 194;
1835 enum EVP_F_AEAD_CTX_OPEN = 185;
1836 enum EVP_F_AEAD_CTX_SEAL = 186;
1837 enum EVP_F_AESNI_INIT_KEY = 165;
1838 enum EVP_F_AESNI_XTS_CIPHER = 176;
1839 enum EVP_F_AES_INIT_KEY = 133;
1840 enum EVP_F_AES_XTS = 172;
1841 enum EVP_F_AES_XTS_CIPHER = 175;
1842 enum EVP_F_ALG_MODULE_INIT = 177;
1843 enum EVP_F_CAMELLIA_INIT_KEY = 159;
1844 enum EVP_F_CMAC_INIT = 173;
1845 enum EVP_F_D2I_PKEY = 100;
1846 enum EVP_F_DO_SIGVER_INIT = 161;
1847 enum EVP_F_DSAPKEY2PKCS8 = 134;
1848 enum EVP_F_DSA_PKEY2PKCS8 = 135;
1849 enum EVP_F_ECDSA_PKEY2PKCS8 = 129;
1850 enum EVP_F_ECKEY_PKEY2PKCS8 = 132;
1851 enum EVP_F_EVP_AEAD_CTX_INIT = 180;
1852 enum EVP_F_EVP_AEAD_CTX_OPEN = 190;
1853 enum EVP_F_EVP_AEAD_CTX_SEAL = 191;
1854 enum EVP_F_EVP_BYTESTOKEY = 200;
1855 enum EVP_F_EVP_CIPHERINIT_EX = 123;
1856 enum EVP_F_EVP_CIPHER_CTX_COPY = 163;
1857 enum EVP_F_EVP_CIPHER_CTX_CTRL = 124;
1858 enum EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH = 122;
1859 enum EVP_F_EVP_CIPHER_GET_ASN1_IV = 201;
1860 enum EVP_F_EVP_CIPHER_SET_ASN1_IV = 202;
1861 enum EVP_F_EVP_DECRYPTFINAL_EX = 101;
1862 enum EVP_F_EVP_DECRYPTUPDATE = 199;
1863 enum EVP_F_EVP_DIGESTFINAL_EX = 196;
1864 enum EVP_F_EVP_DIGESTINIT_EX = 128;
1865 enum EVP_F_EVP_ENCRYPTFINAL_EX = 127;
1866 enum EVP_F_EVP_ENCRYPTUPDATE = 198;
1867 enum EVP_F_EVP_MD_CTX_COPY_EX = 110;
1868 enum EVP_F_EVP_MD_CTX_CTRL = 195;
1869 enum EVP_F_EVP_MD_SIZE = 162;
1870 enum EVP_F_EVP_OPENINIT = 102;
1871 enum EVP_F_EVP_PBE_ALG_ADD = 115;
1872 enum EVP_F_EVP_PBE_ALG_ADD_TYPE = 160;
1873 enum EVP_F_EVP_PBE_CIPHERINIT = 116;
1874 enum EVP_F_EVP_PKCS82PKEY = 111;
1875 enum EVP_F_EVP_PKCS82PKEY_BROKEN = 136;
1876 enum EVP_F_EVP_PKEY2PKCS8_BROKEN = 113;
1877 enum EVP_F_EVP_PKEY_COPY_PARAMETERS = 103;
1878 enum EVP_F_EVP_PKEY_CTX_CTRL = 137;
1879 enum EVP_F_EVP_PKEY_CTX_CTRL_STR = 150;
1880 enum EVP_F_EVP_PKEY_CTX_DUP = 156;
1881 enum EVP_F_EVP_PKEY_DECRYPT = 104;
1882 enum EVP_F_EVP_PKEY_DECRYPT_INIT = 138;
1883 enum EVP_F_EVP_PKEY_DECRYPT_OLD = 151;
1884 enum EVP_F_EVP_PKEY_DERIVE = 153;
1885 enum EVP_F_EVP_PKEY_DERIVE_INIT = 154;
1886 enum EVP_F_EVP_PKEY_DERIVE_SET_PEER = 155;
1887 enum EVP_F_EVP_PKEY_ENCRYPT = 105;
1888 enum EVP_F_EVP_PKEY_ENCRYPT_INIT = 139;
1889 enum EVP_F_EVP_PKEY_ENCRYPT_OLD = 152;
1890 enum EVP_F_EVP_PKEY_GET1_DH = 119;
1891 enum EVP_F_EVP_PKEY_GET1_DSA = 120;
1892 enum EVP_F_EVP_PKEY_GET1_ECDSA = 130;
1893 enum EVP_F_EVP_PKEY_GET1_EC_KEY = 131;
1894 enum EVP_F_EVP_PKEY_GET1_RSA = 121;
1895 enum EVP_F_EVP_PKEY_KEYGEN = 146;
1896 enum EVP_F_EVP_PKEY_KEYGEN_INIT = 147;
1897 enum EVP_F_EVP_PKEY_NEW = 106;
1898 enum EVP_F_EVP_PKEY_PARAMGEN = 148;
1899 enum EVP_F_EVP_PKEY_PARAMGEN_INIT = 149;
1900 enum EVP_F_EVP_PKEY_SIGN = 140;
1901 enum EVP_F_EVP_PKEY_SIGN_INIT = 141;
1902 enum EVP_F_EVP_PKEY_VERIFY = 142;
1903 enum EVP_F_EVP_PKEY_VERIFY_INIT = 143;
1904 enum EVP_F_EVP_PKEY_VERIFY_RECOVER = 144;
1905 enum EVP_F_EVP_PKEY_VERIFY_RECOVER_INIT = 145;
1906 enum EVP_F_EVP_RIJNDAEL = 126;
1907 enum EVP_F_EVP_SIGNFINAL = 107;
1908 enum EVP_F_EVP_VERIFYFINAL = 108;
1909 enum EVP_F_FIPS_CIPHERINIT = 166;
1910 enum EVP_F_FIPS_CIPHER_CTX_COPY = 170;
1911 enum EVP_F_FIPS_CIPHER_CTX_CTRL = 167;
1912 enum EVP_F_FIPS_CIPHER_CTX_SET_KEY_LENGTH = 171;
1913 enum EVP_F_FIPS_DIGESTINIT = 168;
1914 enum EVP_F_FIPS_MD_CTX_COPY = 169;
1915 enum EVP_F_HMAC_INIT_EX = 174;
1916 enum EVP_F_INT_CTX_NEW = 157;
1917 enum EVP_F_PKCS5_PBE_KEYIVGEN = 117;
1918 enum EVP_F_PKCS5_V2_PBE_KEYIVGEN = 118;
1919 enum EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN = 164;
1920 enum EVP_F_PKCS8_SET_BROKEN = 112;
1921 enum EVP_F_PKEY_SET_TYPE = 158;
1922 enum EVP_F_RC2_GET_ASN1_TYPE_AND_IV = 197;
1923 enum EVP_F_RC2_MAGIC_TO_METH = 109;
1924 enum EVP_F_RC5_CTRL = 125;
1925 
1926 /* Reason codes. */
1927 enum EVP_R_AES_IV_SETUP_FAILED = 162;
1928 enum EVP_R_AES_KEY_SETUP_FAILED = 143;
1929 enum EVP_R_ASN1_LIB = 140;
1930 enum EVP_R_BAD_BLOCK_LENGTH = 136;
1931 enum EVP_R_BAD_DECRYPT = 100;
1932 enum EVP_R_BAD_KEY_LENGTH = 137;
1933 enum EVP_R_BN_DECODE_ERROR = 112;
1934 enum EVP_R_BN_PUBKEY_ERROR = 113;
1935 enum EVP_R_BUFFER_TOO_SMALL = 155;
1936 enum EVP_R_CAMELLIA_KEY_SETUP_FAILED = 157;
1937 enum EVP_R_CIPHER_PARAMETER_ERROR = 122;
1938 enum EVP_R_COMMAND_NOT_SUPPORTED = 147;
1939 enum EVP_R_CTRL_NOT_IMPLEMENTED = 132;
1940 enum EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED = 133;
1941 enum EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH = 138;
1942 enum EVP_R_DECODE_ERROR = 114;
1943 enum EVP_R_DIFFERENT_KEY_TYPES = 101;
1944 enum EVP_R_DIFFERENT_PARAMETERS = 153;
1945 enum EVP_R_DISABLED_FOR_FIPS = 163;
1946 enum EVP_R_ENCODE_ERROR = 115;
1947 enum EVP_R_ERROR_LOADING_SECTION = 165;
1948 enum EVP_R_ERROR_SETTING_FIPS_MODE = 166;
1949 enum EVP_R_EVP_PBE_CIPHERINIT_ERROR = 119;
1950 enum EVP_R_EXPECTING_AN_HMAC_KEY = 174;
1951 enum EVP_R_EXPECTING_AN_RSA_KEY = 127;
1952 enum EVP_R_EXPECTING_A_DH_KEY = 128;
1953 enum EVP_R_EXPECTING_A_DSA_KEY = 129;
1954 enum EVP_R_EXPECTING_A_ECDSA_KEY = 141;
1955 enum EVP_R_EXPECTING_A_EC_KEY = 142;
1956 enum EVP_R_FIPS_MODE_NOT_SUPPORTED = 167;
1957 enum EVP_R_INITIALIZATION_ERROR = 134;
1958 enum EVP_R_INPUT_NOT_INITIALIZED = 111;
1959 enum EVP_R_INVALID_DIGEST = 152;
1960 enum EVP_R_INVALID_FIPS_MODE = 168;
1961 enum EVP_R_INVALID_IV_LENGTH = 194;
1962 enum EVP_R_INVALID_KEY_LENGTH = 130;
1963 enum EVP_R_INVALID_OPERATION = 148;
1964 enum EVP_R_IV_TOO_LARGE = 102;
1965 enum EVP_R_KEYGEN_FAILURE = 120;
1966 enum EVP_R_KEY_SETUP_FAILED = 180;
1967 enum EVP_R_MESSAGE_DIGEST_IS_NULL = 159;
1968 enum EVP_R_METHOD_NOT_SUPPORTED = 144;
1969 enum EVP_R_MISSING_PARAMETERS = 103;
1970 enum EVP_R_NO_CIPHER_SET = 131;
1971 enum EVP_R_NO_DEFAULT_DIGEST = 158;
1972 enum EVP_R_NO_DIGEST_SET = 139;
1973 enum EVP_R_NO_DSA_PARAMETERS = 116;
1974 enum EVP_R_NO_KEY_SET = 154;
1975 enum EVP_R_NO_OPERATION_SET = 149;
1976 enum EVP_R_NO_SIGN_FUNCTION_CONFIGURED = 104;
1977 enum EVP_R_NO_VERIFY_FUNCTION_CONFIGURED = 105;
1978 enum EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE = 150;
1979 enum EVP_R_OPERATON_NOT_INITIALIZED = 151;
1980 enum EVP_R_OUTPUT_ALIASES_INPUT = 172;
1981 enum EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE = 117;
1982 enum EVP_R_PRIVATE_KEY_DECODE_ERROR = 145;
1983 enum EVP_R_PRIVATE_KEY_ENCODE_ERROR = 146;
1984 enum EVP_R_PUBLIC_KEY_NOT_RSA = 106;
1985 enum EVP_R_TAG_TOO_LARGE = 171;
1986 enum EVP_R_TOO_LARGE = 164;
1987 enum EVP_R_UNKNOWN_CIPHER = 160;
1988 enum EVP_R_UNKNOWN_DIGEST = 161;
1989 enum EVP_R_UNKNOWN_OPTION = 169;
1990 enum EVP_R_UNKNOWN_PBE_ALGORITHM = 121;
1991 enum EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS = 135;
1992 enum EVP_R_UNSUPPORTED_ALGORITHM = 156;
1993 enum EVP_R_UNSUPPORTED_CIPHER = 107;
1994 enum EVP_R_UNSUPPORTED_KEYLENGTH = 123;
1995 enum EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION = 124;
1996 enum EVP_R_UNSUPPORTED_KEY_SIZE = 108;
1997 enum EVP_R_UNSUPPORTED_PRF = 125;
1998 enum EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM = 118;
1999 enum EVP_R_WRAP_MODE_NOT_ALLOWED = 170;
2000 enum EVP_R_UNSUPPORTED_SALT_TYPE = 126;
2001 enum EVP_R_WRONG_FINAL_BLOCK_LENGTH = 109;
2002 enum EVP_R_WRONG_PUBLIC_KEY_TYPE = 110;