wolfSSL SSL/TLS library, support up to TLS1.3

Dependents:   OS

Committer:
sPymbed
Date:
Wed Nov 20 13:27:48 2019 +0000
Revision:
17:ff9d1e86ad5f
Parent:
15:117db924cf7c
removed: wolfcrypt

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wolfSSL 15:117db924cf7c 1 /* evp.h
wolfSSL 15:117db924cf7c 2 *
wolfSSL 15:117db924cf7c 3 * Copyright (C) 2006-2017 wolfSSL Inc.
wolfSSL 15:117db924cf7c 4 *
wolfSSL 15:117db924cf7c 5 * This file is part of wolfSSL.
wolfSSL 15:117db924cf7c 6 *
wolfSSL 15:117db924cf7c 7 * wolfSSL is free software; you can redistribute it and/or modify
wolfSSL 15:117db924cf7c 8 * it under the terms of the GNU General Public License as published by
wolfSSL 15:117db924cf7c 9 * the Free Software Foundation; either version 2 of the License, or
wolfSSL 15:117db924cf7c 10 * (at your option) any later version.
wolfSSL 15:117db924cf7c 11 *
wolfSSL 15:117db924cf7c 12 * wolfSSL is distributed in the hope that it will be useful,
wolfSSL 15:117db924cf7c 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
wolfSSL 15:117db924cf7c 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
wolfSSL 15:117db924cf7c 15 * GNU General Public License for more details.
wolfSSL 15:117db924cf7c 16 *
wolfSSL 15:117db924cf7c 17 * You should have received a copy of the GNU General Public License
wolfSSL 15:117db924cf7c 18 * along with this program; if not, write to the Free Software
wolfSSL 15:117db924cf7c 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
wolfSSL 15:117db924cf7c 20 */
wolfSSL 15:117db924cf7c 21
wolfSSL 15:117db924cf7c 22
wolfSSL 15:117db924cf7c 23
wolfSSL 15:117db924cf7c 24 /*!
wolfSSL 15:117db924cf7c 25 \file wolfssl/openssl/evp.h
wolfSSL 15:117db924cf7c 26 \brief evp.h defines mini evp openssl compatibility layer
wolfSSL 15:117db924cf7c 27 */
wolfSSL 15:117db924cf7c 28
wolfSSL 15:117db924cf7c 29
wolfSSL 15:117db924cf7c 30 #ifndef WOLFSSL_EVP_H_
wolfSSL 15:117db924cf7c 31 #define WOLFSSL_EVP_H_
wolfSSL 15:117db924cf7c 32
wolfSSL 15:117db924cf7c 33 #include <wolfssl/wolfcrypt/settings.h>
wolfSSL 15:117db924cf7c 34
wolfSSL 15:117db924cf7c 35 #ifdef WOLFSSL_PREFIX
wolfSSL 15:117db924cf7c 36 #include "prefix_evp.h"
wolfSSL 15:117db924cf7c 37 #endif
wolfSSL 15:117db924cf7c 38
wolfSSL 15:117db924cf7c 39 #ifndef NO_MD4
wolfSSL 15:117db924cf7c 40 #include <wolfssl/openssl/md4.h>
wolfSSL 15:117db924cf7c 41 #endif
wolfSSL 15:117db924cf7c 42 #ifndef NO_MD5
wolfSSL 15:117db924cf7c 43 #include <wolfssl/openssl/md5.h>
wolfSSL 15:117db924cf7c 44 #endif
wolfSSL 15:117db924cf7c 45 #include <wolfssl/openssl/sha.h>
wolfSSL 15:117db924cf7c 46 #include <wolfssl/openssl/ripemd.h>
wolfSSL 15:117db924cf7c 47 #include <wolfssl/openssl/rsa.h>
wolfSSL 15:117db924cf7c 48 #include <wolfssl/openssl/dsa.h>
wolfSSL 15:117db924cf7c 49 #include <wolfssl/openssl/ec.h>
wolfSSL 15:117db924cf7c 50
wolfSSL 15:117db924cf7c 51 #include <wolfssl/wolfcrypt/aes.h>
wolfSSL 15:117db924cf7c 52 #include <wolfssl/wolfcrypt/des3.h>
wolfSSL 15:117db924cf7c 53 #include <wolfssl/wolfcrypt/arc4.h>
wolfSSL 15:117db924cf7c 54 #include <wolfssl/wolfcrypt/hmac.h>
wolfSSL 15:117db924cf7c 55 #ifdef HAVE_IDEA
wolfSSL 15:117db924cf7c 56 #include <wolfssl/wolfcrypt/idea.h>
wolfSSL 15:117db924cf7c 57 #endif
wolfSSL 15:117db924cf7c 58 #include <wolfssl/wolfcrypt/pwdbased.h>
wolfSSL 15:117db924cf7c 59
wolfSSL 15:117db924cf7c 60 #ifdef __cplusplus
wolfSSL 15:117db924cf7c 61 extern "C" {
wolfSSL 15:117db924cf7c 62 #endif
wolfSSL 15:117db924cf7c 63
wolfSSL 15:117db924cf7c 64
wolfSSL 15:117db924cf7c 65 typedef char WOLFSSL_EVP_CIPHER;
wolfSSL 15:117db924cf7c 66 #ifndef WOLFSSL_EVP_TYPE_DEFINED /* guard on redeclaration */
wolfSSL 15:117db924cf7c 67 typedef char WOLFSSL_EVP_MD;
wolfSSL 15:117db924cf7c 68 typedef struct WOLFSSL_EVP_PKEY WOLFSSL_EVP_PKEY;
wolfSSL 15:117db924cf7c 69 #define WOLFSSL_EVP_TYPE_DEFINED
wolfSSL 15:117db924cf7c 70 #endif
wolfSSL 15:117db924cf7c 71
wolfSSL 15:117db924cf7c 72 typedef WOLFSSL_EVP_PKEY EVP_PKEY;
wolfSSL 15:117db924cf7c 73 typedef WOLFSSL_EVP_PKEY PKCS8_PRIV_KEY_INFO;
wolfSSL 15:117db924cf7c 74
wolfSSL 15:117db924cf7c 75 #ifndef NO_MD4
wolfSSL 15:117db924cf7c 76 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_md4(void);
wolfSSL 15:117db924cf7c 77 #endif
wolfSSL 15:117db924cf7c 78 #ifndef NO_MD5
wolfSSL 15:117db924cf7c 79 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_md5(void);
wolfSSL 15:117db924cf7c 80 #endif
wolfSSL 15:117db924cf7c 81 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha1(void);
wolfSSL 15:117db924cf7c 82 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha224(void);
wolfSSL 15:117db924cf7c 83 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha256(void);
wolfSSL 15:117db924cf7c 84 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha384(void);
wolfSSL 15:117db924cf7c 85 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha512(void);
wolfSSL 15:117db924cf7c 86 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_ripemd160(void);
wolfSSL 15:117db924cf7c 87
wolfSSL 15:117db924cf7c 88 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_ecb(void);
wolfSSL 15:117db924cf7c 89 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_ecb(void);
wolfSSL 15:117db924cf7c 90 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_ecb(void);
wolfSSL 15:117db924cf7c 91 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_cbc(void);
wolfSSL 15:117db924cf7c 92 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_cbc(void);
wolfSSL 15:117db924cf7c 93 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_cbc(void);
wolfSSL 15:117db924cf7c 94 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_ctr(void);
wolfSSL 15:117db924cf7c 95 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_ctr(void);
wolfSSL 15:117db924cf7c 96 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_ctr(void);
wolfSSL 15:117db924cf7c 97 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_des_ecb(void);
wolfSSL 15:117db924cf7c 98 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_des_ede3_ecb(void);
wolfSSL 15:117db924cf7c 99 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_des_cbc(void);
wolfSSL 15:117db924cf7c 100 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_des_ede3_cbc(void);
wolfSSL 15:117db924cf7c 101 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_rc4(void);
wolfSSL 15:117db924cf7c 102 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_idea_cbc(void);
wolfSSL 15:117db924cf7c 103 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_enc_null(void);
wolfSSL 15:117db924cf7c 104
wolfSSL 15:117db924cf7c 105
wolfSSL 15:117db924cf7c 106 typedef union {
wolfSSL 15:117db924cf7c 107 #ifndef NO_MD4
wolfSSL 15:117db924cf7c 108 WOLFSSL_MD4_CTX md4;
wolfSSL 15:117db924cf7c 109 #endif
wolfSSL 15:117db924cf7c 110 #ifndef NO_MD5
wolfSSL 15:117db924cf7c 111 WOLFSSL_MD5_CTX md5;
wolfSSL 15:117db924cf7c 112 #endif
wolfSSL 15:117db924cf7c 113 WOLFSSL_SHA_CTX sha;
wolfSSL 15:117db924cf7c 114 #ifdef WOLFSSL_SHA224
wolfSSL 15:117db924cf7c 115 WOLFSSL_SHA224_CTX sha224;
wolfSSL 15:117db924cf7c 116 #endif
wolfSSL 15:117db924cf7c 117 WOLFSSL_SHA256_CTX sha256;
wolfSSL 15:117db924cf7c 118 #ifdef WOLFSSL_SHA384
wolfSSL 15:117db924cf7c 119 WOLFSSL_SHA384_CTX sha384;
wolfSSL 15:117db924cf7c 120 #endif
wolfSSL 15:117db924cf7c 121 #ifdef WOLFSSL_SHA512
wolfSSL 15:117db924cf7c 122 WOLFSSL_SHA512_CTX sha512;
wolfSSL 15:117db924cf7c 123 #endif
wolfSSL 15:117db924cf7c 124 #ifdef WOLFSSL_RIPEMD
wolfSSL 15:117db924cf7c 125 WOLFSSL_RIPEMD_CTX ripemd;
wolfSSL 15:117db924cf7c 126 #endif
wolfSSL 15:117db924cf7c 127 } WOLFSSL_Hasher;
wolfSSL 15:117db924cf7c 128
wolfSSL 15:117db924cf7c 129
wolfSSL 15:117db924cf7c 130 typedef struct WOLFSSL_EVP_MD_CTX {
wolfSSL 15:117db924cf7c 131 union {
wolfSSL 15:117db924cf7c 132 WOLFSSL_Hasher digest;
wolfSSL 15:117db924cf7c 133 Hmac hmac;
wolfSSL 15:117db924cf7c 134 } hash;
wolfSSL 15:117db924cf7c 135 unsigned char macType;
wolfSSL 15:117db924cf7c 136 } WOLFSSL_EVP_MD_CTX;
wolfSSL 15:117db924cf7c 137
wolfSSL 15:117db924cf7c 138
wolfSSL 15:117db924cf7c 139 typedef union {
wolfSSL 15:117db924cf7c 140 #ifndef NO_AES
wolfSSL 15:117db924cf7c 141 Aes aes;
wolfSSL 15:117db924cf7c 142 #endif
wolfSSL 15:117db924cf7c 143 #ifndef NO_DES3
wolfSSL 15:117db924cf7c 144 Des des;
wolfSSL 15:117db924cf7c 145 Des3 des3;
wolfSSL 15:117db924cf7c 146 #endif
wolfSSL 15:117db924cf7c 147 Arc4 arc4;
wolfSSL 15:117db924cf7c 148 #ifdef HAVE_IDEA
wolfSSL 15:117db924cf7c 149 Idea idea;
wolfSSL 15:117db924cf7c 150 #endif
wolfSSL 15:117db924cf7c 151 } WOLFSSL_Cipher;
wolfSSL 15:117db924cf7c 152
wolfSSL 15:117db924cf7c 153
wolfSSL 15:117db924cf7c 154 enum {
wolfSSL 15:117db924cf7c 155 AES_128_CBC_TYPE = 1,
wolfSSL 15:117db924cf7c 156 AES_192_CBC_TYPE = 2,
wolfSSL 15:117db924cf7c 157 AES_256_CBC_TYPE = 3,
wolfSSL 15:117db924cf7c 158 AES_128_CTR_TYPE = 4,
wolfSSL 15:117db924cf7c 159 AES_192_CTR_TYPE = 5,
wolfSSL 15:117db924cf7c 160 AES_256_CTR_TYPE = 6,
wolfSSL 15:117db924cf7c 161 AES_128_ECB_TYPE = 7,
wolfSSL 15:117db924cf7c 162 AES_192_ECB_TYPE = 8,
wolfSSL 15:117db924cf7c 163 AES_256_ECB_TYPE = 9,
wolfSSL 15:117db924cf7c 164 DES_CBC_TYPE = 10,
wolfSSL 15:117db924cf7c 165 DES_ECB_TYPE = 11,
wolfSSL 15:117db924cf7c 166 DES_EDE3_CBC_TYPE = 12,
wolfSSL 15:117db924cf7c 167 DES_EDE3_ECB_TYPE = 13,
wolfSSL 15:117db924cf7c 168 ARC4_TYPE = 14,
wolfSSL 15:117db924cf7c 169 NULL_CIPHER_TYPE = 15,
wolfSSL 15:117db924cf7c 170 EVP_PKEY_RSA = 16,
wolfSSL 15:117db924cf7c 171 EVP_PKEY_DSA = 17,
wolfSSL 15:117db924cf7c 172 EVP_PKEY_EC = 18,
wolfSSL 15:117db924cf7c 173 #ifdef HAVE_IDEA
wolfSSL 15:117db924cf7c 174 IDEA_CBC_TYPE = 19,
wolfSSL 15:117db924cf7c 175 #endif
wolfSSL 15:117db924cf7c 176 NID_sha1 = 64,
wolfSSL 15:117db924cf7c 177 NID_sha224 = 65,
wolfSSL 15:117db924cf7c 178 NID_md2 = 77,
wolfSSL 15:117db924cf7c 179 NID_md5 = 4,
wolfSSL 15:117db924cf7c 180 NID_hmac = 855,
wolfSSL 15:117db924cf7c 181 EVP_PKEY_HMAC = NID_hmac
wolfSSL 15:117db924cf7c 182 };
wolfSSL 15:117db924cf7c 183
wolfSSL 15:117db924cf7c 184 enum {
wolfSSL 15:117db924cf7c 185 NID_aes_128_cbc = 419,
wolfSSL 15:117db924cf7c 186 NID_aes_192_cbc = 423,
wolfSSL 15:117db924cf7c 187 NID_aes_256_cbc = 427,
wolfSSL 15:117db924cf7c 188 NID_aes_128_ctr = 904,
wolfSSL 15:117db924cf7c 189 NID_aes_192_ctr = 905,
wolfSSL 15:117db924cf7c 190 NID_aes_256_ctr = 906,
wolfSSL 15:117db924cf7c 191 NID_aes_128_ecb = 418,
wolfSSL 15:117db924cf7c 192 NID_aes_192_ecb = 422,
wolfSSL 15:117db924cf7c 193 NID_aes_256_ecb = 426,
wolfSSL 15:117db924cf7c 194 NID_des_cbc = 31,
wolfSSL 15:117db924cf7c 195 NID_des_ecb = 29,
wolfSSL 15:117db924cf7c 196 NID_des_ede3_cbc= 44,
wolfSSL 15:117db924cf7c 197 NID_des_ede3_ecb= 33,
wolfSSL 15:117db924cf7c 198 NID_idea_cbc = 34,
wolfSSL 15:117db924cf7c 199 };
wolfSSL 15:117db924cf7c 200
wolfSSL 15:117db924cf7c 201 #define WOLFSSL_EVP_BUF_SIZE 16
wolfSSL 15:117db924cf7c 202 typedef struct WOLFSSL_EVP_CIPHER_CTX {
wolfSSL 15:117db924cf7c 203 int keyLen; /* user may set for variable */
wolfSSL 15:117db924cf7c 204 int block_size;
wolfSSL 15:117db924cf7c 205 unsigned long flags;
wolfSSL 15:117db924cf7c 206 unsigned char enc; /* if encrypt side, then true */
wolfSSL 15:117db924cf7c 207 unsigned char cipherType;
wolfSSL 15:117db924cf7c 208 #ifndef NO_AES
wolfSSL 15:117db924cf7c 209 /* working iv pointer into cipher */
wolfSSL 15:117db924cf7c 210 ALIGN16 unsigned char iv[AES_BLOCK_SIZE];
wolfSSL 15:117db924cf7c 211 #elif !defined(NO_DES3)
wolfSSL 15:117db924cf7c 212 /* working iv pointer into cipher */
wolfSSL 15:117db924cf7c 213 ALIGN16 unsigned char iv[DES_BLOCK_SIZE];
wolfSSL 15:117db924cf7c 214 #endif
wolfSSL 15:117db924cf7c 215 WOLFSSL_Cipher cipher;
wolfSSL 15:117db924cf7c 216 ALIGN16 byte buf[WOLFSSL_EVP_BUF_SIZE];
wolfSSL 15:117db924cf7c 217 int bufUsed;
wolfSSL 15:117db924cf7c 218 ALIGN16 byte lastBlock[WOLFSSL_EVP_BUF_SIZE];
wolfSSL 15:117db924cf7c 219 int lastUsed;
wolfSSL 15:117db924cf7c 220 } WOLFSSL_EVP_CIPHER_CTX;
wolfSSL 15:117db924cf7c 221
wolfSSL 15:117db924cf7c 222 typedef struct WOLFSSL_EVP_PKEY_CTX {
wolfSSL 15:117db924cf7c 223 WOLFSSL_EVP_PKEY *pkey;
wolfSSL 15:117db924cf7c 224 int op; /* operation */
wolfSSL 15:117db924cf7c 225 int padding;
wolfSSL 15:117db924cf7c 226 } WOLFSSL_EVP_PKEY_CTX;
wolfSSL 15:117db924cf7c 227
wolfSSL 15:117db924cf7c 228 typedef int WOLFSSL_ENGINE ;
wolfSSL 15:117db924cf7c 229 typedef WOLFSSL_ENGINE ENGINE;
wolfSSL 15:117db924cf7c 230 typedef WOLFSSL_EVP_PKEY_CTX EVP_PKEY_CTX;
wolfSSL 15:117db924cf7c 231
wolfSSL 15:117db924cf7c 232 #define EVP_PKEY_OP_ENCRYPT (1 << 6)
wolfSSL 15:117db924cf7c 233 #define EVP_PKEY_OP_DECRYPT (1 << 7)
wolfSSL 15:117db924cf7c 234
wolfSSL 15:117db924cf7c 235 WOLFSSL_API void wolfSSL_EVP_init(void);
wolfSSL 15:117db924cf7c 236 WOLFSSL_API int wolfSSL_EVP_MD_size(const WOLFSSL_EVP_MD* md);
wolfSSL 15:117db924cf7c 237 WOLFSSL_API int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md);
wolfSSL 15:117db924cf7c 238
wolfSSL 15:117db924cf7c 239 WOLFSSL_API WOLFSSL_EVP_MD_CTX *wolfSSL_EVP_MD_CTX_new (void);
wolfSSL 15:117db924cf7c 240 WOLFSSL_API void wolfSSL_EVP_MD_CTX_free(WOLFSSL_EVP_MD_CTX* ctx);
wolfSSL 15:117db924cf7c 241 WOLFSSL_API void wolfSSL_EVP_MD_CTX_init(WOLFSSL_EVP_MD_CTX* ctx);
wolfSSL 15:117db924cf7c 242 WOLFSSL_API int wolfSSL_EVP_MD_CTX_cleanup(WOLFSSL_EVP_MD_CTX* ctx);
wolfSSL 15:117db924cf7c 243 WOLFSSL_API int wolfSSL_EVP_MD_CTX_copy(WOLFSSL_EVP_MD_CTX *out, const WOLFSSL_EVP_MD_CTX *in);
wolfSSL 15:117db924cf7c 244 WOLFSSL_API int wolfSSL_EVP_MD_CTX_copy_ex(WOLFSSL_EVP_MD_CTX *out, const WOLFSSL_EVP_MD_CTX *in);
wolfSSL 15:117db924cf7c 245 WOLFSSL_API int wolfSSL_EVP_MD_CTX_type(const WOLFSSL_EVP_MD_CTX *ctx);
wolfSSL 15:117db924cf7c 246 WOLFSSL_API const WOLFSSL_EVP_MD *wolfSSL_EVP_MD_CTX_md(const WOLFSSL_EVP_MD_CTX *ctx);
wolfSSL 15:117db924cf7c 247 WOLFSSL_API const WOLFSSL_EVP_CIPHER *wolfSSL_EVP_get_cipherbyname(const char *name);
wolfSSL 15:117db924cf7c 248 WOLFSSL_API const WOLFSSL_EVP_MD *wolfSSL_EVP_get_digestbyname(const char *name);
wolfSSL 15:117db924cf7c 249
wolfSSL 15:117db924cf7c 250 WOLFSSL_API int wolfSSL_EVP_DigestInit(WOLFSSL_EVP_MD_CTX* ctx,
wolfSSL 15:117db924cf7c 251 const WOLFSSL_EVP_MD* type);
wolfSSL 15:117db924cf7c 252 WOLFSSL_API int wolfSSL_EVP_DigestInit_ex(WOLFSSL_EVP_MD_CTX* ctx,
wolfSSL 15:117db924cf7c 253 const WOLFSSL_EVP_MD* type,
wolfSSL 15:117db924cf7c 254 WOLFSSL_ENGINE *impl);
wolfSSL 15:117db924cf7c 255 WOLFSSL_API int wolfSSL_EVP_DigestUpdate(WOLFSSL_EVP_MD_CTX* ctx, const void* data,
wolfSSL 15:117db924cf7c 256 size_t sz);
wolfSSL 15:117db924cf7c 257 WOLFSSL_API int wolfSSL_EVP_DigestFinal(WOLFSSL_EVP_MD_CTX* ctx, unsigned char* md,
wolfSSL 15:117db924cf7c 258 unsigned int* s);
wolfSSL 15:117db924cf7c 259 WOLFSSL_API int wolfSSL_EVP_DigestFinal_ex(WOLFSSL_EVP_MD_CTX* ctx,
wolfSSL 15:117db924cf7c 260 unsigned char* md, unsigned int* s);
wolfSSL 15:117db924cf7c 261
wolfSSL 15:117db924cf7c 262 WOLFSSL_API int wolfSSL_EVP_DigestSignInit(WOLFSSL_EVP_MD_CTX *ctx,
wolfSSL 15:117db924cf7c 263 WOLFSSL_EVP_PKEY_CTX **pctx,
wolfSSL 15:117db924cf7c 264 const WOLFSSL_EVP_MD *type,
wolfSSL 15:117db924cf7c 265 WOLFSSL_ENGINE *e,
wolfSSL 15:117db924cf7c 266 WOLFSSL_EVP_PKEY *pkey);
wolfSSL 15:117db924cf7c 267 WOLFSSL_API int wolfSSL_EVP_DigestSignUpdate(WOLFSSL_EVP_MD_CTX *ctx,
wolfSSL 15:117db924cf7c 268 const void *d, unsigned int cnt);
wolfSSL 15:117db924cf7c 269 WOLFSSL_API int wolfSSL_EVP_DigestSignFinal(WOLFSSL_EVP_MD_CTX *ctx,
wolfSSL 15:117db924cf7c 270 unsigned char *sig, size_t *siglen);
wolfSSL 15:117db924cf7c 271
wolfSSL 15:117db924cf7c 272 WOLFSSL_API int wolfSSL_EVP_BytesToKey(const WOLFSSL_EVP_CIPHER*,
wolfSSL 15:117db924cf7c 273 const WOLFSSL_EVP_MD*, const unsigned char*,
wolfSSL 15:117db924cf7c 274 const unsigned char*, int, int, unsigned char*,
wolfSSL 15:117db924cf7c 275 unsigned char*);
wolfSSL 15:117db924cf7c 276
wolfSSL 15:117db924cf7c 277 WOLFSSL_API void wolfSSL_EVP_CIPHER_CTX_init(WOLFSSL_EVP_CIPHER_CTX* ctx);
wolfSSL 15:117db924cf7c 278 WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_cleanup(WOLFSSL_EVP_CIPHER_CTX* ctx);
wolfSSL 15:117db924cf7c 279
wolfSSL 15:117db924cf7c 280 WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_iv_length(const WOLFSSL_EVP_CIPHER_CTX*);
wolfSSL 15:117db924cf7c 281 WOLFSSL_API int wolfSSL_EVP_CIPHER_iv_length(const WOLFSSL_EVP_CIPHER*);
wolfSSL 15:117db924cf7c 282 WOLFSSL_API int wolfSSL_EVP_Cipher_key_length(const WOLFSSL_EVP_CIPHER* c);
wolfSSL 15:117db924cf7c 283
wolfSSL 15:117db924cf7c 284
wolfSSL 15:117db924cf7c 285 WOLFSSL_API int wolfSSL_EVP_CipherInit(WOLFSSL_EVP_CIPHER_CTX* ctx,
wolfSSL 15:117db924cf7c 286 const WOLFSSL_EVP_CIPHER* type,
wolfSSL 15:117db924cf7c 287 const unsigned char* key,
wolfSSL 15:117db924cf7c 288 const unsigned char* iv,
wolfSSL 15:117db924cf7c 289 int enc);
wolfSSL 15:117db924cf7c 290 WOLFSSL_API int wolfSSL_EVP_CipherInit_ex(WOLFSSL_EVP_CIPHER_CTX* ctx,
wolfSSL 15:117db924cf7c 291 const WOLFSSL_EVP_CIPHER* type,
wolfSSL 15:117db924cf7c 292 WOLFSSL_ENGINE *impl,
wolfSSL 15:117db924cf7c 293 const unsigned char* key,
wolfSSL 15:117db924cf7c 294 const unsigned char* iv,
wolfSSL 15:117db924cf7c 295 int enc);
wolfSSL 15:117db924cf7c 296 WOLFSSL_API int wolfSSL_EVP_EncryptInit(WOLFSSL_EVP_CIPHER_CTX* ctx,
wolfSSL 15:117db924cf7c 297 const WOLFSSL_EVP_CIPHER* type,
wolfSSL 15:117db924cf7c 298 const unsigned char* key,
wolfSSL 15:117db924cf7c 299 const unsigned char* iv);
wolfSSL 15:117db924cf7c 300 WOLFSSL_API int wolfSSL_EVP_EncryptInit_ex(WOLFSSL_EVP_CIPHER_CTX* ctx,
wolfSSL 15:117db924cf7c 301 const WOLFSSL_EVP_CIPHER* type,
wolfSSL 15:117db924cf7c 302 WOLFSSL_ENGINE *impl,
wolfSSL 15:117db924cf7c 303 const unsigned char* key,
wolfSSL 15:117db924cf7c 304 const unsigned char* iv);
wolfSSL 15:117db924cf7c 305 WOLFSSL_API int wolfSSL_EVP_DecryptInit(WOLFSSL_EVP_CIPHER_CTX* ctx,
wolfSSL 15:117db924cf7c 306 const WOLFSSL_EVP_CIPHER* type,
wolfSSL 15:117db924cf7c 307 const unsigned char* key,
wolfSSL 15:117db924cf7c 308 const unsigned char* iv);
wolfSSL 15:117db924cf7c 309 WOLFSSL_API int wolfSSL_EVP_DecryptInit_ex(WOLFSSL_EVP_CIPHER_CTX* ctx,
wolfSSL 15:117db924cf7c 310 const WOLFSSL_EVP_CIPHER* type,
wolfSSL 15:117db924cf7c 311 WOLFSSL_ENGINE *impl,
wolfSSL 15:117db924cf7c 312 const unsigned char* key,
wolfSSL 15:117db924cf7c 313 const unsigned char* iv);
wolfSSL 15:117db924cf7c 314 WOLFSSL_API int wolfSSL_EVP_CipherUpdate(WOLFSSL_EVP_CIPHER_CTX *ctx,
wolfSSL 15:117db924cf7c 315 unsigned char *out, int *outl,
wolfSSL 15:117db924cf7c 316 const unsigned char *in, int inl);
wolfSSL 15:117db924cf7c 317 WOLFSSL_API int wolfSSL_EVP_CipherFinal(WOLFSSL_EVP_CIPHER_CTX *ctx,
wolfSSL 15:117db924cf7c 318 unsigned char *out, int *outl);
wolfSSL 15:117db924cf7c 319 WOLFSSL_API int wolfSSL_EVP_CipherFinal_ex(WOLFSSL_EVP_CIPHER_CTX *ctx,
wolfSSL 15:117db924cf7c 320 unsigned char *out, int *outl, int enc);
wolfSSL 15:117db924cf7c 321 WOLFSSL_API int wolfSSL_EVP_EncryptFinal(WOLFSSL_EVP_CIPHER_CTX *ctx,
wolfSSL 15:117db924cf7c 322 unsigned char *out, int *outl);
wolfSSL 15:117db924cf7c 323 WOLFSSL_API int wolfSSL_EVP_EncryptFinal_ex(WOLFSSL_EVP_CIPHER_CTX *ctx,
wolfSSL 15:117db924cf7c 324 unsigned char *out, int *outl);
wolfSSL 15:117db924cf7c 325 WOLFSSL_API int wolfSSL_EVP_DecryptFinal(WOLFSSL_EVP_CIPHER_CTX *ctx,
wolfSSL 15:117db924cf7c 326 unsigned char *out, int *outl);
wolfSSL 15:117db924cf7c 327 WOLFSSL_API int wolfSSL_EVP_DecryptFinal_ex(WOLFSSL_EVP_CIPHER_CTX *ctx,
wolfSSL 15:117db924cf7c 328 unsigned char *out, int *outl);
wolfSSL 15:117db924cf7c 329
wolfSSL 15:117db924cf7c 330 WOLFSSL_API WOLFSSL_EVP_CIPHER_CTX *wolfSSL_EVP_CIPHER_CTX_new(void);
wolfSSL 15:117db924cf7c 331 WOLFSSL_API void wolfSSL_EVP_CIPHER_CTX_free(WOLFSSL_EVP_CIPHER_CTX *ctx);
wolfSSL 15:117db924cf7c 332 WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_key_length(WOLFSSL_EVP_CIPHER_CTX* ctx);
wolfSSL 15:117db924cf7c 333 WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_set_key_length(WOLFSSL_EVP_CIPHER_CTX* ctx,
wolfSSL 15:117db924cf7c 334 int keylen);
wolfSSL 15:117db924cf7c 335 WOLFSSL_API int wolfSSL_EVP_Cipher(WOLFSSL_EVP_CIPHER_CTX* ctx,
wolfSSL 15:117db924cf7c 336 unsigned char* dst, unsigned char* src,
wolfSSL 15:117db924cf7c 337 unsigned int len);
wolfSSL 15:117db924cf7c 338
wolfSSL 15:117db924cf7c 339 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_get_cipherbynid(int);
wolfSSL 15:117db924cf7c 340 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_get_digestbynid(int);
wolfSSL 15:117db924cf7c 341
wolfSSL 15:117db924cf7c 342 WOLFSSL_API WOLFSSL_RSA* wolfSSL_EVP_PKEY_get1_RSA(WOLFSSL_EVP_PKEY*);
wolfSSL 15:117db924cf7c 343 WOLFSSL_API WOLFSSL_DSA* wolfSSL_EVP_PKEY_get1_DSA(WOLFSSL_EVP_PKEY*);
wolfSSL 15:117db924cf7c 344 WOLFSSL_API WOLFSSL_EC_KEY *wolfSSL_EVP_PKEY_get1_EC_KEY(WOLFSSL_EVP_PKEY *key);
wolfSSL 15:117db924cf7c 345 WOLFSSL_API int wolfSSL_EVP_PKEY_set1_RSA(WOLFSSL_EVP_PKEY *pkey, WOLFSSL_RSA *key);
wolfSSL 15:117db924cf7c 346
wolfSSL 15:117db924cf7c 347 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_EVP_PKEY_new_mac_key(int type, ENGINE* e,
wolfSSL 15:117db924cf7c 348 const unsigned char* key, int keylen);
wolfSSL 15:117db924cf7c 349 WOLFSSL_API const unsigned char* wolfSSL_EVP_PKEY_get0_hmac(const WOLFSSL_EVP_PKEY* pkey,
wolfSSL 15:117db924cf7c 350 size_t* len);
wolfSSL 15:117db924cf7c 351 WOLFSSL_API int wolfSSL_EVP_PKEY_bits(const WOLFSSL_EVP_PKEY *pkey);
wolfSSL 15:117db924cf7c 352 WOLFSSL_API int wolfSSL_EVP_PKEY_CTX_free(WOLFSSL_EVP_PKEY_CTX *ctx);
wolfSSL 15:117db924cf7c 353 WOLFSSL_API WOLFSSL_EVP_PKEY_CTX *wolfSSL_EVP_PKEY_CTX_new(WOLFSSL_EVP_PKEY *pkey, WOLFSSL_ENGINE *e);
wolfSSL 15:117db924cf7c 354 WOLFSSL_API int wolfSSL_EVP_PKEY_CTX_set_rsa_padding(WOLFSSL_EVP_PKEY_CTX *ctx, int padding);
wolfSSL 15:117db924cf7c 355 WOLFSSL_API int wolfSSL_EVP_PKEY_decrypt(WOLFSSL_EVP_PKEY_CTX *ctx,
wolfSSL 15:117db924cf7c 356 unsigned char *out, size_t *outlen,
wolfSSL 15:117db924cf7c 357 const unsigned char *in, size_t inlen);
wolfSSL 15:117db924cf7c 358 WOLFSSL_API int wolfSSL_EVP_PKEY_decrypt_init(WOLFSSL_EVP_PKEY_CTX *ctx);
wolfSSL 15:117db924cf7c 359 WOLFSSL_API int wolfSSL_EVP_PKEY_encrypt(WOLFSSL_EVP_PKEY_CTX *ctx,
wolfSSL 15:117db924cf7c 360 unsigned char *out, size_t *outlen,
wolfSSL 15:117db924cf7c 361 const unsigned char *in, size_t inlen);
wolfSSL 15:117db924cf7c 362 WOLFSSL_API int wolfSSL_EVP_PKEY_encrypt_init(WOLFSSL_EVP_PKEY_CTX *ctx);
wolfSSL 15:117db924cf7c 363 WOLFSSL_API WOLFSSL_EVP_PKEY *wolfSSL_EVP_PKEY_new(void);
wolfSSL 15:117db924cf7c 364 WOLFSSL_API void wolfSSL_EVP_PKEY_free(WOLFSSL_EVP_PKEY*);
wolfSSL 15:117db924cf7c 365 WOLFSSL_API int wolfSSL_EVP_PKEY_size(WOLFSSL_EVP_PKEY *pkey);
wolfSSL 15:117db924cf7c 366 WOLFSSL_API int wolfSSL_EVP_PKEY_type(int type);
wolfSSL 15:117db924cf7c 367 WOLFSSL_API int wolfSSL_EVP_PKEY_base_id(const EVP_PKEY *pkey);
wolfSSL 15:117db924cf7c 368 WOLFSSL_API int wolfSSL_EVP_SignFinal(WOLFSSL_EVP_MD_CTX *ctx, unsigned char *sigret,
wolfSSL 15:117db924cf7c 369 unsigned int *siglen, WOLFSSL_EVP_PKEY *pkey);
wolfSSL 15:117db924cf7c 370 WOLFSSL_API int wolfSSL_EVP_SignInit(WOLFSSL_EVP_MD_CTX *ctx, const WOLFSSL_EVP_MD *type);
wolfSSL 15:117db924cf7c 371 WOLFSSL_API int wolfSSL_EVP_SignUpdate(WOLFSSL_EVP_MD_CTX *ctx, const void *data, size_t len);
wolfSSL 15:117db924cf7c 372 WOLFSSL_API int wolfSSL_EVP_VerifyFinal(WOLFSSL_EVP_MD_CTX *ctx,
wolfSSL 15:117db924cf7c 373 unsigned char* sig, unsigned int sig_len, WOLFSSL_EVP_PKEY *pkey);
wolfSSL 15:117db924cf7c 374 WOLFSSL_API int wolfSSL_EVP_VerifyInit(WOLFSSL_EVP_MD_CTX *ctx, const WOLFSSL_EVP_MD *type);
wolfSSL 15:117db924cf7c 375 WOLFSSL_API int wolfSSL_EVP_VerifyUpdate(WOLFSSL_EVP_MD_CTX *ctx, const void *data, size_t len);
wolfSSL 15:117db924cf7c 376
wolfSSL 15:117db924cf7c 377
wolfSSL 15:117db924cf7c 378 /* these next ones don't need real OpenSSL type, for OpenSSH compat only */
wolfSSL 15:117db924cf7c 379 WOLFSSL_API void* wolfSSL_EVP_X_STATE(const WOLFSSL_EVP_CIPHER_CTX* ctx);
wolfSSL 15:117db924cf7c 380 WOLFSSL_API int wolfSSL_EVP_X_STATE_LEN(const WOLFSSL_EVP_CIPHER_CTX* ctx);
wolfSSL 15:117db924cf7c 381
wolfSSL 15:117db924cf7c 382 WOLFSSL_API void wolfSSL_3des_iv(WOLFSSL_EVP_CIPHER_CTX* ctx, int doset,
wolfSSL 15:117db924cf7c 383 unsigned char* iv, int len);
wolfSSL 15:117db924cf7c 384 WOLFSSL_API void wolfSSL_aes_ctr_iv(WOLFSSL_EVP_CIPHER_CTX* ctx, int doset,
wolfSSL 15:117db924cf7c 385 unsigned char* iv, int len);
wolfSSL 15:117db924cf7c 386
wolfSSL 15:117db924cf7c 387 WOLFSSL_API int wolfSSL_StoreExternalIV(WOLFSSL_EVP_CIPHER_CTX* ctx);
wolfSSL 15:117db924cf7c 388 WOLFSSL_API int wolfSSL_SetInternalIV(WOLFSSL_EVP_CIPHER_CTX* ctx);
wolfSSL 15:117db924cf7c 389
wolfSSL 15:117db924cf7c 390 WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_block_size(const WOLFSSL_EVP_CIPHER_CTX *ctx);
wolfSSL 15:117db924cf7c 391 WOLFSSL_API int wolfSSL_EVP_CIPHER_block_size(const WOLFSSL_EVP_CIPHER *cipher);
wolfSSL 15:117db924cf7c 392 WOLFSSL_API unsigned long WOLFSSL_EVP_CIPHER_mode(const WOLFSSL_EVP_CIPHER *cipher);
wolfSSL 15:117db924cf7c 393 WOLFSSL_API unsigned long WOLFSSL_CIPHER_mode(const WOLFSSL_EVP_CIPHER *cipher);
wolfSSL 15:117db924cf7c 394 WOLFSSL_API unsigned long wolfSSL_EVP_CIPHER_flags(const WOLFSSL_EVP_CIPHER *cipher);
wolfSSL 15:117db924cf7c 395 WOLFSSL_API void wolfSSL_EVP_CIPHER_CTX_set_flags(WOLFSSL_EVP_CIPHER_CTX *ctx, int flags);
wolfSSL 15:117db924cf7c 396 WOLFSSL_API unsigned long wolfSSL_EVP_CIPHER_CTX_mode(const WOLFSSL_EVP_CIPHER_CTX *ctx);
wolfSSL 15:117db924cf7c 397 WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_set_padding(WOLFSSL_EVP_CIPHER_CTX *c, int pad);
wolfSSL 15:117db924cf7c 398 WOLFSSL_API int wolfSSL_EVP_add_digest(const WOLFSSL_EVP_MD *digest);
wolfSSL 15:117db924cf7c 399 WOLFSSL_API int wolfSSL_EVP_add_cipher(const WOLFSSL_EVP_CIPHER *cipher);
wolfSSL 15:117db924cf7c 400 WOLFSSL_API void wolfSSL_EVP_cleanup(void);
wolfSSL 15:117db924cf7c 401 WOLFSSL_API int wolfSSL_add_all_algorithms(void);
wolfSSL 15:117db924cf7c 402
wolfSSL 15:117db924cf7c 403 #ifdef OPENSSL_EXTRA
wolfSSL 15:117db924cf7c 404 WOLFSSL_API int wolfSSL_OPENSSL_add_all_algorithms_noconf(void);
wolfSSL 15:117db924cf7c 405 #endif
wolfSSL 15:117db924cf7c 406
wolfSSL 15:117db924cf7c 407 WOLFSSL_API int wolfSSL_PKCS5_PBKDF2_HMAC_SHA1(const char * pass, int passlen,
wolfSSL 15:117db924cf7c 408 const unsigned char * salt,
wolfSSL 15:117db924cf7c 409 int saltlen, int iter,
wolfSSL 15:117db924cf7c 410 int keylen, unsigned char *out);
wolfSSL 15:117db924cf7c 411
wolfSSL 15:117db924cf7c 412 #define EVP_CIPH_STREAM_CIPHER WOLFSSL_EVP_CIPH_STREAM_CIPHER
wolfSSL 15:117db924cf7c 413 #define EVP_CIPH_ECB_MODE WOLFSSL_EVP_CIPH_ECB_MODE
wolfSSL 15:117db924cf7c 414 #define EVP_CIPH_CBC_MODE WOLFSSL_EVP_CIPH_CBC_MODE
wolfSSL 15:117db924cf7c 415 #define EVP_CIPH_CFB_MODE WOLFSSL_EVP_CIPH_CFB_MODE
wolfSSL 15:117db924cf7c 416 #define EVP_CIPH_OFB_MODE WOLFSSL_EVP_CIPH_OFB_MODE
wolfSSL 15:117db924cf7c 417 #define EVP_CIPH_CTR_MODE WOLFSSL_EVP_CIPH_CTR_MODE
wolfSSL 15:117db924cf7c 418 #define EVP_CIPH_GCM_MODE WOLFSSL_EVP_CIPH_GCM_MODE
wolfSSL 15:117db924cf7c 419 #define EVP_CIPH_CCM_MODE WOLFSSL_EVP_CIPH_CCM_MODE
wolfSSL 15:117db924cf7c 420
wolfSSL 15:117db924cf7c 421 #define WOLFSSL_EVP_CIPH_MODE 0x0007
wolfSSL 15:117db924cf7c 422 #define WOLFSSL_EVP_CIPH_STREAM_CIPHER 0x0
wolfSSL 15:117db924cf7c 423 #define WOLFSSL_EVP_CIPH_ECB_MODE 0x1
wolfSSL 15:117db924cf7c 424 #define WOLFSSL_EVP_CIPH_CBC_MODE 0x2
wolfSSL 15:117db924cf7c 425 #define WOLFSSL_EVP_CIPH_CFB_MODE 0x3
wolfSSL 15:117db924cf7c 426 #define WOLFSSL_EVP_CIPH_OFB_MODE 0x4
wolfSSL 15:117db924cf7c 427 #define WOLFSSL_EVP_CIPH_CTR_MODE 0x5
wolfSSL 15:117db924cf7c 428 #define WOLFSSL_EVP_CIPH_GCM_MODE 0x6
wolfSSL 15:117db924cf7c 429 #define WOLFSSL_EVP_CIPH_CCM_MODE 0x7
wolfSSL 15:117db924cf7c 430 #define WOLFSSL_EVP_CIPH_NO_PADDING 0x100
wolfSSL 15:117db924cf7c 431 #define WOLFSSL_EVP_CIPH_TYPE_INIT 0xff
wolfSSL 15:117db924cf7c 432
wolfSSL 15:117db924cf7c 433 /* end OpenSSH compat */
wolfSSL 15:117db924cf7c 434
wolfSSL 15:117db924cf7c 435 typedef WOLFSSL_EVP_MD EVP_MD;
wolfSSL 15:117db924cf7c 436 typedef WOLFSSL_EVP_CIPHER EVP_CIPHER;
wolfSSL 15:117db924cf7c 437 typedef WOLFSSL_EVP_MD_CTX EVP_MD_CTX;
wolfSSL 15:117db924cf7c 438 typedef WOLFSSL_EVP_CIPHER_CTX EVP_CIPHER_CTX;
wolfSSL 15:117db924cf7c 439
wolfSSL 15:117db924cf7c 440 #ifndef NO_MD4
wolfSSL 15:117db924cf7c 441 #define EVP_md4 wolfSSL_EVP_md4
wolfSSL 15:117db924cf7c 442 #endif
wolfSSL 15:117db924cf7c 443 #ifndef NO_MD5
wolfSSL 15:117db924cf7c 444 #define EVP_md5 wolfSSL_EVP_md5
wolfSSL 15:117db924cf7c 445 #endif
wolfSSL 15:117db924cf7c 446 #define EVP_sha1 wolfSSL_EVP_sha1
wolfSSL 15:117db924cf7c 447 #define EVP_dds1 wolfSSL_EVP_sha1
wolfSSL 15:117db924cf7c 448 #define EVP_sha224 wolfSSL_EVP_sha224
wolfSSL 15:117db924cf7c 449 #define EVP_sha256 wolfSSL_EVP_sha256
wolfSSL 15:117db924cf7c 450 #define EVP_sha384 wolfSSL_EVP_sha384
wolfSSL 15:117db924cf7c 451 #define EVP_sha512 wolfSSL_EVP_sha512
wolfSSL 15:117db924cf7c 452 #define EVP_ripemd160 wolfSSL_EVP_ripemd160
wolfSSL 15:117db924cf7c 453
wolfSSL 15:117db924cf7c 454 #define EVP_aes_128_cbc wolfSSL_EVP_aes_128_cbc
wolfSSL 15:117db924cf7c 455 #define EVP_aes_192_cbc wolfSSL_EVP_aes_192_cbc
wolfSSL 15:117db924cf7c 456 #define EVP_aes_256_cbc wolfSSL_EVP_aes_256_cbc
wolfSSL 15:117db924cf7c 457 #define EVP_aes_128_ecb wolfSSL_EVP_aes_128_ecb
wolfSSL 15:117db924cf7c 458 #define EVP_aes_192_ecb wolfSSL_EVP_aes_192_ecb
wolfSSL 15:117db924cf7c 459 #define EVP_aes_256_ecb wolfSSL_EVP_aes_256_ecb
wolfSSL 15:117db924cf7c 460 #define EVP_aes_128_ctr wolfSSL_EVP_aes_128_ctr
wolfSSL 15:117db924cf7c 461 #define EVP_aes_192_ctr wolfSSL_EVP_aes_192_ctr
wolfSSL 15:117db924cf7c 462 #define EVP_aes_256_ctr wolfSSL_EVP_aes_256_ctr
wolfSSL 15:117db924cf7c 463 #define EVP_des_cbc wolfSSL_EVP_des_cbc
wolfSSL 15:117db924cf7c 464 #define EVP_des_ecb wolfSSL_EVP_des_ecb
wolfSSL 15:117db924cf7c 465 #define EVP_des_ede3_cbc wolfSSL_EVP_des_ede3_cbc
wolfSSL 15:117db924cf7c 466 #define EVP_des_ede3_ecb wolfSSL_EVP_des_ede3_ecb
wolfSSL 15:117db924cf7c 467 #define EVP_rc4 wolfSSL_EVP_rc4
wolfSSL 15:117db924cf7c 468 #define EVP_idea_cbc wolfSSL_EVP_idea_cbc
wolfSSL 15:117db924cf7c 469 #define EVP_enc_null wolfSSL_EVP_enc_null
wolfSSL 15:117db924cf7c 470
wolfSSL 15:117db924cf7c 471 #define EVP_MD_size wolfSSL_EVP_MD_size
wolfSSL 15:117db924cf7c 472 #define EVP_MD_CTX_new wolfSSL_EVP_MD_CTX_new
wolfSSL 15:117db924cf7c 473 #define EVP_MD_CTX_create wolfSSL_EVP_MD_CTX_new
wolfSSL 15:117db924cf7c 474 #define EVP_MD_CTX_free wolfSSL_EVP_MD_CTX_free
wolfSSL 15:117db924cf7c 475 #define EVP_MD_CTX_destroy wolfSSL_EVP_MD_CTX_free
wolfSSL 15:117db924cf7c 476 #define EVP_MD_CTX_init wolfSSL_EVP_MD_CTX_init
wolfSSL 15:117db924cf7c 477 #define EVP_MD_CTX_cleanup wolfSSL_EVP_MD_CTX_cleanup
wolfSSL 15:117db924cf7c 478 #define EVP_MD_CTX_md wolfSSL_EVP_MD_CTX_md
wolfSSL 15:117db924cf7c 479 #define EVP_MD_CTX_type wolfSSL_EVP_MD_CTX_type
wolfSSL 15:117db924cf7c 480 #define EVP_MD_type wolfSSL_EVP_MD_type
wolfSSL 15:117db924cf7c 481
wolfSSL 15:117db924cf7c 482 #define EVP_DigestInit wolfSSL_EVP_DigestInit
wolfSSL 15:117db924cf7c 483 #define EVP_DigestInit_ex wolfSSL_EVP_DigestInit_ex
wolfSSL 15:117db924cf7c 484 #define EVP_DigestUpdate wolfSSL_EVP_DigestUpdate
wolfSSL 15:117db924cf7c 485 #define EVP_DigestFinal wolfSSL_EVP_DigestFinal
wolfSSL 15:117db924cf7c 486 #define EVP_DigestFinal_ex wolfSSL_EVP_DigestFinal_ex
wolfSSL 15:117db924cf7c 487 #define EVP_DigestSignInit wolfSSL_EVP_DigestSignInit
wolfSSL 15:117db924cf7c 488 #define EVP_DigestSignUpdate wolfSSL_EVP_DigestSignUpdate
wolfSSL 15:117db924cf7c 489 #define EVP_DigestSignFinal wolfSSL_EVP_DigestSignFinal
wolfSSL 15:117db924cf7c 490 #define EVP_BytesToKey wolfSSL_EVP_BytesToKey
wolfSSL 15:117db924cf7c 491
wolfSSL 15:117db924cf7c 492 #define EVP_get_cipherbyname wolfSSL_EVP_get_cipherbyname
wolfSSL 15:117db924cf7c 493 #define EVP_get_digestbyname wolfSSL_EVP_get_digestbyname
wolfSSL 15:117db924cf7c 494
wolfSSL 15:117db924cf7c 495 #define EVP_CIPHER_CTX_init wolfSSL_EVP_CIPHER_CTX_init
wolfSSL 15:117db924cf7c 496 #define EVP_CIPHER_CTX_cleanup wolfSSL_EVP_CIPHER_CTX_cleanup
wolfSSL 15:117db924cf7c 497 #define EVP_CIPHER_CTX_iv_length wolfSSL_EVP_CIPHER_CTX_iv_length
wolfSSL 15:117db924cf7c 498 #define EVP_CIPHER_CTX_key_length wolfSSL_EVP_CIPHER_CTX_key_length
wolfSSL 15:117db924cf7c 499 #define EVP_CIPHER_CTX_set_key_length wolfSSL_EVP_CIPHER_CTX_set_key_length
wolfSSL 15:117db924cf7c 500 #define EVP_CIPHER_CTX_mode wolfSSL_EVP_CIPHER_CTX_mode
wolfSSL 15:117db924cf7c 501
wolfSSL 15:117db924cf7c 502 #define EVP_CIPHER_iv_length wolfSSL_EVP_CIPHER_iv_length
wolfSSL 15:117db924cf7c 503 #define EVP_CIPHER_key_length wolfSSL_EVP_Cipher_key_length
wolfSSL 15:117db924cf7c 504
wolfSSL 15:117db924cf7c 505 #define EVP_CipherInit wolfSSL_EVP_CipherInit
wolfSSL 15:117db924cf7c 506 #define EVP_CipherInit_ex wolfSSL_EVP_CipherInit_ex
wolfSSL 15:117db924cf7c 507 #define EVP_EncryptInit wolfSSL_EVP_EncryptInit
wolfSSL 15:117db924cf7c 508 #define EVP_EncryptInit_ex wolfSSL_EVP_EncryptInit_ex
wolfSSL 15:117db924cf7c 509 #define EVP_DecryptInit wolfSSL_EVP_DecryptInit
wolfSSL 15:117db924cf7c 510 #define EVP_DecryptInit_ex wolfSSL_EVP_DecryptInit_ex
wolfSSL 15:117db924cf7c 511
wolfSSL 15:117db924cf7c 512 #define EVP_Cipher wolfSSL_EVP_Cipher
wolfSSL 15:117db924cf7c 513 #define EVP_CipherUpdate wolfSSL_EVP_CipherUpdate
wolfSSL 15:117db924cf7c 514 #define EVP_EncryptUpdate wolfSSL_EVP_CipherUpdate
wolfSSL 15:117db924cf7c 515 #define EVP_DecryptUpdate wolfSSL_EVP_CipherUpdate
wolfSSL 15:117db924cf7c 516 #define EVP_CipherFinal wolfSSL_EVP_CipherFinal
wolfSSL 15:117db924cf7c 517 #define EVP_CipherFinal_ex wolfSSL_EVP_CipherFinal
wolfSSL 15:117db924cf7c 518 #define EVP_EncryptFinal wolfSSL_EVP_CipherFinal
wolfSSL 15:117db924cf7c 519 #define EVP_EncryptFinal_ex wolfSSL_EVP_CipherFinal
wolfSSL 15:117db924cf7c 520 #define EVP_DecryptFinal wolfSSL_EVP_CipherFinal
wolfSSL 15:117db924cf7c 521 #define EVP_DecryptFinal_ex wolfSSL_EVP_CipherFinal
wolfSSL 15:117db924cf7c 522
wolfSSL 15:117db924cf7c 523 #define EVP_CIPHER_CTX_free wolfSSL_EVP_CIPHER_CTX_free
wolfSSL 15:117db924cf7c 524 #define EVP_CIPHER_CTX_new wolfSSL_EVP_CIPHER_CTX_new
wolfSSL 15:117db924cf7c 525
wolfSSL 15:117db924cf7c 526 #define EVP_get_cipherbynid wolfSSL_EVP_get_cipherbynid
wolfSSL 15:117db924cf7c 527 #define EVP_get_digestbynid wolfSSL_EVP_get_digestbynid
wolfSSL 15:117db924cf7c 528 #define EVP_get_cipherbyname wolfSSL_EVP_get_cipherbyname
wolfSSL 15:117db924cf7c 529 #define EVP_get_digestbyname wolfSSL_EVP_get_digestbyname
wolfSSL 15:117db924cf7c 530
wolfSSL 15:117db924cf7c 531 #define EVP_PKEY_get1_RSA wolfSSL_EVP_PKEY_get1_RSA
wolfSSL 15:117db924cf7c 532 #define EVP_PKEY_get1_DSA wolfSSL_EVP_PKEY_get1_DSA
wolfSSL 15:117db924cf7c 533 #define EVP_PKEY_set1_RSA wolfSSL_EVP_PKEY_set1_RSA
wolfSSL 15:117db924cf7c 534 #define EVP_PKEY_get1_EC_KEY wolfSSL_EVP_PKEY_get1_EC_KEY
wolfSSL 15:117db924cf7c 535 #define EVP_PKEY_get0_hmac wolfSSL_EVP_PKEY_get0_hmac
wolfSSL 15:117db924cf7c 536 #define EVP_PKEY_new_mac_key wolfSSL_EVP_PKEY_new_mac_key
wolfSSL 15:117db924cf7c 537 #define EVP_MD_CTX_copy wolfSSL_EVP_MD_CTX_copy
wolfSSL 15:117db924cf7c 538 #define EVP_MD_CTX_copy_ex wolfSSL_EVP_MD_CTX_copy_ex
wolfSSL 15:117db924cf7c 539 #define EVP_PKEY_bits wolfSSL_EVP_PKEY_bits
wolfSSL 15:117db924cf7c 540 #define EVP_PKEY_CTX_free wolfSSL_EVP_PKEY_CTX_free
wolfSSL 15:117db924cf7c 541 #define EVP_PKEY_CTX_new wolfSSL_EVP_PKEY_CTX_new
wolfSSL 15:117db924cf7c 542 #define EVP_PKEY_CTX_set_rsa_padding wolfSSL_EVP_PKEY_CTX_set_rsa_padding
wolfSSL 15:117db924cf7c 543 #define EVP_PKEY_decrypt wolfSSL_EVP_PKEY_decrypt
wolfSSL 15:117db924cf7c 544 #define EVP_PKEY_decrypt_init wolfSSL_EVP_PKEY_decrypt_init
wolfSSL 15:117db924cf7c 545 #define EVP_PKEY_encrypt wolfSSL_EVP_PKEY_encrypt
wolfSSL 15:117db924cf7c 546 #define EVP_PKEY_encrypt_init wolfSSL_EVP_PKEY_encrypt_init
wolfSSL 15:117db924cf7c 547 #define EVP_PKEY_new wolfSSL_PKEY_new
wolfSSL 15:117db924cf7c 548 #define EVP_PKEY_free wolfSSL_EVP_PKEY_free
wolfSSL 15:117db924cf7c 549 #define EVP_PKEY_size wolfSSL_EVP_PKEY_size
wolfSSL 15:117db924cf7c 550 #define EVP_PKEY_type wolfSSL_EVP_PKEY_type
wolfSSL 15:117db924cf7c 551 #define EVP_PKEY_base_id wolfSSL_EVP_PKEY_base_id
wolfSSL 15:117db924cf7c 552 #define EVP_SignFinal wolfSSL_EVP_SignFinal
wolfSSL 15:117db924cf7c 553 #define EVP_SignInit wolfSSL_EVP_SignInit
wolfSSL 15:117db924cf7c 554 #define EVP_SignUpdate wolfSSL_EVP_SignUpdate
wolfSSL 15:117db924cf7c 555 #define EVP_VerifyFinal wolfSSL_EVP_VerifyFinal
wolfSSL 15:117db924cf7c 556 #define EVP_VerifyInit wolfSSL_EVP_VerifyInit
wolfSSL 15:117db924cf7c 557 #define EVP_VerifyUpdate wolfSSL_EVP_VerifyUpdate
wolfSSL 15:117db924cf7c 558
wolfSSL 15:117db924cf7c 559 #define EVP_CIPHER_CTX_block_size wolfSSL_EVP_CIPHER_CTX_block_size
wolfSSL 15:117db924cf7c 560 #define EVP_CIPHER_block_size wolfSSL_EVP_CIPHER_block_size
wolfSSL 15:117db924cf7c 561 #define EVP_CIPHER_flags wolfSSL_EVP_CIPHER_flags
wolfSSL 15:117db924cf7c 562 #define EVP_CIPHER_CTX_set_flags wolfSSL_EVP_CIPHER_CTX_set_flags
wolfSSL 15:117db924cf7c 563 #define EVP_CIPHER_CTX_set_padding wolfSSL_EVP_CIPHER_CTX_set_padding
wolfSSL 15:117db924cf7c 564 #define EVP_CIPHER_CTX_flags wolfSSL_EVP_CIPHER_CTX_flags
wolfSSL 15:117db924cf7c 565 #define EVP_add_digest wolfSSL_EVP_add_digest
wolfSSL 15:117db924cf7c 566 #define EVP_add_cipher wolfSSL_EVP_add_cipher
wolfSSL 15:117db924cf7c 567 #define EVP_cleanup wolfSSL_EVP_cleanup
wolfSSL 15:117db924cf7c 568
wolfSSL 15:117db924cf7c 569 #define OpenSSL_add_all_digests() wolfCrypt_Init()
wolfSSL 15:117db924cf7c 570 #define OpenSSL_add_all_ciphers() wolfCrypt_Init()
wolfSSL 15:117db924cf7c 571 #define OpenSSL_add_all_algorithms wolfSSL_add_all_algorithms
wolfSSL 15:117db924cf7c 572 #define OPENSSL_add_all_algorithms_noconf wolfSSL_OPENSSL_add_all_algorithms_noconf
wolfSSL 15:117db924cf7c 573
wolfSSL 15:117db924cf7c 574 #define PKCS5_PBKDF2_HMAC_SHA1 wolfSSL_PKCS5_PBKDF2_HMAC_SHA1
wolfSSL 15:117db924cf7c 575
wolfSSL 15:117db924cf7c 576 #ifndef EVP_MAX_MD_SIZE
wolfSSL 15:117db924cf7c 577 #define EVP_MAX_MD_SIZE 64 /* sha512 */
wolfSSL 15:117db924cf7c 578 #endif
wolfSSL 15:117db924cf7c 579
wolfSSL 15:117db924cf7c 580 #ifndef EVP_MAX_BLOCK_LENGTH
wolfSSL 15:117db924cf7c 581 #define EVP_MAX_BLOCK_LENGTH 32 /* 2 * blocklen(AES)? */
wolfSSL 15:117db924cf7c 582 /* They define this as 32. Using the same value here. */
wolfSSL 15:117db924cf7c 583 #endif
wolfSSL 15:117db924cf7c 584
wolfSSL 15:117db924cf7c 585 WOLFSSL_API void printPKEY(WOLFSSL_EVP_PKEY *k);
wolfSSL 15:117db924cf7c 586
wolfSSL 15:117db924cf7c 587 #ifdef __cplusplus
wolfSSL 15:117db924cf7c 588 } /* extern "C" */
wolfSSL 15:117db924cf7c 589 #endif
wolfSSL 15:117db924cf7c 590
wolfSSL 15:117db924cf7c 591
wolfSSL 15:117db924cf7c 592 #endif /* WOLFSSL_EVP_H_ */
wolfSSL 15:117db924cf7c 593