1 1.1 christos /* 2 1.1 christos * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 3 1.1 christos * 4 1.1 christos * Licensed under the OpenSSL license (the "License"). You may not use 5 1.1 christos * this file except in compliance with the License. You can obtain a copy 6 1.1 christos * in the file LICENSE in the source distribution or at 7 1.1 christos * https://www.openssl.org/source/license.html 8 1.1 christos */ 9 1.1 christos 10 1.1 christos #ifndef HEADER_ENVELOPE_H 11 1.1 christos # define HEADER_ENVELOPE_H 12 1.1 christos 13 1.1 christos # include <openssl/opensslconf.h> 14 1.1 christos # include <openssl/ossl_typ.h> 15 1.1 christos # include <openssl/symhacks.h> 16 1.1 christos # include <openssl/bio.h> 17 1.1 christos # include <openssl/evperr.h> 18 1.1 christos 19 1.1 christos # define EVP_MAX_MD_SIZE 64/* longest known is SHA512 */ 20 1.1 christos # define EVP_MAX_KEY_LENGTH 64 21 1.1 christos # define EVP_MAX_IV_LENGTH 16 22 1.1 christos # define EVP_MAX_BLOCK_LENGTH 32 23 1.1 christos 24 1.1 christos # define PKCS5_SALT_LEN 8 25 1.1 christos /* Default PKCS#5 iteration count */ 26 1.1 christos # define PKCS5_DEFAULT_ITER 2048 27 1.1 christos 28 1.1 christos # include <openssl/objects.h> 29 1.1 christos 30 1.1 christos # define EVP_PK_RSA 0x0001 31 1.1 christos # define EVP_PK_DSA 0x0002 32 1.1 christos # define EVP_PK_DH 0x0004 33 1.1 christos # define EVP_PK_EC 0x0008 34 1.1 christos # define EVP_PKT_SIGN 0x0010 35 1.1 christos # define EVP_PKT_ENC 0x0020 36 1.1 christos # define EVP_PKT_EXCH 0x0040 37 1.1 christos # define EVP_PKS_RSA 0x0100 38 1.1 christos # define EVP_PKS_DSA 0x0200 39 1.1 christos # define EVP_PKS_EC 0x0400 40 1.1 christos 41 1.1 christos # define EVP_PKEY_NONE NID_undef 42 1.1 christos # define EVP_PKEY_RSA NID_rsaEncryption 43 1.1 christos # define EVP_PKEY_RSA2 NID_rsa 44 1.1 christos # define EVP_PKEY_RSA_PSS NID_rsassaPss 45 1.1 christos # define EVP_PKEY_DSA NID_dsa 46 1.1 christos # define EVP_PKEY_DSA1 NID_dsa_2 47 1.1 christos # define EVP_PKEY_DSA2 NID_dsaWithSHA 48 1.1 christos # define EVP_PKEY_DSA3 NID_dsaWithSHA1 49 1.1 christos # define EVP_PKEY_DSA4 NID_dsaWithSHA1_2 50 1.1 christos # define EVP_PKEY_DH NID_dhKeyAgreement 51 1.1 christos # define EVP_PKEY_DHX NID_dhpublicnumber 52 1.1 christos # define EVP_PKEY_EC NID_X9_62_id_ecPublicKey 53 1.1 christos # define EVP_PKEY_SM2 NID_sm2 54 1.1 christos # define EVP_PKEY_HMAC NID_hmac 55 1.1 christos # define EVP_PKEY_CMAC NID_cmac 56 1.1 christos # define EVP_PKEY_SCRYPT NID_id_scrypt 57 1.1 christos # define EVP_PKEY_TLS1_PRF NID_tls1_prf 58 1.1 christos # define EVP_PKEY_HKDF NID_hkdf 59 1.1 christos # define EVP_PKEY_POLY1305 NID_poly1305 60 1.1 christos # define EVP_PKEY_SIPHASH NID_siphash 61 1.1 christos # define EVP_PKEY_X25519 NID_X25519 62 1.1 christos # define EVP_PKEY_ED25519 NID_ED25519 63 1.1 christos # define EVP_PKEY_X448 NID_X448 64 1.1 christos # define EVP_PKEY_ED448 NID_ED448 65 1.1 christos 66 1.1 christos #ifdef __cplusplus 67 1.1 christos extern "C" { 68 1.1 christos #endif 69 1.1 christos 70 1.1 christos # define EVP_PKEY_MO_SIGN 0x0001 71 1.1 christos # define EVP_PKEY_MO_VERIFY 0x0002 72 1.1 christos # define EVP_PKEY_MO_ENCRYPT 0x0004 73 1.1 christos # define EVP_PKEY_MO_DECRYPT 0x0008 74 1.1 christos 75 1.1 christos # ifndef EVP_MD 76 1.1 christos EVP_MD *EVP_MD_meth_new(int md_type, int pkey_type); 77 1.1 christos EVP_MD *EVP_MD_meth_dup(const EVP_MD *md); 78 1.1 christos void EVP_MD_meth_free(EVP_MD *md); 79 1.1 christos 80 1.1 christos int EVP_MD_meth_set_input_blocksize(EVP_MD *md, int blocksize); 81 1.1 christos int EVP_MD_meth_set_result_size(EVP_MD *md, int resultsize); 82 1.1 christos int EVP_MD_meth_set_app_datasize(EVP_MD *md, int datasize); 83 1.1 christos int EVP_MD_meth_set_flags(EVP_MD *md, unsigned long flags); 84 1.1 christos int EVP_MD_meth_set_init(EVP_MD *md, int (*init)(EVP_MD_CTX *ctx)); 85 1.1 christos int EVP_MD_meth_set_update(EVP_MD *md, int (*update)(EVP_MD_CTX *ctx, 86 1.1 christos const void *data, 87 1.1 christos size_t count)); 88 1.1 christos int EVP_MD_meth_set_final(EVP_MD *md, int (*final)(EVP_MD_CTX *ctx, 89 1.1 christos unsigned char *md)); 90 1.1 christos int EVP_MD_meth_set_copy(EVP_MD *md, int (*copy)(EVP_MD_CTX *to, 91 1.1 christos const EVP_MD_CTX *from)); 92 1.1 christos int EVP_MD_meth_set_cleanup(EVP_MD *md, int (*cleanup)(EVP_MD_CTX *ctx)); 93 1.1 christos int EVP_MD_meth_set_ctrl(EVP_MD *md, int (*ctrl)(EVP_MD_CTX *ctx, int cmd, 94 1.1 christos int p1, void *p2)); 95 1.1 christos 96 1.1 christos int EVP_MD_meth_get_input_blocksize(const EVP_MD *md); 97 1.1 christos int EVP_MD_meth_get_result_size(const EVP_MD *md); 98 1.1 christos int EVP_MD_meth_get_app_datasize(const EVP_MD *md); 99 1.1 christos unsigned long EVP_MD_meth_get_flags(const EVP_MD *md); 100 1.1 christos int (*EVP_MD_meth_get_init(const EVP_MD *md))(EVP_MD_CTX *ctx); 101 1.1 christos int (*EVP_MD_meth_get_update(const EVP_MD *md))(EVP_MD_CTX *ctx, 102 1.1 christos const void *data, 103 1.1 christos size_t count); 104 1.1 christos int (*EVP_MD_meth_get_final(const EVP_MD *md))(EVP_MD_CTX *ctx, 105 1.1 christos unsigned char *md); 106 1.1 christos int (*EVP_MD_meth_get_copy(const EVP_MD *md))(EVP_MD_CTX *to, 107 1.1 christos const EVP_MD_CTX *from); 108 1.1 christos int (*EVP_MD_meth_get_cleanup(const EVP_MD *md))(EVP_MD_CTX *ctx); 109 1.1 christos int (*EVP_MD_meth_get_ctrl(const EVP_MD *md))(EVP_MD_CTX *ctx, int cmd, 110 1.1 christos int p1, void *p2); 111 1.1 christos 112 1.1 christos /* digest can only handle a single block */ 113 1.1 christos # define EVP_MD_FLAG_ONESHOT 0x0001 114 1.1 christos 115 1.1 christos /* digest is extensible-output function, XOF */ 116 1.1 christos # define EVP_MD_FLAG_XOF 0x0002 117 1.1 christos 118 1.1 christos /* DigestAlgorithmIdentifier flags... */ 119 1.1 christos 120 1.1 christos # define EVP_MD_FLAG_DIGALGID_MASK 0x0018 121 1.1 christos 122 1.1 christos /* NULL or absent parameter accepted. Use NULL */ 123 1.1 christos 124 1.1 christos # define EVP_MD_FLAG_DIGALGID_NULL 0x0000 125 1.1 christos 126 1.1 christos /* NULL or absent parameter accepted. Use NULL for PKCS#1 otherwise absent */ 127 1.1 christos 128 1.1 christos # define EVP_MD_FLAG_DIGALGID_ABSENT 0x0008 129 1.1 christos 130 1.1 christos /* Custom handling via ctrl */ 131 1.1 christos 132 1.1 christos # define EVP_MD_FLAG_DIGALGID_CUSTOM 0x0018 133 1.1 christos 134 1.1 christos /* Note if suitable for use in FIPS mode */ 135 1.1 christos # define EVP_MD_FLAG_FIPS 0x0400 136 1.1 christos 137 1.1 christos /* Digest ctrls */ 138 1.1 christos 139 1.1 christos # define EVP_MD_CTRL_DIGALGID 0x1 140 1.1 christos # define EVP_MD_CTRL_MICALG 0x2 141 1.1 christos # define EVP_MD_CTRL_XOF_LEN 0x3 142 1.1 christos 143 1.1 christos /* Minimum Algorithm specific ctrl value */ 144 1.1 christos 145 1.1 christos # define EVP_MD_CTRL_ALG_CTRL 0x1000 146 1.1 christos 147 1.1 christos # endif /* !EVP_MD */ 148 1.1 christos 149 1.1 christos /* values for EVP_MD_CTX flags */ 150 1.1 christos 151 1.1 christos # define EVP_MD_CTX_FLAG_ONESHOT 0x0001/* digest update will be 152 1.1 christos * called once only */ 153 1.1 christos # define EVP_MD_CTX_FLAG_CLEANED 0x0002/* context has already been 154 1.1 christos * cleaned */ 155 1.1 christos # define EVP_MD_CTX_FLAG_REUSE 0x0004/* Don't free up ctx->md_data 156 1.1 christos * in EVP_MD_CTX_reset */ 157 1.1 christos /* 158 1.1 christos * FIPS and pad options are ignored in 1.0.0, definitions are here so we 159 1.1 christos * don't accidentally reuse the values for other purposes. 160 1.1 christos */ 161 1.1 christos 162 1.1 christos # define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0x0008/* Allow use of non FIPS 163 1.1 christos * digest in FIPS mode */ 164 1.1 christos 165 1.1 christos /* 166 1.1 christos * The following PAD options are also currently ignored in 1.0.0, digest 167 1.1 christos * parameters are handled through EVP_DigestSign*() and EVP_DigestVerify*() 168 1.1 christos * instead. 169 1.1 christos */ 170 1.1 christos # define EVP_MD_CTX_FLAG_PAD_MASK 0xF0/* RSA mode to use */ 171 1.1 christos # define EVP_MD_CTX_FLAG_PAD_PKCS1 0x00/* PKCS#1 v1.5 mode */ 172 1.1 christos # define EVP_MD_CTX_FLAG_PAD_X931 0x10/* X9.31 mode */ 173 1.1 christos # define EVP_MD_CTX_FLAG_PAD_PSS 0x20/* PSS mode */ 174 1.1 christos 175 1.1 christos # define EVP_MD_CTX_FLAG_NO_INIT 0x0100/* Don't initialize md_data */ 176 1.1 christos /* 177 1.1 christos * Some functions such as EVP_DigestSign only finalise copies of internal 178 1.1 christos * contexts so additional data can be included after the finalisation call. 179 1.1 christos * This is inefficient if this functionality is not required: it is disabled 180 1.1 christos * if the following flag is set. 181 1.1 christos */ 182 1.1 christos # define EVP_MD_CTX_FLAG_FINALISE 0x0200 183 1.1 christos /* NOTE: 0x0400 is reserved for internal usage */ 184 1.1 christos 185 1.1 christos EVP_CIPHER *EVP_CIPHER_meth_new(int cipher_type, int block_size, int key_len); 186 1.1 christos EVP_CIPHER *EVP_CIPHER_meth_dup(const EVP_CIPHER *cipher); 187 1.1 christos void EVP_CIPHER_meth_free(EVP_CIPHER *cipher); 188 1.1 christos 189 1.1 christos int EVP_CIPHER_meth_set_iv_length(EVP_CIPHER *cipher, int iv_len); 190 1.1 christos int EVP_CIPHER_meth_set_flags(EVP_CIPHER *cipher, unsigned long flags); 191 1.1 christos int EVP_CIPHER_meth_set_impl_ctx_size(EVP_CIPHER *cipher, int ctx_size); 192 1.1 christos int EVP_CIPHER_meth_set_init(EVP_CIPHER *cipher, 193 1.1 christos int (*init) (EVP_CIPHER_CTX *ctx, 194 1.1 christos const unsigned char *key, 195 1.1 christos const unsigned char *iv, 196 1.1 christos int enc)); 197 1.1 christos int EVP_CIPHER_meth_set_do_cipher(EVP_CIPHER *cipher, 198 1.1 christos int (*do_cipher) (EVP_CIPHER_CTX *ctx, 199 1.1 christos unsigned char *out, 200 1.1 christos const unsigned char *in, 201 1.1 christos size_t inl)); 202 1.1 christos int EVP_CIPHER_meth_set_cleanup(EVP_CIPHER *cipher, 203 1.1 christos int (*cleanup) (EVP_CIPHER_CTX *)); 204 1.1 christos int EVP_CIPHER_meth_set_set_asn1_params(EVP_CIPHER *cipher, 205 1.1 christos int (*set_asn1_parameters) (EVP_CIPHER_CTX *, 206 1.1 christos ASN1_TYPE *)); 207 1.1 christos int EVP_CIPHER_meth_set_get_asn1_params(EVP_CIPHER *cipher, 208 1.1 christos int (*get_asn1_parameters) (EVP_CIPHER_CTX *, 209 1.1 christos ASN1_TYPE *)); 210 1.1 christos int EVP_CIPHER_meth_set_ctrl(EVP_CIPHER *cipher, 211 1.1 christos int (*ctrl) (EVP_CIPHER_CTX *, int type, 212 1.1 christos int arg, void *ptr)); 213 1.1 christos 214 1.1 christos int (*EVP_CIPHER_meth_get_init(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *ctx, 215 1.1 christos const unsigned char *key, 216 1.1 christos const unsigned char *iv, 217 1.1 christos int enc); 218 1.1 christos int (*EVP_CIPHER_meth_get_do_cipher(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *ctx, 219 1.1 christos unsigned char *out, 220 1.1 christos const unsigned char *in, 221 1.1 christos size_t inl); 222 1.1 christos int (*EVP_CIPHER_meth_get_cleanup(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *); 223 1.1 christos int (*EVP_CIPHER_meth_get_set_asn1_params(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *, 224 1.1 christos ASN1_TYPE *); 225 1.1 christos int (*EVP_CIPHER_meth_get_get_asn1_params(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *, 226 1.1 christos ASN1_TYPE *); 227 1.1 christos int (*EVP_CIPHER_meth_get_ctrl(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *, 228 1.1 christos int type, int arg, 229 1.1 christos void *ptr); 230 1.1 christos 231 1.1 christos /* Values for cipher flags */ 232 1.1 christos 233 1.1 christos /* Modes for ciphers */ 234 1.1 christos 235 1.1 christos # define EVP_CIPH_STREAM_CIPHER 0x0 236 1.1 christos # define EVP_CIPH_ECB_MODE 0x1 237 1.1 christos # define EVP_CIPH_CBC_MODE 0x2 238 1.1 christos # define EVP_CIPH_CFB_MODE 0x3 239 1.1 christos # define EVP_CIPH_OFB_MODE 0x4 240 1.1 christos # define EVP_CIPH_CTR_MODE 0x5 241 1.1 christos # define EVP_CIPH_GCM_MODE 0x6 242 1.1 christos # define EVP_CIPH_CCM_MODE 0x7 243 1.1 christos # define EVP_CIPH_XTS_MODE 0x10001 244 1.1 christos # define EVP_CIPH_WRAP_MODE 0x10002 245 1.1 christos # define EVP_CIPH_OCB_MODE 0x10003 246 1.1 christos # define EVP_CIPH_MODE 0xF0007 247 1.1 christos /* Set if variable length cipher */ 248 1.1 christos # define EVP_CIPH_VARIABLE_LENGTH 0x8 249 1.1 christos /* Set if the iv handling should be done by the cipher itself */ 250 1.1 christos # define EVP_CIPH_CUSTOM_IV 0x10 251 1.1 christos /* Set if the cipher's init() function should be called if key is NULL */ 252 1.1 christos # define EVP_CIPH_ALWAYS_CALL_INIT 0x20 253 1.1 christos /* Call ctrl() to init cipher parameters */ 254 1.1 christos # define EVP_CIPH_CTRL_INIT 0x40 255 1.1 christos /* Don't use standard key length function */ 256 1.1 christos # define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80 257 1.1 christos /* Don't use standard block padding */ 258 1.1 christos # define EVP_CIPH_NO_PADDING 0x100 259 1.1 christos /* cipher handles random key generation */ 260 1.1 christos # define EVP_CIPH_RAND_KEY 0x200 261 1.1 christos /* cipher has its own additional copying logic */ 262 1.1 christos # define EVP_CIPH_CUSTOM_COPY 0x400 263 1.1 christos /* Don't use standard iv length function */ 264 1.1 christos # define EVP_CIPH_CUSTOM_IV_LENGTH 0x800 265 1.1 christos /* Allow use default ASN1 get/set iv */ 266 1.1 christos # define EVP_CIPH_FLAG_DEFAULT_ASN1 0x1000 267 1.1 christos /* Buffer length in bits not bytes: CFB1 mode only */ 268 1.1 christos # define EVP_CIPH_FLAG_LENGTH_BITS 0x2000 269 1.1 christos /* Note if suitable for use in FIPS mode */ 270 1.1 christos # define EVP_CIPH_FLAG_FIPS 0x4000 271 1.1 christos /* Allow non FIPS cipher in FIPS mode */ 272 1.1 christos # define EVP_CIPH_FLAG_NON_FIPS_ALLOW 0x8000 273 1.1 christos /* 274 1.1 christos * Cipher handles any and all padding logic as well as finalisation. 275 1.1 christos */ 276 1.1 christos # define EVP_CIPH_FLAG_CUSTOM_CIPHER 0x100000 277 1.1 christos # define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000 278 1.1 christos # define EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK 0x400000 279 1.1 christos /* Cipher can handle pipeline operations */ 280 1.1 christos # define EVP_CIPH_FLAG_PIPELINE 0X800000 281 1.1 christos 282 1.1 christos /* 283 1.1 christos * Cipher context flag to indicate we can handle wrap mode: if allowed in 284 1.1 christos * older applications it could overflow buffers. 285 1.1 christos */ 286 1.1 christos 287 1.1 christos # define EVP_CIPHER_CTX_FLAG_WRAP_ALLOW 0x1 288 1.1 christos 289 1.1 christos /* ctrl() values */ 290 1.1 christos 291 1.1 christos # define EVP_CTRL_INIT 0x0 292 1.1 christos # define EVP_CTRL_SET_KEY_LENGTH 0x1 293 1.1 christos # define EVP_CTRL_GET_RC2_KEY_BITS 0x2 294 1.1 christos # define EVP_CTRL_SET_RC2_KEY_BITS 0x3 295 1.1 christos # define EVP_CTRL_GET_RC5_ROUNDS 0x4 296 1.1 christos # define EVP_CTRL_SET_RC5_ROUNDS 0x5 297 1.1 christos # define EVP_CTRL_RAND_KEY 0x6 298 1.1 christos # define EVP_CTRL_PBE_PRF_NID 0x7 299 1.1 christos # define EVP_CTRL_COPY 0x8 300 1.1 christos # define EVP_CTRL_AEAD_SET_IVLEN 0x9 301 1.1 christos # define EVP_CTRL_AEAD_GET_TAG 0x10 302 1.1 christos # define EVP_CTRL_AEAD_SET_TAG 0x11 303 1.1 christos # define EVP_CTRL_AEAD_SET_IV_FIXED 0x12 304 1.1 christos # define EVP_CTRL_GCM_SET_IVLEN EVP_CTRL_AEAD_SET_IVLEN 305 1.1 christos # define EVP_CTRL_GCM_GET_TAG EVP_CTRL_AEAD_GET_TAG 306 1.1 christos # define EVP_CTRL_GCM_SET_TAG EVP_CTRL_AEAD_SET_TAG 307 1.1 christos # define EVP_CTRL_GCM_SET_IV_FIXED EVP_CTRL_AEAD_SET_IV_FIXED 308 1.1 christos # define EVP_CTRL_GCM_IV_GEN 0x13 309 1.1 christos # define EVP_CTRL_CCM_SET_IVLEN EVP_CTRL_AEAD_SET_IVLEN 310 1.1 christos # define EVP_CTRL_CCM_GET_TAG EVP_CTRL_AEAD_GET_TAG 311 1.1 christos # define EVP_CTRL_CCM_SET_TAG EVP_CTRL_AEAD_SET_TAG 312 1.1 christos # define EVP_CTRL_CCM_SET_IV_FIXED EVP_CTRL_AEAD_SET_IV_FIXED 313 1.1 christos # define EVP_CTRL_CCM_SET_L 0x14 314 1.1 christos # define EVP_CTRL_CCM_SET_MSGLEN 0x15 315 1.1 christos /* 316 1.1 christos * AEAD cipher deduces payload length and returns number of bytes required to 317 1.1 christos * store MAC and eventual padding. Subsequent call to EVP_Cipher even 318 1.1 christos * appends/verifies MAC. 319 1.1 christos */ 320 1.1 christos # define EVP_CTRL_AEAD_TLS1_AAD 0x16 321 1.1 christos /* Used by composite AEAD ciphers, no-op in GCM, CCM... */ 322 1.1 christos # define EVP_CTRL_AEAD_SET_MAC_KEY 0x17 323 1.1 christos /* Set the GCM invocation field, decrypt only */ 324 1.1 christos # define EVP_CTRL_GCM_SET_IV_INV 0x18 325 1.1 christos 326 1.1 christos # define EVP_CTRL_TLS1_1_MULTIBLOCK_AAD 0x19 327 1.1 christos # define EVP_CTRL_TLS1_1_MULTIBLOCK_ENCRYPT 0x1a 328 1.1 christos # define EVP_CTRL_TLS1_1_MULTIBLOCK_DECRYPT 0x1b 329 1.1 christos # define EVP_CTRL_TLS1_1_MULTIBLOCK_MAX_BUFSIZE 0x1c 330 1.1 christos 331 1.1 christos # define EVP_CTRL_SSL3_MASTER_SECRET 0x1d 332 1.1 christos 333 1.1 christos /* EVP_CTRL_SET_SBOX takes the char * specifying S-boxes */ 334 1.1 christos # define EVP_CTRL_SET_SBOX 0x1e 335 1.1 christos /* 336 1.1 christos * EVP_CTRL_SBOX_USED takes a 'size_t' and 'char *', pointing at a 337 1.1 christos * pre-allocated buffer with specified size 338 1.1 christos */ 339 1.1 christos # define EVP_CTRL_SBOX_USED 0x1f 340 1.1 christos /* EVP_CTRL_KEY_MESH takes 'size_t' number of bytes to mesh the key after, 341 1.1 christos * 0 switches meshing off 342 1.1 christos */ 343 1.1 christos # define EVP_CTRL_KEY_MESH 0x20 344 1.1 christos /* EVP_CTRL_BLOCK_PADDING_MODE takes the padding mode */ 345 1.1 christos # define EVP_CTRL_BLOCK_PADDING_MODE 0x21 346 1.1 christos 347 1.1 christos /* Set the output buffers to use for a pipelined operation */ 348 1.1 christos # define EVP_CTRL_SET_PIPELINE_OUTPUT_BUFS 0x22 349 1.1 christos /* Set the input buffers to use for a pipelined operation */ 350 1.1 christos # define EVP_CTRL_SET_PIPELINE_INPUT_BUFS 0x23 351 1.1 christos /* Set the input buffer lengths to use for a pipelined operation */ 352 1.1 christos # define EVP_CTRL_SET_PIPELINE_INPUT_LENS 0x24 353 1.1 christos 354 1.1 christos # define EVP_CTRL_GET_IVLEN 0x25 355 1.1 christos 356 1.1 christos /* Padding modes */ 357 1.1 christos #define EVP_PADDING_PKCS7 1 358 1.1 christos #define EVP_PADDING_ISO7816_4 2 359 1.1 christos #define EVP_PADDING_ANSI923 3 360 1.1 christos #define EVP_PADDING_ISO10126 4 361 1.1 christos #define EVP_PADDING_ZERO 5 362 1.1 christos 363 1.1 christos /* RFC 5246 defines additional data to be 13 bytes in length */ 364 1.1 christos # define EVP_AEAD_TLS1_AAD_LEN 13 365 1.1 christos 366 1.1 christos typedef struct { 367 1.1 christos unsigned char *out; 368 1.1 christos const unsigned char *inp; 369 1.1 christos size_t len; 370 1.1 christos unsigned int interleave; 371 1.1 christos } EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM; 372 1.1 christos 373 1.1 christos /* GCM TLS constants */ 374 1.1 christos /* Length of fixed part of IV derived from PRF */ 375 1.1 christos # define EVP_GCM_TLS_FIXED_IV_LEN 4 376 1.1 christos /* Length of explicit part of IV part of TLS records */ 377 1.1 christos # define EVP_GCM_TLS_EXPLICIT_IV_LEN 8 378 1.1 christos /* Length of tag for TLS */ 379 1.1 christos # define EVP_GCM_TLS_TAG_LEN 16 380 1.1 christos 381 1.1 christos /* CCM TLS constants */ 382 1.1 christos /* Length of fixed part of IV derived from PRF */ 383 1.1 christos # define EVP_CCM_TLS_FIXED_IV_LEN 4 384 1.1 christos /* Length of explicit part of IV part of TLS records */ 385 1.1 christos # define EVP_CCM_TLS_EXPLICIT_IV_LEN 8 386 1.1 christos /* Total length of CCM IV length for TLS */ 387 1.1 christos # define EVP_CCM_TLS_IV_LEN 12 388 1.1 christos /* Length of tag for TLS */ 389 1.1 christos # define EVP_CCM_TLS_TAG_LEN 16 390 1.1 christos /* Length of CCM8 tag for TLS */ 391 1.1 christos # define EVP_CCM8_TLS_TAG_LEN 8 392 1.1 christos 393 1.1 christos /* Length of tag for TLS */ 394 1.1 christos # define EVP_CHACHAPOLY_TLS_TAG_LEN 16 395 1.1 christos 396 1.1 christos typedef struct evp_cipher_info_st { 397 1.1 christos const EVP_CIPHER *cipher; 398 1.1 christos unsigned char iv[EVP_MAX_IV_LENGTH]; 399 1.1 christos } EVP_CIPHER_INFO; 400 1.1 christos 401 1.1 christos 402 1.1 christos /* Password based encryption function */ 403 1.1 christos typedef int (EVP_PBE_KEYGEN) (EVP_CIPHER_CTX *ctx, const char *pass, 404 1.1 christos int passlen, ASN1_TYPE *param, 405 1.1 christos const EVP_CIPHER *cipher, const EVP_MD *md, 406 1.1 christos int en_de); 407 1.1 christos 408 1.1 christos # ifndef OPENSSL_NO_RSA 409 1.1 christos # define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\ 410 1.1 christos (char *)(rsa)) 411 1.1 christos # endif 412 1.1 christos 413 1.1 christos # ifndef OPENSSL_NO_DSA 414 1.1 christos # define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\ 415 1.1 christos (char *)(dsa)) 416 1.1 christos # endif 417 1.1 christos 418 1.1 christos # ifndef OPENSSL_NO_DH 419 1.1 christos # define EVP_PKEY_assign_DH(pkey,dh) EVP_PKEY_assign((pkey),EVP_PKEY_DH,\ 420 1.1 christos (char *)(dh)) 421 1.1 christos # endif 422 1.1 christos 423 1.1 christos # ifndef OPENSSL_NO_EC 424 1.1 christos # define EVP_PKEY_assign_EC_KEY(pkey,eckey) EVP_PKEY_assign((pkey),EVP_PKEY_EC,\ 425 1.1 christos (char *)(eckey)) 426 1.1 christos # endif 427 1.1 christos # ifndef OPENSSL_NO_SIPHASH 428 1.1 christos # define EVP_PKEY_assign_SIPHASH(pkey,shkey) EVP_PKEY_assign((pkey),EVP_PKEY_SIPHASH,\ 429 1.1 christos (char *)(shkey)) 430 1.1 christos # endif 431 1.1 christos 432 1.1 christos # ifndef OPENSSL_NO_POLY1305 433 1.1 christos # define EVP_PKEY_assign_POLY1305(pkey,polykey) EVP_PKEY_assign((pkey),EVP_PKEY_POLY1305,\ 434 1.1 christos (char *)(polykey)) 435 1.1 christos # endif 436 1.1 christos 437 1.1 christos /* Add some extra combinations */ 438 1.1 christos # define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a)) 439 1.1 christos # define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a)) 440 1.1 christos # define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a)) 441 1.1 christos # define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a)) 442 1.1 christos 443 1.1 christos int EVP_MD_type(const EVP_MD *md); 444 1.1 christos # define EVP_MD_nid(e) EVP_MD_type(e) 445 1.1 christos # define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e)) 446 1.1 christos int EVP_MD_pkey_type(const EVP_MD *md); 447 1.1 christos int EVP_MD_size(const EVP_MD *md); 448 1.1 christos int EVP_MD_block_size(const EVP_MD *md); 449 1.1 christos unsigned long EVP_MD_flags(const EVP_MD *md); 450 1.1 christos 451 1.1 christos const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx); 452 1.1 christos int (*EVP_MD_CTX_update_fn(EVP_MD_CTX *ctx))(EVP_MD_CTX *ctx, 453 1.1 christos const void *data, size_t count); 454 1.1 christos void EVP_MD_CTX_set_update_fn(EVP_MD_CTX *ctx, 455 1.1 christos int (*update) (EVP_MD_CTX *ctx, 456 1.1 christos const void *data, size_t count)); 457 1.1 christos # define EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e)) 458 1.1 christos # define EVP_MD_CTX_block_size(e) EVP_MD_block_size(EVP_MD_CTX_md(e)) 459 1.1 christos # define EVP_MD_CTX_type(e) EVP_MD_type(EVP_MD_CTX_md(e)) 460 1.1 christos EVP_PKEY_CTX *EVP_MD_CTX_pkey_ctx(const EVP_MD_CTX *ctx); 461 1.1 christos void EVP_MD_CTX_set_pkey_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pctx); 462 1.1 christos void *EVP_MD_CTX_md_data(const EVP_MD_CTX *ctx); 463 1.1 christos 464 1.1 christos int EVP_CIPHER_nid(const EVP_CIPHER *cipher); 465 1.1 christos # define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e)) 466 1.1 christos int EVP_CIPHER_block_size(const EVP_CIPHER *cipher); 467 1.1 christos int EVP_CIPHER_impl_ctx_size(const EVP_CIPHER *cipher); 468 1.1 christos int EVP_CIPHER_key_length(const EVP_CIPHER *cipher); 469 1.1 christos int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher); 470 1.1 christos unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher); 471 1.1 christos # define EVP_CIPHER_mode(e) (EVP_CIPHER_flags(e) & EVP_CIPH_MODE) 472 1.1 christos 473 1.1 christos const EVP_CIPHER *EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx); 474 1.1 christos int EVP_CIPHER_CTX_encrypting(const EVP_CIPHER_CTX *ctx); 475 1.1 christos int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx); 476 1.1 christos int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx); 477 1.1 christos int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx); 478 1.1 christos int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx); 479 1.1 christos const unsigned char *EVP_CIPHER_CTX_iv(const EVP_CIPHER_CTX *ctx); 480 1.1 christos const unsigned char *EVP_CIPHER_CTX_original_iv(const EVP_CIPHER_CTX *ctx); 481 1.1 christos unsigned char *EVP_CIPHER_CTX_iv_noconst(EVP_CIPHER_CTX *ctx); 482 1.1 christos unsigned char *EVP_CIPHER_CTX_buf_noconst(EVP_CIPHER_CTX *ctx); 483 1.1 christos int EVP_CIPHER_CTX_num(const EVP_CIPHER_CTX *ctx); 484 1.1 christos void EVP_CIPHER_CTX_set_num(EVP_CIPHER_CTX *ctx, int num); 485 1.1 christos int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in); 486 1.1 christos void *EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx); 487 1.1 christos void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data); 488 1.1 christos void *EVP_CIPHER_CTX_get_cipher_data(const EVP_CIPHER_CTX *ctx); 489 1.1 christos void *EVP_CIPHER_CTX_set_cipher_data(EVP_CIPHER_CTX *ctx, void *cipher_data); 490 1.1 christos # define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) 491 1.1 christos # if OPENSSL_API_COMPAT < 0x10100000L 492 1.1 christos # define EVP_CIPHER_CTX_flags(c) EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(c)) 493 1.1 christos # endif 494 1.1 christos # define EVP_CIPHER_CTX_mode(c) EVP_CIPHER_mode(EVP_CIPHER_CTX_cipher(c)) 495 1.1 christos 496 1.1 christos # define EVP_ENCODE_LENGTH(l) ((((l)+2)/3*4)+((l)/48+1)*2+80) 497 1.1 christos # define EVP_DECODE_LENGTH(l) (((l)+3)/4*3+80) 498 1.1 christos 499 1.1 christos # define EVP_SignInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c) 500 1.1 christos # define EVP_SignInit(a,b) EVP_DigestInit(a,b) 501 1.1 christos # define EVP_SignUpdate(a,b,c) EVP_DigestUpdate(a,b,c) 502 1.1 christos # define EVP_VerifyInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c) 503 1.1 christos # define EVP_VerifyInit(a,b) EVP_DigestInit(a,b) 504 1.1 christos # define EVP_VerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c) 505 1.1 christos # define EVP_OpenUpdate(a,b,c,d,e) EVP_DecryptUpdate(a,b,c,d,e) 506 1.1 christos # define EVP_SealUpdate(a,b,c,d,e) EVP_EncryptUpdate(a,b,c,d,e) 507 1.1 christos # define EVP_DigestSignUpdate(a,b,c) EVP_DigestUpdate(a,b,c) 508 1.1 christos # define EVP_DigestVerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c) 509 1.1 christos 510 1.1 christos # ifdef CONST_STRICT 511 1.1 christos void BIO_set_md(BIO *, const EVP_MD *md); 512 1.1 christos # else 513 1.1 christos # define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(char *)(md)) 514 1.1 christos # endif 515 1.1 christos # define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(char *)(mdp)) 516 1.1 christos # define BIO_get_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_GET_MD_CTX,0, \ 517 1.1 christos (char *)(mdcp)) 518 1.1 christos # define BIO_set_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_SET_MD_CTX,0, \ 519 1.1 christos (char *)(mdcp)) 520 1.1 christos # define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL) 521 1.1 christos # define BIO_get_cipher_ctx(b,c_pp) BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0, \ 522 1.1 christos (char *)(c_pp)) 523 1.1 christos 524 1.1 christos /*__owur*/ int EVP_Cipher(EVP_CIPHER_CTX *c, 525 1.1 christos unsigned char *out, 526 1.1 christos const unsigned char *in, unsigned int inl); 527 1.1 christos 528 1.1 christos # define EVP_add_cipher_alias(n,alias) \ 529 1.1 christos OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n)) 530 1.1 christos # define EVP_add_digest_alias(n,alias) \ 531 1.1 christos OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n)) 532 1.1 christos # define EVP_delete_cipher_alias(alias) \ 533 1.1 christos OBJ_NAME_remove(alias,OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS); 534 1.1 christos # define EVP_delete_digest_alias(alias) \ 535 1.1 christos OBJ_NAME_remove(alias,OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS); 536 1.1 christos 537 1.1 christos int EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void *p2); 538 1.1 christos EVP_MD_CTX *EVP_MD_CTX_new(void); 539 1.1 christos int EVP_MD_CTX_reset(EVP_MD_CTX *ctx); 540 1.1 christos void EVP_MD_CTX_free(EVP_MD_CTX *ctx); 541 1.1 christos # define EVP_MD_CTX_create() EVP_MD_CTX_new() 542 1.1 christos # define EVP_MD_CTX_init(ctx) EVP_MD_CTX_reset((ctx)) 543 1.1 christos # define EVP_MD_CTX_destroy(ctx) EVP_MD_CTX_free((ctx)) 544 1.1 christos __owur int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in); 545 1.1 christos void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags); 546 1.1 christos void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags); 547 1.1 christos int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags); 548 1.1 christos __owur int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, 549 1.1 christos ENGINE *impl); 550 1.1 christos __owur int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, 551 1.1 christos size_t cnt); 552 1.1 christos __owur int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, 553 1.1 christos unsigned int *s); 554 1.1 christos __owur int EVP_Digest(const void *data, size_t count, 555 1.1 christos unsigned char *md, unsigned int *size, 556 1.1 christos const EVP_MD *type, ENGINE *impl); 557 1.1 christos 558 1.1 christos __owur int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in); 559 1.1 christos __owur int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type); 560 1.1 christos __owur int EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, 561 1.1 christos unsigned int *s); 562 1.1 christos __owur int EVP_DigestFinalXOF(EVP_MD_CTX *ctx, unsigned char *md, 563 1.1 christos size_t len); 564 1.1 christos 565 1.1 christos int EVP_read_pw_string(char *buf, int length, const char *prompt, int verify); 566 1.1 christos int EVP_read_pw_string_min(char *buf, int minlen, int maxlen, 567 1.1 christos const char *prompt, int verify); 568 1.1 christos void EVP_set_pw_prompt(const char *prompt); 569 1.1 christos char *EVP_get_pw_prompt(void); 570 1.1 christos 571 1.1 christos __owur int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md, 572 1.1 christos const unsigned char *salt, 573 1.1 christos const unsigned char *data, int datal, int count, 574 1.1 christos unsigned char *key, unsigned char *iv); 575 1.1 christos 576 1.1 christos void EVP_CIPHER_CTX_set_flags(EVP_CIPHER_CTX *ctx, int flags); 577 1.1 christos void EVP_CIPHER_CTX_clear_flags(EVP_CIPHER_CTX *ctx, int flags); 578 1.1 christos int EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx, int flags); 579 1.1 christos 580 1.1 christos __owur int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, 581 1.1 christos const unsigned char *key, const unsigned char *iv); 582 1.1 christos /*__owur*/ int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx, 583 1.1 christos const EVP_CIPHER *cipher, ENGINE *impl, 584 1.1 christos const unsigned char *key, 585 1.1 christos const unsigned char *iv); 586 1.1 christos /*__owur*/ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 587 1.1 christos int *outl, const unsigned char *in, int inl); 588 1.1 christos /*__owur*/ int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, 589 1.1 christos int *outl); 590 1.1 christos /*__owur*/ int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, 591 1.1 christos int *outl); 592 1.1 christos 593 1.1 christos __owur int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, 594 1.1 christos const unsigned char *key, const unsigned char *iv); 595 1.1 christos /*__owur*/ int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, 596 1.1 christos const EVP_CIPHER *cipher, ENGINE *impl, 597 1.1 christos const unsigned char *key, 598 1.1 christos const unsigned char *iv); 599 1.1 christos /*__owur*/ int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 600 1.1 christos int *outl, const unsigned char *in, int inl); 601 1.1 christos __owur int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, 602 1.1 christos int *outl); 603 1.1 christos /*__owur*/ int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, 604 1.1 christos int *outl); 605 1.1 christos 606 1.1 christos __owur int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, 607 1.1 christos const unsigned char *key, const unsigned char *iv, 608 1.1 christos int enc); 609 1.1 christos /*__owur*/ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, 610 1.1 christos const EVP_CIPHER *cipher, ENGINE *impl, 611 1.1 christos const unsigned char *key, 612 1.1 christos const unsigned char *iv, int enc); 613 1.1 christos __owur int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 614 1.1 christos int *outl, const unsigned char *in, int inl); 615 1.1 christos __owur int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, 616 1.1 christos int *outl); 617 1.1 christos __owur int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, 618 1.1 christos int *outl); 619 1.1 christos 620 1.1 christos __owur int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s, 621 1.1 christos EVP_PKEY *pkey); 622 1.1 christos 623 1.1 christos __owur int EVP_DigestSign(EVP_MD_CTX *ctx, unsigned char *sigret, 624 1.1 christos size_t *siglen, const unsigned char *tbs, 625 1.1 christos size_t tbslen); 626 1.1 christos 627 1.1 christos __owur int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf, 628 1.1 christos unsigned int siglen, EVP_PKEY *pkey); 629 1.1 christos 630 1.1 christos __owur int EVP_DigestVerify(EVP_MD_CTX *ctx, const unsigned char *sigret, 631 1.1 christos size_t siglen, const unsigned char *tbs, 632 1.1 christos size_t tbslen); 633 1.1 christos 634 1.1 christos /*__owur*/ int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, 635 1.1 christos const EVP_MD *type, ENGINE *e, 636 1.1 christos EVP_PKEY *pkey); 637 1.1 christos __owur int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, 638 1.1 christos size_t *siglen); 639 1.1 christos 640 1.1 christos __owur int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, 641 1.1 christos const EVP_MD *type, ENGINE *e, 642 1.1 christos EVP_PKEY *pkey); 643 1.1 christos __owur int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig, 644 1.1 christos size_t siglen); 645 1.1 christos 646 1.1 christos # ifndef OPENSSL_NO_RSA 647 1.1 christos __owur int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, 648 1.1 christos const unsigned char *ek, int ekl, 649 1.1 christos const unsigned char *iv, EVP_PKEY *priv); 650 1.1 christos __owur int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); 651 1.1 christos 652 1.1 christos __owur int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, 653 1.1 christos unsigned char **ek, int *ekl, unsigned char *iv, 654 1.1 christos EVP_PKEY **pubk, int npubk); 655 1.1 christos __owur int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); 656 1.1 christos # endif 657 1.1 christos 658 1.1 christos EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void); 659 1.1 christos void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx); 660 1.1 christos int EVP_ENCODE_CTX_copy(EVP_ENCODE_CTX *dctx, EVP_ENCODE_CTX *sctx); 661 1.1 christos int EVP_ENCODE_CTX_num(EVP_ENCODE_CTX *ctx); 662 1.1 christos void EVP_EncodeInit(EVP_ENCODE_CTX *ctx); 663 1.1 christos int EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, 664 1.1 christos const unsigned char *in, int inl); 665 1.1 christos void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl); 666 1.1 christos int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int n); 667 1.1 christos 668 1.1 christos void EVP_DecodeInit(EVP_ENCODE_CTX *ctx); 669 1.1 christos int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, 670 1.1 christos const unsigned char *in, int inl); 671 1.1 christos int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned 672 1.1 christos char *out, int *outl); 673 1.1 christos int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n); 674 1.1 christos 675 1.1 christos # if OPENSSL_API_COMPAT < 0x10100000L 676 1.1 christos # define EVP_CIPHER_CTX_init(c) EVP_CIPHER_CTX_reset(c) 677 1.1 christos # define EVP_CIPHER_CTX_cleanup(c) EVP_CIPHER_CTX_reset(c) 678 1.1 christos # endif 679 1.1 christos EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void); 680 1.1 christos int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *c); 681 1.1 christos void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *c); 682 1.1 christos int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen); 683 1.1 christos int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *c, int pad); 684 1.1 christos int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr); 685 1.1 christos int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key); 686 1.1 christos 687 1.1 christos const BIO_METHOD *BIO_f_md(void); 688 1.1 christos const BIO_METHOD *BIO_f_base64(void); 689 1.1 christos const BIO_METHOD *BIO_f_cipher(void); 690 1.1 christos const BIO_METHOD *BIO_f_reliable(void); 691 1.1 christos __owur int BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k, 692 1.1 christos const unsigned char *i, int enc); 693 1.1 christos 694 1.1 christos const EVP_MD *EVP_md_null(void); 695 1.1 christos # ifndef OPENSSL_NO_MD2 696 1.1 christos const EVP_MD *EVP_md2(void); 697 1.1 christos # endif 698 1.1 christos # ifndef OPENSSL_NO_MD4 699 1.1 christos const EVP_MD *EVP_md4(void); 700 1.1 christos # endif 701 1.1 christos # ifndef OPENSSL_NO_MD5 702 1.1 christos const EVP_MD *EVP_md5(void); 703 1.1 christos const EVP_MD *EVP_md5_sha1(void); 704 1.1 christos # endif 705 1.1 christos # ifndef OPENSSL_NO_BLAKE2 706 1.1 christos const EVP_MD *EVP_blake2b512(void); 707 1.1 christos const EVP_MD *EVP_blake2s256(void); 708 1.1 christos # endif 709 1.1 christos const EVP_MD *EVP_sha1(void); 710 1.1 christos const EVP_MD *EVP_sha224(void); 711 1.1 christos const EVP_MD *EVP_sha256(void); 712 1.1 christos const EVP_MD *EVP_sha384(void); 713 1.1 christos const EVP_MD *EVP_sha512(void); 714 1.1 christos const EVP_MD *EVP_sha512_224(void); 715 1.1 christos const EVP_MD *EVP_sha512_256(void); 716 1.1 christos const EVP_MD *EVP_sha3_224(void); 717 1.1 christos const EVP_MD *EVP_sha3_256(void); 718 1.1 christos const EVP_MD *EVP_sha3_384(void); 719 1.1 christos const EVP_MD *EVP_sha3_512(void); 720 1.1 christos const EVP_MD *EVP_shake128(void); 721 1.1 christos const EVP_MD *EVP_shake256(void); 722 1.1 christos # ifndef OPENSSL_NO_MDC2 723 1.1 christos const EVP_MD *EVP_mdc2(void); 724 1.1 christos # endif 725 1.1 christos # ifndef OPENSSL_NO_RMD160 726 1.1 christos const EVP_MD *EVP_ripemd160(void); 727 1.1 christos # endif 728 1.1 christos # ifndef OPENSSL_NO_WHIRLPOOL 729 1.1 christos const EVP_MD *EVP_whirlpool(void); 730 1.1 christos # endif 731 1.1 christos # ifndef OPENSSL_NO_SM3 732 1.1 christos const EVP_MD *EVP_sm3(void); 733 1.1 christos # endif 734 1.1 christos const EVP_CIPHER *EVP_enc_null(void); /* does nothing :-) */ 735 1.1 christos # ifndef OPENSSL_NO_DES 736 1.1 christos const EVP_CIPHER *EVP_des_ecb(void); 737 1.1 christos const EVP_CIPHER *EVP_des_ede(void); 738 1.1 christos const EVP_CIPHER *EVP_des_ede3(void); 739 1.1 christos const EVP_CIPHER *EVP_des_ede_ecb(void); 740 1.1 christos const EVP_CIPHER *EVP_des_ede3_ecb(void); 741 1.1 christos const EVP_CIPHER *EVP_des_cfb64(void); 742 1.1 christos # define EVP_des_cfb EVP_des_cfb64 743 1.1 christos const EVP_CIPHER *EVP_des_cfb1(void); 744 1.1 christos const EVP_CIPHER *EVP_des_cfb8(void); 745 1.1 christos const EVP_CIPHER *EVP_des_ede_cfb64(void); 746 1.1 christos # define EVP_des_ede_cfb EVP_des_ede_cfb64 747 1.1 christos const EVP_CIPHER *EVP_des_ede3_cfb64(void); 748 1.1 christos # define EVP_des_ede3_cfb EVP_des_ede3_cfb64 749 1.1 christos const EVP_CIPHER *EVP_des_ede3_cfb1(void); 750 1.1 christos const EVP_CIPHER *EVP_des_ede3_cfb8(void); 751 1.1 christos const EVP_CIPHER *EVP_des_ofb(void); 752 1.1 christos const EVP_CIPHER *EVP_des_ede_ofb(void); 753 1.1 christos const EVP_CIPHER *EVP_des_ede3_ofb(void); 754 1.1 christos const EVP_CIPHER *EVP_des_cbc(void); 755 1.1 christos const EVP_CIPHER *EVP_des_ede_cbc(void); 756 1.1 christos const EVP_CIPHER *EVP_des_ede3_cbc(void); 757 1.1 christos const EVP_CIPHER *EVP_desx_cbc(void); 758 1.1 christos const EVP_CIPHER *EVP_des_ede3_wrap(void); 759 1.1 christos /* 760 1.1 christos * This should now be supported through the dev_crypto ENGINE. But also, why 761 1.1 christos * are rc4 and md5 declarations made here inside a "NO_DES" precompiler 762 1.1 christos * branch? 763 1.1 christos */ 764 1.1 christos # endif 765 1.1 christos # ifndef OPENSSL_NO_RC4 766 1.1 christos const EVP_CIPHER *EVP_rc4(void); 767 1.1 christos const EVP_CIPHER *EVP_rc4_40(void); 768 1.1 christos # ifndef OPENSSL_NO_MD5 769 1.1 christos const EVP_CIPHER *EVP_rc4_hmac_md5(void); 770 1.1 christos # endif 771 1.1 christos # endif 772 1.1 christos # ifndef OPENSSL_NO_IDEA 773 1.1 christos const EVP_CIPHER *EVP_idea_ecb(void); 774 1.1 christos const EVP_CIPHER *EVP_idea_cfb64(void); 775 1.1 christos # define EVP_idea_cfb EVP_idea_cfb64 776 1.1 christos const EVP_CIPHER *EVP_idea_ofb(void); 777 1.1 christos const EVP_CIPHER *EVP_idea_cbc(void); 778 1.1 christos # endif 779 1.1 christos # ifndef OPENSSL_NO_RC2 780 1.1 christos const EVP_CIPHER *EVP_rc2_ecb(void); 781 1.1 christos const EVP_CIPHER *EVP_rc2_cbc(void); 782 1.1 christos const EVP_CIPHER *EVP_rc2_40_cbc(void); 783 1.1 christos const EVP_CIPHER *EVP_rc2_64_cbc(void); 784 1.1 christos const EVP_CIPHER *EVP_rc2_cfb64(void); 785 1.1 christos # define EVP_rc2_cfb EVP_rc2_cfb64 786 1.1 christos const EVP_CIPHER *EVP_rc2_ofb(void); 787 1.1 christos # endif 788 1.1 christos # ifndef OPENSSL_NO_BF 789 1.1 christos const EVP_CIPHER *EVP_bf_ecb(void); 790 1.1 christos const EVP_CIPHER *EVP_bf_cbc(void); 791 1.1 christos const EVP_CIPHER *EVP_bf_cfb64(void); 792 1.1 christos # define EVP_bf_cfb EVP_bf_cfb64 793 1.1 christos const EVP_CIPHER *EVP_bf_ofb(void); 794 1.1 christos # endif 795 1.1 christos # ifndef OPENSSL_NO_CAST 796 1.1 christos const EVP_CIPHER *EVP_cast5_ecb(void); 797 1.1 christos const EVP_CIPHER *EVP_cast5_cbc(void); 798 1.1 christos const EVP_CIPHER *EVP_cast5_cfb64(void); 799 1.1 christos # define EVP_cast5_cfb EVP_cast5_cfb64 800 1.1 christos const EVP_CIPHER *EVP_cast5_ofb(void); 801 1.1 christos # endif 802 1.1 christos # ifndef OPENSSL_NO_RC5 803 1.1 christos const EVP_CIPHER *EVP_rc5_32_12_16_cbc(void); 804 1.1 christos const EVP_CIPHER *EVP_rc5_32_12_16_ecb(void); 805 1.1 christos const EVP_CIPHER *EVP_rc5_32_12_16_cfb64(void); 806 1.1 christos # define EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64 807 1.1 christos const EVP_CIPHER *EVP_rc5_32_12_16_ofb(void); 808 1.1 christos # endif 809 1.1 christos const EVP_CIPHER *EVP_aes_128_ecb(void); 810 1.1 christos const EVP_CIPHER *EVP_aes_128_cbc(void); 811 1.1 christos const EVP_CIPHER *EVP_aes_128_cfb1(void); 812 1.1 christos const EVP_CIPHER *EVP_aes_128_cfb8(void); 813 1.1 christos const EVP_CIPHER *EVP_aes_128_cfb128(void); 814 1.1 christos # define EVP_aes_128_cfb EVP_aes_128_cfb128 815 1.1 christos const EVP_CIPHER *EVP_aes_128_ofb(void); 816 1.1 christos const EVP_CIPHER *EVP_aes_128_ctr(void); 817 1.1 christos const EVP_CIPHER *EVP_aes_128_ccm(void); 818 1.1 christos const EVP_CIPHER *EVP_aes_128_gcm(void); 819 1.1 christos const EVP_CIPHER *EVP_aes_128_xts(void); 820 1.1 christos const EVP_CIPHER *EVP_aes_128_wrap(void); 821 1.1 christos const EVP_CIPHER *EVP_aes_128_wrap_pad(void); 822 1.1 christos # ifndef OPENSSL_NO_OCB 823 1.1 christos const EVP_CIPHER *EVP_aes_128_ocb(void); 824 1.1 christos # endif 825 1.1 christos const EVP_CIPHER *EVP_aes_192_ecb(void); 826 1.1 christos const EVP_CIPHER *EVP_aes_192_cbc(void); 827 1.1 christos const EVP_CIPHER *EVP_aes_192_cfb1(void); 828 1.1 christos const EVP_CIPHER *EVP_aes_192_cfb8(void); 829 1.1 christos const EVP_CIPHER *EVP_aes_192_cfb128(void); 830 1.1 christos # define EVP_aes_192_cfb EVP_aes_192_cfb128 831 1.1 christos const EVP_CIPHER *EVP_aes_192_ofb(void); 832 1.1 christos const EVP_CIPHER *EVP_aes_192_ctr(void); 833 1.1 christos const EVP_CIPHER *EVP_aes_192_ccm(void); 834 1.1 christos const EVP_CIPHER *EVP_aes_192_gcm(void); 835 1.1 christos const EVP_CIPHER *EVP_aes_192_wrap(void); 836 1.1 christos const EVP_CIPHER *EVP_aes_192_wrap_pad(void); 837 1.1 christos # ifndef OPENSSL_NO_OCB 838 1.1 christos const EVP_CIPHER *EVP_aes_192_ocb(void); 839 1.1 christos # endif 840 1.1 christos const EVP_CIPHER *EVP_aes_256_ecb(void); 841 1.1 christos const EVP_CIPHER *EVP_aes_256_cbc(void); 842 1.1 christos const EVP_CIPHER *EVP_aes_256_cfb1(void); 843 1.1 christos const EVP_CIPHER *EVP_aes_256_cfb8(void); 844 1.1 christos const EVP_CIPHER *EVP_aes_256_cfb128(void); 845 1.1 christos # define EVP_aes_256_cfb EVP_aes_256_cfb128 846 1.1 christos const EVP_CIPHER *EVP_aes_256_ofb(void); 847 1.1 christos const EVP_CIPHER *EVP_aes_256_ctr(void); 848 1.1 christos const EVP_CIPHER *EVP_aes_256_ccm(void); 849 1.1 christos const EVP_CIPHER *EVP_aes_256_gcm(void); 850 1.1 christos const EVP_CIPHER *EVP_aes_256_xts(void); 851 1.1 christos const EVP_CIPHER *EVP_aes_256_wrap(void); 852 1.1 christos const EVP_CIPHER *EVP_aes_256_wrap_pad(void); 853 1.1 christos # ifndef OPENSSL_NO_OCB 854 1.1 christos const EVP_CIPHER *EVP_aes_256_ocb(void); 855 1.1 christos # endif 856 1.1 christos const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha1(void); 857 1.1 christos const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha1(void); 858 1.1 christos const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha256(void); 859 1.1 christos const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha256(void); 860 1.1 christos # ifndef OPENSSL_NO_ARIA 861 1.1 christos const EVP_CIPHER *EVP_aria_128_ecb(void); 862 1.1 christos const EVP_CIPHER *EVP_aria_128_cbc(void); 863 1.1 christos const EVP_CIPHER *EVP_aria_128_cfb1(void); 864 1.1 christos const EVP_CIPHER *EVP_aria_128_cfb8(void); 865 1.1 christos const EVP_CIPHER *EVP_aria_128_cfb128(void); 866 1.1 christos # define EVP_aria_128_cfb EVP_aria_128_cfb128 867 1.1 christos const EVP_CIPHER *EVP_aria_128_ctr(void); 868 1.1 christos const EVP_CIPHER *EVP_aria_128_ofb(void); 869 1.1 christos const EVP_CIPHER *EVP_aria_128_gcm(void); 870 1.1 christos const EVP_CIPHER *EVP_aria_128_ccm(void); 871 1.1 christos const EVP_CIPHER *EVP_aria_192_ecb(void); 872 1.1 christos const EVP_CIPHER *EVP_aria_192_cbc(void); 873 1.1 christos const EVP_CIPHER *EVP_aria_192_cfb1(void); 874 1.1 christos const EVP_CIPHER *EVP_aria_192_cfb8(void); 875 1.1 christos const EVP_CIPHER *EVP_aria_192_cfb128(void); 876 1.1 christos # define EVP_aria_192_cfb EVP_aria_192_cfb128 877 1.1 christos const EVP_CIPHER *EVP_aria_192_ctr(void); 878 1.1 christos const EVP_CIPHER *EVP_aria_192_ofb(void); 879 1.1 christos const EVP_CIPHER *EVP_aria_192_gcm(void); 880 1.1 christos const EVP_CIPHER *EVP_aria_192_ccm(void); 881 1.1 christos const EVP_CIPHER *EVP_aria_256_ecb(void); 882 1.1 christos const EVP_CIPHER *EVP_aria_256_cbc(void); 883 1.1 christos const EVP_CIPHER *EVP_aria_256_cfb1(void); 884 1.1 christos const EVP_CIPHER *EVP_aria_256_cfb8(void); 885 1.1 christos const EVP_CIPHER *EVP_aria_256_cfb128(void); 886 1.1 christos # define EVP_aria_256_cfb EVP_aria_256_cfb128 887 1.1 christos const EVP_CIPHER *EVP_aria_256_ctr(void); 888 1.1 christos const EVP_CIPHER *EVP_aria_256_ofb(void); 889 1.1 christos const EVP_CIPHER *EVP_aria_256_gcm(void); 890 1.1 christos const EVP_CIPHER *EVP_aria_256_ccm(void); 891 1.1 christos # endif 892 1.1 christos # ifndef OPENSSL_NO_CAMELLIA 893 1.1 christos const EVP_CIPHER *EVP_camellia_128_ecb(void); 894 1.1 christos const EVP_CIPHER *EVP_camellia_128_cbc(void); 895 1.1 christos const EVP_CIPHER *EVP_camellia_128_cfb1(void); 896 1.1 christos const EVP_CIPHER *EVP_camellia_128_cfb8(void); 897 1.1 christos const EVP_CIPHER *EVP_camellia_128_cfb128(void); 898 1.1 christos # define EVP_camellia_128_cfb EVP_camellia_128_cfb128 899 1.1 christos const EVP_CIPHER *EVP_camellia_128_ofb(void); 900 1.1 christos const EVP_CIPHER *EVP_camellia_128_ctr(void); 901 1.1 christos const EVP_CIPHER *EVP_camellia_192_ecb(void); 902 1.1 christos const EVP_CIPHER *EVP_camellia_192_cbc(void); 903 1.1 christos const EVP_CIPHER *EVP_camellia_192_cfb1(void); 904 1.1 christos const EVP_CIPHER *EVP_camellia_192_cfb8(void); 905 1.1 christos const EVP_CIPHER *EVP_camellia_192_cfb128(void); 906 1.1 christos # define EVP_camellia_192_cfb EVP_camellia_192_cfb128 907 1.1 christos const EVP_CIPHER *EVP_camellia_192_ofb(void); 908 1.1 christos const EVP_CIPHER *EVP_camellia_192_ctr(void); 909 1.1 christos const EVP_CIPHER *EVP_camellia_256_ecb(void); 910 1.1 christos const EVP_CIPHER *EVP_camellia_256_cbc(void); 911 1.1 christos const EVP_CIPHER *EVP_camellia_256_cfb1(void); 912 1.1 christos const EVP_CIPHER *EVP_camellia_256_cfb8(void); 913 1.1 christos const EVP_CIPHER *EVP_camellia_256_cfb128(void); 914 1.1 christos # define EVP_camellia_256_cfb EVP_camellia_256_cfb128 915 1.1 christos const EVP_CIPHER *EVP_camellia_256_ofb(void); 916 1.1 christos const EVP_CIPHER *EVP_camellia_256_ctr(void); 917 1.1 christos # endif 918 1.1 christos # ifndef OPENSSL_NO_CHACHA 919 1.1 christos const EVP_CIPHER *EVP_chacha20(void); 920 1.1 christos # ifndef OPENSSL_NO_POLY1305 921 1.1 christos const EVP_CIPHER *EVP_chacha20_poly1305(void); 922 1.1 christos # endif 923 1.1 christos # endif 924 1.1 christos 925 1.1 christos # ifndef OPENSSL_NO_SEED 926 1.1 christos const EVP_CIPHER *EVP_seed_ecb(void); 927 1.1 christos const EVP_CIPHER *EVP_seed_cbc(void); 928 1.1 christos const EVP_CIPHER *EVP_seed_cfb128(void); 929 1.1 christos # define EVP_seed_cfb EVP_seed_cfb128 930 1.1 christos const EVP_CIPHER *EVP_seed_ofb(void); 931 1.1 christos # endif 932 1.1 christos 933 1.1 christos # ifndef OPENSSL_NO_SM4 934 1.1 christos const EVP_CIPHER *EVP_sm4_ecb(void); 935 1.1 christos const EVP_CIPHER *EVP_sm4_cbc(void); 936 1.1 christos const EVP_CIPHER *EVP_sm4_cfb128(void); 937 1.1 christos # define EVP_sm4_cfb EVP_sm4_cfb128 938 1.1 christos const EVP_CIPHER *EVP_sm4_ofb(void); 939 1.1 christos const EVP_CIPHER *EVP_sm4_ctr(void); 940 1.1 christos # endif 941 1.1 christos 942 1.1 christos # if OPENSSL_API_COMPAT < 0x10100000L 943 1.1 christos # define OPENSSL_add_all_algorithms_conf() \ 944 1.1 christos OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \ 945 1.1 christos | OPENSSL_INIT_ADD_ALL_DIGESTS \ 946 1.1 christos | OPENSSL_INIT_LOAD_CONFIG, NULL) 947 1.1 christos # define OPENSSL_add_all_algorithms_noconf() \ 948 1.1 christos OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \ 949 1.1 christos | OPENSSL_INIT_ADD_ALL_DIGESTS, NULL) 950 1.1 christos 951 1.1 christos # ifdef OPENSSL_LOAD_CONF 952 1.1 christos # define OpenSSL_add_all_algorithms() OPENSSL_add_all_algorithms_conf() 953 1.1 christos # else 954 1.1 christos # define OpenSSL_add_all_algorithms() OPENSSL_add_all_algorithms_noconf() 955 1.1 christos # endif 956 1.1 christos 957 1.1 christos # define OpenSSL_add_all_ciphers() \ 958 1.1 christos OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS, NULL) 959 1.1 christos # define OpenSSL_add_all_digests() \ 960 1.1 christos OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_DIGESTS, NULL) 961 1.1 christos 962 1.1 christos # define EVP_cleanup() while(0) continue 963 1.1 christos # endif 964 1.1 christos 965 1.1 christos int EVP_add_cipher(const EVP_CIPHER *cipher); 966 1.1 christos int EVP_add_digest(const EVP_MD *digest); 967 1.1 christos 968 1.1 christos const EVP_CIPHER *EVP_get_cipherbyname(const char *name); 969 1.1 christos const EVP_MD *EVP_get_digestbyname(const char *name); 970 1.1 christos 971 1.1 christos void EVP_CIPHER_do_all(void (*fn) (const EVP_CIPHER *ciph, 972 1.1 christos const char *from, const char *to, void *x), 973 1.1 christos void *arg); 974 1.1 christos void EVP_CIPHER_do_all_sorted(void (*fn) 975 1.1 christos (const EVP_CIPHER *ciph, const char *from, 976 1.1 christos const char *to, void *x), void *arg); 977 1.1 christos 978 1.1 christos void EVP_MD_do_all(void (*fn) (const EVP_MD *ciph, 979 1.1 christos const char *from, const char *to, void *x), 980 1.1 christos void *arg); 981 1.1 christos void EVP_MD_do_all_sorted(void (*fn) 982 1.1 christos (const EVP_MD *ciph, const char *from, 983 1.1 christos const char *to, void *x), void *arg); 984 1.1 christos 985 1.1 christos int EVP_PKEY_decrypt_old(unsigned char *dec_key, 986 1.1 christos const unsigned char *enc_key, int enc_key_len, 987 1.1 christos EVP_PKEY *private_key); 988 1.1 christos int EVP_PKEY_encrypt_old(unsigned char *enc_key, 989 1.1 christos const unsigned char *key, int key_len, 990 1.1 christos EVP_PKEY *pub_key); 991 1.1 christos int EVP_PKEY_type(int type); 992 1.1 christos int EVP_PKEY_id(const EVP_PKEY *pkey); 993 1.1 christos int EVP_PKEY_base_id(const EVP_PKEY *pkey); 994 1.1 christos int EVP_PKEY_bits(const EVP_PKEY *pkey); 995 1.1 christos int EVP_PKEY_security_bits(const EVP_PKEY *pkey); 996 1.1 christos int EVP_PKEY_size(const EVP_PKEY *pkey); 997 1.1 christos int EVP_PKEY_set_type(EVP_PKEY *pkey, int type); 998 1.1 christos int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len); 999 1.1 christos int EVP_PKEY_set_alias_type(EVP_PKEY *pkey, int type); 1000 1.1 christos # ifndef OPENSSL_NO_ENGINE 1001 1.1 christos int EVP_PKEY_set1_engine(EVP_PKEY *pkey, ENGINE *e); 1002 1.1 christos ENGINE *EVP_PKEY_get0_engine(const EVP_PKEY *pkey); 1003 1.1 christos # endif 1004 1.1 christos int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key); 1005 1.1 christos void *EVP_PKEY_get0(const EVP_PKEY *pkey); 1006 1.1 christos const unsigned char *EVP_PKEY_get0_hmac(const EVP_PKEY *pkey, size_t *len); 1007 1.1 christos # ifndef OPENSSL_NO_POLY1305 1008 1.1 christos const unsigned char *EVP_PKEY_get0_poly1305(const EVP_PKEY *pkey, size_t *len); 1009 1.1 christos # endif 1010 1.1 christos # ifndef OPENSSL_NO_SIPHASH 1011 1.1 christos const unsigned char *EVP_PKEY_get0_siphash(const EVP_PKEY *pkey, size_t *len); 1012 1.1 christos # endif 1013 1.1 christos 1014 1.1 christos # ifndef OPENSSL_NO_RSA 1015 1.1 christos struct rsa_st; 1016 1.1 christos int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, struct rsa_st *key); 1017 1.1 christos struct rsa_st *EVP_PKEY_get0_RSA(EVP_PKEY *pkey); 1018 1.1 christos struct rsa_st *EVP_PKEY_get1_RSA(EVP_PKEY *pkey); 1019 1.1 christos # endif 1020 1.1 christos # ifndef OPENSSL_NO_DSA 1021 1.1 christos struct dsa_st; 1022 1.1 christos int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, struct dsa_st *key); 1023 1.1 christos struct dsa_st *EVP_PKEY_get0_DSA(EVP_PKEY *pkey); 1024 1.1 christos struct dsa_st *EVP_PKEY_get1_DSA(EVP_PKEY *pkey); 1025 1.1 christos # endif 1026 1.1 christos # ifndef OPENSSL_NO_DH 1027 1.1 christos struct dh_st; 1028 1.1 christos int EVP_PKEY_set1_DH(EVP_PKEY *pkey, struct dh_st *key); 1029 1.1 christos struct dh_st *EVP_PKEY_get0_DH(EVP_PKEY *pkey); 1030 1.1 christos struct dh_st *EVP_PKEY_get1_DH(EVP_PKEY *pkey); 1031 1.1 christos # endif 1032 1.1 christos # ifndef OPENSSL_NO_EC 1033 1.1 christos struct ec_key_st; 1034 1.1 christos int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, struct ec_key_st *key); 1035 1.1 christos struct ec_key_st *EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey); 1036 1.1 christos struct ec_key_st *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey); 1037 1.1 christos # endif 1038 1.1 christos 1039 1.1 christos EVP_PKEY *EVP_PKEY_new(void); 1040 1.1 christos int EVP_PKEY_up_ref(EVP_PKEY *pkey); 1041 1.1 christos void EVP_PKEY_free(EVP_PKEY *pkey); 1042 1.1 christos 1043 1.1 christos EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, 1044 1.1 christos long length); 1045 1.1 christos int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp); 1046 1.1 christos 1047 1.1 christos EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp, 1048 1.1 christos long length); 1049 1.1 christos EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp, 1050 1.1 christos long length); 1051 1.1 christos int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp); 1052 1.1 christos 1053 1.1 christos int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from); 1054 1.1 christos int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey); 1055 1.1 christos int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode); 1056 1.1 christos int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b); 1057 1.1 christos 1058 1.1 christos int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b); 1059 1.1 christos 1060 1.1 christos int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey, 1061 1.1 christos int indent, ASN1_PCTX *pctx); 1062 1.1 christos int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey, 1063 1.1 christos int indent, ASN1_PCTX *pctx); 1064 1.1 christos int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey, 1065 1.1 christos int indent, ASN1_PCTX *pctx); 1066 1.1 christos 1067 1.1 christos int EVP_PKEY_get_default_digest_nid(EVP_PKEY *pkey, int *pnid); 1068 1.1 christos 1069 1.1 christos int EVP_PKEY_set1_tls_encodedpoint(EVP_PKEY *pkey, 1070 1.1 christos const unsigned char *pt, size_t ptlen); 1071 1.1 christos size_t EVP_PKEY_get1_tls_encodedpoint(EVP_PKEY *pkey, unsigned char **ppt); 1072 1.1 christos 1073 1.1 christos int EVP_CIPHER_type(const EVP_CIPHER *ctx); 1074 1.1 christos 1075 1.1 christos /* calls methods */ 1076 1.1 christos int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type); 1077 1.1 christos int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type); 1078 1.1 christos 1079 1.1 christos /* These are used by EVP_CIPHER methods */ 1080 1.1 christos int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type); 1081 1.1 christos int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type); 1082 1.1 christos 1083 1.1 christos /* PKCS5 password based encryption */ 1084 1.1 christos int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, 1085 1.1 christos ASN1_TYPE *param, const EVP_CIPHER *cipher, 1086 1.1 christos const EVP_MD *md, int en_de); 1087 1.1 christos int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, 1088 1.1 christos const unsigned char *salt, int saltlen, int iter, 1089 1.1 christos int keylen, unsigned char *out); 1090 1.1 christos int PKCS5_PBKDF2_HMAC(const char *pass, int passlen, 1091 1.1 christos const unsigned char *salt, int saltlen, int iter, 1092 1.1 christos const EVP_MD *digest, int keylen, unsigned char *out); 1093 1.1 christos int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, 1094 1.1 christos ASN1_TYPE *param, const EVP_CIPHER *cipher, 1095 1.1 christos const EVP_MD *md, int en_de); 1096 1.1 christos 1097 1.1 christos #ifndef OPENSSL_NO_SCRYPT 1098 1.1 christos int EVP_PBE_scrypt(const char *pass, size_t passlen, 1099 1.1 christos const unsigned char *salt, size_t saltlen, 1100 1.1 christos uint64_t N, uint64_t r, uint64_t p, uint64_t maxmem, 1101 1.1 christos unsigned char *key, size_t keylen); 1102 1.1 christos 1103 1.1 christos int PKCS5_v2_scrypt_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, 1104 1.1 christos int passlen, ASN1_TYPE *param, 1105 1.1 christos const EVP_CIPHER *c, const EVP_MD *md, int en_de); 1106 1.1 christos #endif 1107 1.1 christos 1108 1.1 christos void PKCS5_PBE_add(void); 1109 1.1 christos 1110 1.1 christos int EVP_PBE_CipherInit(ASN1_OBJECT *pbe_obj, const char *pass, int passlen, 1111 1.1 christos ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de); 1112 1.1 christos 1113 1.1 christos /* PBE type */ 1114 1.1 christos 1115 1.1 christos /* Can appear as the outermost AlgorithmIdentifier */ 1116 1.1 christos # define EVP_PBE_TYPE_OUTER 0x0 1117 1.1 christos /* Is an PRF type OID */ 1118 1.1 christos # define EVP_PBE_TYPE_PRF 0x1 1119 1.1 christos /* Is a PKCS#5 v2.0 KDF */ 1120 1.1 christos # define EVP_PBE_TYPE_KDF 0x2 1121 1.1 christos 1122 1.1 christos int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid, 1123 1.1 christos int md_nid, EVP_PBE_KEYGEN *keygen); 1124 1.1 christos int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md, 1125 1.1 christos EVP_PBE_KEYGEN *keygen); 1126 1.1 christos int EVP_PBE_find(int type, int pbe_nid, int *pcnid, int *pmnid, 1127 1.1 christos EVP_PBE_KEYGEN **pkeygen); 1128 1.1 christos void EVP_PBE_cleanup(void); 1129 1.1 christos int EVP_PBE_get(int *ptype, int *ppbe_nid, size_t num); 1130 1.1 christos 1131 1.1 christos # define ASN1_PKEY_ALIAS 0x1 1132 1.1 christos # define ASN1_PKEY_DYNAMIC 0x2 1133 1.1 christos # define ASN1_PKEY_SIGPARAM_NULL 0x4 1134 1.1 christos 1135 1.1 christos # define ASN1_PKEY_CTRL_PKCS7_SIGN 0x1 1136 1.1 christos # define ASN1_PKEY_CTRL_PKCS7_ENCRYPT 0x2 1137 1.1 christos # define ASN1_PKEY_CTRL_DEFAULT_MD_NID 0x3 1138 1.1 christos # define ASN1_PKEY_CTRL_CMS_SIGN 0x5 1139 1.1 christos # define ASN1_PKEY_CTRL_CMS_ENVELOPE 0x7 1140 1.1 christos # define ASN1_PKEY_CTRL_CMS_RI_TYPE 0x8 1141 1.1 christos 1142 1.1 christos # define ASN1_PKEY_CTRL_SET1_TLS_ENCPT 0x9 1143 1.1 christos # define ASN1_PKEY_CTRL_GET1_TLS_ENCPT 0xa 1144 1.1 christos 1145 1.1 christos int EVP_PKEY_asn1_get_count(void); 1146 1.1 christos const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx); 1147 1.1 christos const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(ENGINE **pe, int type); 1148 1.1 christos const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe, 1149 1.1 christos const char *str, int len); 1150 1.1 christos int EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth); 1151 1.1 christos int EVP_PKEY_asn1_add_alias(int to, int from); 1152 1.1 christos int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *pkey_base_id, 1153 1.1 christos int *ppkey_flags, const char **pinfo, 1154 1.1 christos const char **ppem_str, 1155 1.1 christos const EVP_PKEY_ASN1_METHOD *ameth); 1156 1.1 christos 1157 1.1 christos const EVP_PKEY_ASN1_METHOD *EVP_PKEY_get0_asn1(const EVP_PKEY *pkey); 1158 1.1 christos EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags, 1159 1.1 christos const char *pem_str, 1160 1.1 christos const char *info); 1161 1.1 christos void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst, 1162 1.1 christos const EVP_PKEY_ASN1_METHOD *src); 1163 1.1 christos void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth); 1164 1.1 christos void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth, 1165 1.1 christos int (*pub_decode) (EVP_PKEY *pk, 1166 1.1 christos X509_PUBKEY *pub), 1167 1.1 christos int (*pub_encode) (X509_PUBKEY *pub, 1168 1.1 christos const EVP_PKEY *pk), 1169 1.1 christos int (*pub_cmp) (const EVP_PKEY *a, 1170 1.1 christos const EVP_PKEY *b), 1171 1.1 christos int (*pub_print) (BIO *out, 1172 1.1 christos const EVP_PKEY *pkey, 1173 1.1 christos int indent, ASN1_PCTX *pctx), 1174 1.1 christos int (*pkey_size) (const EVP_PKEY *pk), 1175 1.1 christos int (*pkey_bits) (const EVP_PKEY *pk)); 1176 1.1 christos void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth, 1177 1.1 christos int (*priv_decode) (EVP_PKEY *pk, 1178 1.1 christos const PKCS8_PRIV_KEY_INFO 1179 1.1 christos *p8inf), 1180 1.1 christos int (*priv_encode) (PKCS8_PRIV_KEY_INFO *p8, 1181 1.1 christos const EVP_PKEY *pk), 1182 1.1 christos int (*priv_print) (BIO *out, 1183 1.1 christos const EVP_PKEY *pkey, 1184 1.1 christos int indent, 1185 1.1 christos ASN1_PCTX *pctx)); 1186 1.1 christos void EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth, 1187 1.1 christos int (*param_decode) (EVP_PKEY *pkey, 1188 1.1 christos const unsigned char **pder, 1189 1.1 christos int derlen), 1190 1.1 christos int (*param_encode) (const EVP_PKEY *pkey, 1191 1.1 christos unsigned char **pder), 1192 1.1 christos int (*param_missing) (const EVP_PKEY *pk), 1193 1.1 christos int (*param_copy) (EVP_PKEY *to, 1194 1.1 christos const EVP_PKEY *from), 1195 1.1 christos int (*param_cmp) (const EVP_PKEY *a, 1196 1.1 christos const EVP_PKEY *b), 1197 1.1 christos int (*param_print) (BIO *out, 1198 1.1 christos const EVP_PKEY *pkey, 1199 1.1 christos int indent, 1200 1.1 christos ASN1_PCTX *pctx)); 1201 1.1 christos 1202 1.1 christos void EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth, 1203 1.1 christos void (*pkey_free) (EVP_PKEY *pkey)); 1204 1.1 christos void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth, 1205 1.1 christos int (*pkey_ctrl) (EVP_PKEY *pkey, int op, 1206 1.1 christos long arg1, void *arg2)); 1207 1.1 christos void EVP_PKEY_asn1_set_item(EVP_PKEY_ASN1_METHOD *ameth, 1208 1.1 christos int (*item_verify) (EVP_MD_CTX *ctx, 1209 1.1 christos const ASN1_ITEM *it, 1210 1.1 christos void *asn, 1211 1.1 christos X509_ALGOR *a, 1212 1.1 christos ASN1_BIT_STRING *sig, 1213 1.1 christos EVP_PKEY *pkey), 1214 1.1 christos int (*item_sign) (EVP_MD_CTX *ctx, 1215 1.1 christos const ASN1_ITEM *it, 1216 1.1 christos void *asn, 1217 1.1 christos X509_ALGOR *alg1, 1218 1.1 christos X509_ALGOR *alg2, 1219 1.1 christos ASN1_BIT_STRING *sig)); 1220 1.1 christos 1221 1.1 christos void EVP_PKEY_asn1_set_siginf(EVP_PKEY_ASN1_METHOD *ameth, 1222 1.1 christos int (*siginf_set) (X509_SIG_INFO *siginf, 1223 1.1 christos const X509_ALGOR *alg, 1224 1.1 christos const ASN1_STRING *sig)); 1225 1.1 christos 1226 1.1 christos void EVP_PKEY_asn1_set_check(EVP_PKEY_ASN1_METHOD *ameth, 1227 1.1 christos int (*pkey_check) (const EVP_PKEY *pk)); 1228 1.1 christos 1229 1.1 christos void EVP_PKEY_asn1_set_public_check(EVP_PKEY_ASN1_METHOD *ameth, 1230 1.1 christos int (*pkey_pub_check) (const EVP_PKEY *pk)); 1231 1.1 christos 1232 1.1 christos void EVP_PKEY_asn1_set_param_check(EVP_PKEY_ASN1_METHOD *ameth, 1233 1.1 christos int (*pkey_param_check) (const EVP_PKEY *pk)); 1234 1.1 christos 1235 1.1 christos void EVP_PKEY_asn1_set_set_priv_key(EVP_PKEY_ASN1_METHOD *ameth, 1236 1.1 christos int (*set_priv_key) (EVP_PKEY *pk, 1237 1.1 christos const unsigned char 1238 1.1 christos *priv, 1239 1.1 christos size_t len)); 1240 1.1 christos void EVP_PKEY_asn1_set_set_pub_key(EVP_PKEY_ASN1_METHOD *ameth, 1241 1.1 christos int (*set_pub_key) (EVP_PKEY *pk, 1242 1.1 christos const unsigned char *pub, 1243 1.1 christos size_t len)); 1244 1.1 christos void EVP_PKEY_asn1_set_get_priv_key(EVP_PKEY_ASN1_METHOD *ameth, 1245 1.1 christos int (*get_priv_key) (const EVP_PKEY *pk, 1246 1.1 christos unsigned char *priv, 1247 1.1 christos size_t *len)); 1248 1.1 christos void EVP_PKEY_asn1_set_get_pub_key(EVP_PKEY_ASN1_METHOD *ameth, 1249 1.1 christos int (*get_pub_key) (const EVP_PKEY *pk, 1250 1.1 christos unsigned char *pub, 1251 1.1 christos size_t *len)); 1252 1.1 christos 1253 1.1 christos void EVP_PKEY_asn1_set_security_bits(EVP_PKEY_ASN1_METHOD *ameth, 1254 1.1 christos int (*pkey_security_bits) (const EVP_PKEY 1255 1.1 christos *pk)); 1256 1.1 christos 1257 1.1 christos # define EVP_PKEY_OP_UNDEFINED 0 1258 1.1 christos # define EVP_PKEY_OP_PARAMGEN (1<<1) 1259 1.1 christos # define EVP_PKEY_OP_KEYGEN (1<<2) 1260 1.1 christos # define EVP_PKEY_OP_SIGN (1<<3) 1261 1.1 christos # define EVP_PKEY_OP_VERIFY (1<<4) 1262 1.1 christos # define EVP_PKEY_OP_VERIFYRECOVER (1<<5) 1263 1.1 christos # define EVP_PKEY_OP_SIGNCTX (1<<6) 1264 1.1 christos # define EVP_PKEY_OP_VERIFYCTX (1<<7) 1265 1.1 christos # define EVP_PKEY_OP_ENCRYPT (1<<8) 1266 1.1 christos # define EVP_PKEY_OP_DECRYPT (1<<9) 1267 1.1 christos # define EVP_PKEY_OP_DERIVE (1<<10) 1268 1.1 christos 1269 1.1 christos # define EVP_PKEY_OP_TYPE_SIG \ 1270 1.1 christos (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER \ 1271 1.1 christos | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX) 1272 1.1 christos 1273 1.1 christos # define EVP_PKEY_OP_TYPE_CRYPT \ 1274 1.1 christos (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT) 1275 1.1 christos 1276 1.1 christos # define EVP_PKEY_OP_TYPE_NOGEN \ 1277 1.1 christos (EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT | EVP_PKEY_OP_DERIVE) 1278 1.1 christos 1279 1.1 christos # define EVP_PKEY_OP_TYPE_GEN \ 1280 1.1 christos (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN) 1281 1.1 christos 1282 1.1 christos # define EVP_PKEY_CTX_set_signature_md(ctx, md) \ 1283 1.1 christos EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG, \ 1284 1.1 christos EVP_PKEY_CTRL_MD, 0, (void *)(md)) 1285 1.1 christos 1286 1.1 christos # define EVP_PKEY_CTX_get_signature_md(ctx, pmd) \ 1287 1.1 christos EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG, \ 1288 1.1 christos EVP_PKEY_CTRL_GET_MD, 0, (void *)(pmd)) 1289 1.1 christos 1290 1.1 christos # define EVP_PKEY_CTX_set_mac_key(ctx, key, len) \ 1291 1.1 christos EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_KEYGEN, \ 1292 1.1 christos EVP_PKEY_CTRL_SET_MAC_KEY, len, (void *)(key)) 1293 1.1 christos 1294 1.1 christos # define EVP_PKEY_CTRL_MD 1 1295 1.1 christos # define EVP_PKEY_CTRL_PEER_KEY 2 1296 1.1 christos 1297 1.1 christos # define EVP_PKEY_CTRL_PKCS7_ENCRYPT 3 1298 1.1 christos # define EVP_PKEY_CTRL_PKCS7_DECRYPT 4 1299 1.1 christos 1300 1.1 christos # define EVP_PKEY_CTRL_PKCS7_SIGN 5 1301 1.1 christos 1302 1.1 christos # define EVP_PKEY_CTRL_SET_MAC_KEY 6 1303 1.1 christos 1304 1.1 christos # define EVP_PKEY_CTRL_DIGESTINIT 7 1305 1.1 christos 1306 1.1 christos /* Used by GOST key encryption in TLS */ 1307 1.1 christos # define EVP_PKEY_CTRL_SET_IV 8 1308 1.1 christos 1309 1.1 christos # define EVP_PKEY_CTRL_CMS_ENCRYPT 9 1310 1.1 christos # define EVP_PKEY_CTRL_CMS_DECRYPT 10 1311 1.1 christos # define EVP_PKEY_CTRL_CMS_SIGN 11 1312 1.1 christos 1313 1.1 christos # define EVP_PKEY_CTRL_CIPHER 12 1314 1.1 christos 1315 1.1 christos # define EVP_PKEY_CTRL_GET_MD 13 1316 1.1 christos 1317 1.1 christos # define EVP_PKEY_CTRL_SET_DIGEST_SIZE 14 1318 1.1 christos 1319 1.1 christos # define EVP_PKEY_ALG_CTRL 0x1000 1320 1.1 christos 1321 1.1 christos # define EVP_PKEY_FLAG_AUTOARGLEN 2 1322 1.1 christos /* 1323 1.1 christos * Method handles all operations: don't assume any digest related defaults. 1324 1.1 christos */ 1325 1.1 christos # define EVP_PKEY_FLAG_SIGCTX_CUSTOM 4 1326 1.1 christos 1327 1.1 christos const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type); 1328 1.1 christos EVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags); 1329 1.1 christos void EVP_PKEY_meth_get0_info(int *ppkey_id, int *pflags, 1330 1.1 christos const EVP_PKEY_METHOD *meth); 1331 1.1 christos void EVP_PKEY_meth_copy(EVP_PKEY_METHOD *dst, const EVP_PKEY_METHOD *src); 1332 1.1 christos void EVP_PKEY_meth_free(EVP_PKEY_METHOD *pmeth); 1333 1.1 christos int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth); 1334 1.1 christos int EVP_PKEY_meth_remove(const EVP_PKEY_METHOD *pmeth); 1335 1.1 christos size_t EVP_PKEY_meth_get_count(void); 1336 1.1 christos const EVP_PKEY_METHOD *EVP_PKEY_meth_get0(size_t idx); 1337 1.1 christos 1338 1.1 christos EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e); 1339 1.1 christos EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e); 1340 1.1 christos EVP_PKEY_CTX *EVP_PKEY_CTX_dup(EVP_PKEY_CTX *ctx); 1341 1.1 christos void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx); 1342 1.1 christos 1343 1.1 christos int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, 1344 1.1 christos int cmd, int p1, void *p2); 1345 1.1 christos int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, const char *type, 1346 1.1 christos const char *value); 1347 1.1 christos int EVP_PKEY_CTX_ctrl_uint64(EVP_PKEY_CTX *ctx, int keytype, int optype, 1348 1.1 christos int cmd, uint64_t value); 1349 1.1 christos 1350 1.1 christos int EVP_PKEY_CTX_str2ctrl(EVP_PKEY_CTX *ctx, int cmd, const char *str); 1351 1.1 christos int EVP_PKEY_CTX_hex2ctrl(EVP_PKEY_CTX *ctx, int cmd, const char *hex); 1352 1.1 christos 1353 1.1 christos int EVP_PKEY_CTX_md(EVP_PKEY_CTX *ctx, int optype, int cmd, const char *md); 1354 1.1 christos 1355 1.1 christos int EVP_PKEY_CTX_get_operation(EVP_PKEY_CTX *ctx); 1356 1.1 christos void EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen); 1357 1.1 christos 1358 1.1 christos EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e, 1359 1.1 christos const unsigned char *key, int keylen); 1360 1.1 christos EVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *e, 1361 1.1 christos const unsigned char *priv, 1362 1.1 christos size_t len); 1363 1.1 christos EVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *e, 1364 1.1 christos const unsigned char *pub, 1365 1.1 christos size_t len); 1366 1.1 christos int EVP_PKEY_get_raw_private_key(const EVP_PKEY *pkey, unsigned char *priv, 1367 1.1 christos size_t *len); 1368 1.1 christos int EVP_PKEY_get_raw_public_key(const EVP_PKEY *pkey, unsigned char *pub, 1369 1.1 christos size_t *len); 1370 1.1 christos 1371 1.1 christos EVP_PKEY *EVP_PKEY_new_CMAC_key(ENGINE *e, const unsigned char *priv, 1372 1.1 christos size_t len, const EVP_CIPHER *cipher); 1373 1.1 christos 1374 1.1 christos void EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data); 1375 1.1 christos void *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx); 1376 1.1 christos EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx); 1377 1.1 christos 1378 1.1 christos EVP_PKEY *EVP_PKEY_CTX_get0_peerkey(EVP_PKEY_CTX *ctx); 1379 1.1 christos 1380 1.1 christos void EVP_PKEY_CTX_set_app_data(EVP_PKEY_CTX *ctx, void *data); 1381 1.1 christos void *EVP_PKEY_CTX_get_app_data(EVP_PKEY_CTX *ctx); 1382 1.1 christos 1383 1.1 christos int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx); 1384 1.1 christos int EVP_PKEY_sign(EVP_PKEY_CTX *ctx, 1385 1.1 christos unsigned char *sig, size_t *siglen, 1386 1.1 christos const unsigned char *tbs, size_t tbslen); 1387 1.1 christos int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx); 1388 1.1 christos int EVP_PKEY_verify(EVP_PKEY_CTX *ctx, 1389 1.1 christos const unsigned char *sig, size_t siglen, 1390 1.1 christos const unsigned char *tbs, size_t tbslen); 1391 1.1 christos int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx); 1392 1.1 christos int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx, 1393 1.1 christos unsigned char *rout, size_t *routlen, 1394 1.1 christos const unsigned char *sig, size_t siglen); 1395 1.1 christos int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx); 1396 1.1 christos int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx, 1397 1.1 christos unsigned char *out, size_t *outlen, 1398 1.1 christos const unsigned char *in, size_t inlen); 1399 1.1 christos int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx); 1400 1.1 christos int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx, 1401 1.1 christos unsigned char *out, size_t *outlen, 1402 1.1 christos const unsigned char *in, size_t inlen); 1403 1.1 christos 1404 1.1 christos int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx); 1405 1.1 christos int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer); 1406 1.1 christos int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen); 1407 1.1 christos 1408 1.1 christos typedef int EVP_PKEY_gen_cb(EVP_PKEY_CTX *ctx); 1409 1.1 christos 1410 1.1 christos int EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx); 1411 1.1 christos int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey); 1412 1.1 christos int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx); 1413 1.1 christos int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey); 1414 1.1 christos int EVP_PKEY_check(EVP_PKEY_CTX *ctx); 1415 1.1 christos int EVP_PKEY_public_check(EVP_PKEY_CTX *ctx); 1416 1.1 christos int EVP_PKEY_param_check(EVP_PKEY_CTX *ctx); 1417 1.1 christos 1418 1.1 christos void EVP_PKEY_CTX_set_cb(EVP_PKEY_CTX *ctx, EVP_PKEY_gen_cb *cb); 1419 1.1 christos EVP_PKEY_gen_cb *EVP_PKEY_CTX_get_cb(EVP_PKEY_CTX *ctx); 1420 1.1 christos 1421 1.1 christos int EVP_PKEY_CTX_get_keygen_info(EVP_PKEY_CTX *ctx, int idx); 1422 1.1 christos 1423 1.1 christos void EVP_PKEY_meth_set_init(EVP_PKEY_METHOD *pmeth, 1424 1.1 christos int (*init) (EVP_PKEY_CTX *ctx)); 1425 1.1 christos 1426 1.1 christos void EVP_PKEY_meth_set_copy(EVP_PKEY_METHOD *pmeth, 1427 1.1 christos int (*copy) (EVP_PKEY_CTX *dst, 1428 1.1 christos EVP_PKEY_CTX *src)); 1429 1.1 christos 1430 1.1 christos void EVP_PKEY_meth_set_cleanup(EVP_PKEY_METHOD *pmeth, 1431 1.1 christos void (*cleanup) (EVP_PKEY_CTX *ctx)); 1432 1.1 christos 1433 1.1 christos void EVP_PKEY_meth_set_paramgen(EVP_PKEY_METHOD *pmeth, 1434 1.1 christos int (*paramgen_init) (EVP_PKEY_CTX *ctx), 1435 1.1 christos int (*paramgen) (EVP_PKEY_CTX *ctx, 1436 1.1 christos EVP_PKEY *pkey)); 1437 1.1 christos 1438 1.1 christos void EVP_PKEY_meth_set_keygen(EVP_PKEY_METHOD *pmeth, 1439 1.1 christos int (*keygen_init) (EVP_PKEY_CTX *ctx), 1440 1.1 christos int (*keygen) (EVP_PKEY_CTX *ctx, 1441 1.1 christos EVP_PKEY *pkey)); 1442 1.1 christos 1443 1.1 christos void EVP_PKEY_meth_set_sign(EVP_PKEY_METHOD *pmeth, 1444 1.1 christos int (*sign_init) (EVP_PKEY_CTX *ctx), 1445 1.1 christos int (*sign) (EVP_PKEY_CTX *ctx, 1446 1.1 christos unsigned char *sig, size_t *siglen, 1447 1.1 christos const unsigned char *tbs, 1448 1.1 christos size_t tbslen)); 1449 1.1 christos 1450 1.1 christos void EVP_PKEY_meth_set_verify(EVP_PKEY_METHOD *pmeth, 1451 1.1 christos int (*verify_init) (EVP_PKEY_CTX *ctx), 1452 1.1 christos int (*verify) (EVP_PKEY_CTX *ctx, 1453 1.1 christos const unsigned char *sig, 1454 1.1 christos size_t siglen, 1455 1.1 christos const unsigned char *tbs, 1456 1.1 christos size_t tbslen)); 1457 1.1 christos 1458 1.1 christos void EVP_PKEY_meth_set_verify_recover(EVP_PKEY_METHOD *pmeth, 1459 1.1 christos int (*verify_recover_init) (EVP_PKEY_CTX 1460 1.1 christos *ctx), 1461 1.1 christos int (*verify_recover) (EVP_PKEY_CTX 1462 1.1 christos *ctx, 1463 1.1 christos unsigned char 1464 1.1 christos *sig, 1465 1.1 christos size_t *siglen, 1466 1.1 christos const unsigned 1467 1.1 christos char *tbs, 1468 1.1 christos size_t tbslen)); 1469 1.1 christos 1470 1.1 christos void EVP_PKEY_meth_set_signctx(EVP_PKEY_METHOD *pmeth, 1471 1.1 christos int (*signctx_init) (EVP_PKEY_CTX *ctx, 1472 1.1 christos EVP_MD_CTX *mctx), 1473 1.1 christos int (*signctx) (EVP_PKEY_CTX *ctx, 1474 1.1 christos unsigned char *sig, 1475 1.1 christos size_t *siglen, 1476 1.1 christos EVP_MD_CTX *mctx)); 1477 1.1 christos 1478 1.1 christos void EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth, 1479 1.1 christos int (*verifyctx_init) (EVP_PKEY_CTX *ctx, 1480 1.1 christos EVP_MD_CTX *mctx), 1481 1.1 christos int (*verifyctx) (EVP_PKEY_CTX *ctx, 1482 1.1 christos const unsigned char *sig, 1483 1.1 christos int siglen, 1484 1.1 christos EVP_MD_CTX *mctx)); 1485 1.1 christos 1486 1.1 christos void EVP_PKEY_meth_set_encrypt(EVP_PKEY_METHOD *pmeth, 1487 1.1 christos int (*encrypt_init) (EVP_PKEY_CTX *ctx), 1488 1.1 christos int (*encryptfn) (EVP_PKEY_CTX *ctx, 1489 1.1 christos unsigned char *out, 1490 1.1 christos size_t *outlen, 1491 1.1 christos const unsigned char *in, 1492 1.1 christos size_t inlen)); 1493 1.1 christos 1494 1.1 christos void EVP_PKEY_meth_set_decrypt(EVP_PKEY_METHOD *pmeth, 1495 1.1 christos int (*decrypt_init) (EVP_PKEY_CTX *ctx), 1496 1.1 christos int (*decrypt) (EVP_PKEY_CTX *ctx, 1497 1.1 christos unsigned char *out, 1498 1.1 christos size_t *outlen, 1499 1.1 christos const unsigned char *in, 1500 1.1 christos size_t inlen)); 1501 1.1 christos 1502 1.1 christos void EVP_PKEY_meth_set_derive(EVP_PKEY_METHOD *pmeth, 1503 1.1 christos int (*derive_init) (EVP_PKEY_CTX *ctx), 1504 1.1 christos int (*derive) (EVP_PKEY_CTX *ctx, 1505 1.1 christos unsigned char *key, 1506 1.1 christos size_t *keylen)); 1507 1.1 christos 1508 1.1 christos void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth, 1509 1.1 christos int (*ctrl) (EVP_PKEY_CTX *ctx, int type, int p1, 1510 1.1 christos void *p2), 1511 1.1 christos int (*ctrl_str) (EVP_PKEY_CTX *ctx, 1512 1.1 christos const char *type, 1513 1.1 christos const char *value)); 1514 1.1 christos 1515 1.1 christos void EVP_PKEY_meth_set_digestsign(EVP_PKEY_METHOD *pmeth, 1516 1.1 christos int (*digestsign) (EVP_MD_CTX *ctx, 1517 1.1 christos unsigned char *sig, 1518 1.1 christos size_t *siglen, 1519 1.1 christos const unsigned char *tbs, 1520 1.1 christos size_t tbslen)); 1521 1.1 christos 1522 1.1 christos void EVP_PKEY_meth_set_digestverify(EVP_PKEY_METHOD *pmeth, 1523 1.1 christos int (*digestverify) (EVP_MD_CTX *ctx, 1524 1.1 christos const unsigned char *sig, 1525 1.1 christos size_t siglen, 1526 1.1 christos const unsigned char *tbs, 1527 1.1 christos size_t tbslen)); 1528 1.1 christos 1529 1.1 christos void EVP_PKEY_meth_set_check(EVP_PKEY_METHOD *pmeth, 1530 1.1 christos int (*check) (EVP_PKEY *pkey)); 1531 1.1 christos 1532 1.1 christos void EVP_PKEY_meth_set_public_check(EVP_PKEY_METHOD *pmeth, 1533 1.1 christos int (*check) (EVP_PKEY *pkey)); 1534 1.1 christos 1535 1.1 christos void EVP_PKEY_meth_set_param_check(EVP_PKEY_METHOD *pmeth, 1536 1.1 christos int (*check) (EVP_PKEY *pkey)); 1537 1.1 christos 1538 1.1 christos void EVP_PKEY_meth_set_digest_custom(EVP_PKEY_METHOD *pmeth, 1539 1.1 christos int (*digest_custom) (EVP_PKEY_CTX *ctx, 1540 1.1 christos EVP_MD_CTX *mctx)); 1541 1.1 christos 1542 1.1 christos void EVP_PKEY_meth_get_init(const EVP_PKEY_METHOD *pmeth, 1543 1.1 christos int (**pinit) (EVP_PKEY_CTX *ctx)); 1544 1.1 christos 1545 1.1 christos void EVP_PKEY_meth_get_copy(const EVP_PKEY_METHOD *pmeth, 1546 1.1 christos int (**pcopy) (EVP_PKEY_CTX *dst, 1547 1.1 christos EVP_PKEY_CTX *src)); 1548 1.1 christos 1549 1.1 christos void EVP_PKEY_meth_get_cleanup(const EVP_PKEY_METHOD *pmeth, 1550 1.1 christos void (**pcleanup) (EVP_PKEY_CTX *ctx)); 1551 1.1 christos 1552 1.1 christos void EVP_PKEY_meth_get_paramgen(const EVP_PKEY_METHOD *pmeth, 1553 1.1 christos int (**pparamgen_init) (EVP_PKEY_CTX *ctx), 1554 1.1 christos int (**pparamgen) (EVP_PKEY_CTX *ctx, 1555 1.1 christos EVP_PKEY *pkey)); 1556 1.1 christos 1557 1.1 christos void EVP_PKEY_meth_get_keygen(const EVP_PKEY_METHOD *pmeth, 1558 1.1 christos int (**pkeygen_init) (EVP_PKEY_CTX *ctx), 1559 1.1 christos int (**pkeygen) (EVP_PKEY_CTX *ctx, 1560 1.1 christos EVP_PKEY *pkey)); 1561 1.1 christos 1562 1.1 christos void EVP_PKEY_meth_get_sign(const EVP_PKEY_METHOD *pmeth, 1563 1.1 christos int (**psign_init) (EVP_PKEY_CTX *ctx), 1564 1.1 christos int (**psign) (EVP_PKEY_CTX *ctx, 1565 1.1 christos unsigned char *sig, size_t *siglen, 1566 1.1 christos const unsigned char *tbs, 1567 1.1 christos size_t tbslen)); 1568 1.1 christos 1569 1.1 christos void EVP_PKEY_meth_get_verify(const EVP_PKEY_METHOD *pmeth, 1570 1.1 christos int (**pverify_init) (EVP_PKEY_CTX *ctx), 1571 1.1 christos int (**pverify) (EVP_PKEY_CTX *ctx, 1572 1.1 christos const unsigned char *sig, 1573 1.1 christos size_t siglen, 1574 1.1 christos const unsigned char *tbs, 1575 1.1 christos size_t tbslen)); 1576 1.1 christos 1577 1.1 christos void EVP_PKEY_meth_get_verify_recover(const EVP_PKEY_METHOD *pmeth, 1578 1.1 christos int (**pverify_recover_init) (EVP_PKEY_CTX 1579 1.1 christos *ctx), 1580 1.1 christos int (**pverify_recover) (EVP_PKEY_CTX 1581 1.1 christos *ctx, 1582 1.1 christos unsigned char 1583 1.1 christos *sig, 1584 1.1 christos size_t *siglen, 1585 1.1 christos const unsigned 1586 1.1 christos char *tbs, 1587 1.1 christos size_t tbslen)); 1588 1.1 christos 1589 1.1 christos void EVP_PKEY_meth_get_signctx(const EVP_PKEY_METHOD *pmeth, 1590 1.1 christos int (**psignctx_init) (EVP_PKEY_CTX *ctx, 1591 1.1 christos EVP_MD_CTX *mctx), 1592 1.1 christos int (**psignctx) (EVP_PKEY_CTX *ctx, 1593 1.1 christos unsigned char *sig, 1594 1.1 christos size_t *siglen, 1595 1.1 christos EVP_MD_CTX *mctx)); 1596 1.1 christos 1597 1.1 christos void EVP_PKEY_meth_get_verifyctx(const EVP_PKEY_METHOD *pmeth, 1598 1.1 christos int (**pverifyctx_init) (EVP_PKEY_CTX *ctx, 1599 1.1 christos EVP_MD_CTX *mctx), 1600 1.1 christos int (**pverifyctx) (EVP_PKEY_CTX *ctx, 1601 1.1 christos const unsigned char *sig, 1602 1.1 christos int siglen, 1603 1.1 christos EVP_MD_CTX *mctx)); 1604 1.1 christos 1605 1.1 christos void EVP_PKEY_meth_get_encrypt(const EVP_PKEY_METHOD *pmeth, 1606 1.1 christos int (**pencrypt_init) (EVP_PKEY_CTX *ctx), 1607 1.1 christos int (**pencryptfn) (EVP_PKEY_CTX *ctx, 1608 1.1 christos unsigned char *out, 1609 1.1 christos size_t *outlen, 1610 1.1 christos const unsigned char *in, 1611 1.1 christos size_t inlen)); 1612 1.1 christos 1613 1.1 christos void EVP_PKEY_meth_get_decrypt(const EVP_PKEY_METHOD *pmeth, 1614 1.1 christos int (**pdecrypt_init) (EVP_PKEY_CTX *ctx), 1615 1.1 christos int (**pdecrypt) (EVP_PKEY_CTX *ctx, 1616 1.1 christos unsigned char *out, 1617 1.1 christos size_t *outlen, 1618 1.1 christos const unsigned char *in, 1619 1.1 christos size_t inlen)); 1620 1.1 christos 1621 1.1 christos void EVP_PKEY_meth_get_derive(const EVP_PKEY_METHOD *pmeth, 1622 1.1 christos int (**pderive_init) (EVP_PKEY_CTX *ctx), 1623 1.1 christos int (**pderive) (EVP_PKEY_CTX *ctx, 1624 1.1 christos unsigned char *key, 1625 1.1 christos size_t *keylen)); 1626 1.1 christos 1627 1.1 christos void EVP_PKEY_meth_get_ctrl(const EVP_PKEY_METHOD *pmeth, 1628 1.1 christos int (**pctrl) (EVP_PKEY_CTX *ctx, int type, int p1, 1629 1.1 christos void *p2), 1630 1.1 christos int (**pctrl_str) (EVP_PKEY_CTX *ctx, 1631 1.1 christos const char *type, 1632 1.1 christos const char *value)); 1633 1.1 christos 1634 1.1 christos void EVP_PKEY_meth_get_digestsign(EVP_PKEY_METHOD *pmeth, 1635 1.1 christos int (**digestsign) (EVP_MD_CTX *ctx, 1636 1.1 christos unsigned char *sig, 1637 1.1 christos size_t *siglen, 1638 1.1 christos const unsigned char *tbs, 1639 1.1 christos size_t tbslen)); 1640 1.1 christos 1641 1.1 christos void EVP_PKEY_meth_get_digestverify(EVP_PKEY_METHOD *pmeth, 1642 1.1 christos int (**digestverify) (EVP_MD_CTX *ctx, 1643 1.1 christos const unsigned char *sig, 1644 1.1 christos size_t siglen, 1645 1.1 christos const unsigned char *tbs, 1646 1.1 christos size_t tbslen)); 1647 1.1 christos 1648 1.1 christos void EVP_PKEY_meth_get_check(const EVP_PKEY_METHOD *pmeth, 1649 1.1 christos int (**pcheck) (EVP_PKEY *pkey)); 1650 1.1 christos 1651 1.1 christos void EVP_PKEY_meth_get_public_check(const EVP_PKEY_METHOD *pmeth, 1652 1.1 christos int (**pcheck) (EVP_PKEY *pkey)); 1653 1.1 christos 1654 1.1 christos void EVP_PKEY_meth_get_param_check(const EVP_PKEY_METHOD *pmeth, 1655 1.1 christos int (**pcheck) (EVP_PKEY *pkey)); 1656 1.1 christos 1657 1.1 christos void EVP_PKEY_meth_get_digest_custom(EVP_PKEY_METHOD *pmeth, 1658 1.1 christos int (**pdigest_custom) (EVP_PKEY_CTX *ctx, 1659 1.1 christos EVP_MD_CTX *mctx)); 1660 1.1 christos void EVP_add_alg_module(void); 1661 1.1 christos 1662 1.1 christos 1663 1.1 christos # ifdef __cplusplus 1664 1.1 christos } 1665 1.1 christos # endif 1666 1.1 christos #endif 1667