30 #ifndef WOLFSSL_EVP_H_ 31 #define WOLFSSL_EVP_H_ 33 #include <wolfssl/wolfcrypt/settings.h> 36 #include "prefix_evp.h" 40 #include <wolfssl/openssl/md4.h> 43 #include <wolfssl/openssl/md5.h> 45 #include <wolfssl/openssl/sha.h> 46 #include <wolfssl/openssl/sha3.h> 47 #include <wolfssl/openssl/ripemd.h> 48 #include <wolfssl/openssl/rsa.h> 49 #include <wolfssl/openssl/dsa.h> 50 #include <wolfssl/openssl/ec.h> 51 #include <wolfssl/openssl/dh.h> 67 typedef char WOLFSSL_EVP_CIPHER;
68 #ifndef WOLFSSL_EVP_TYPE_DEFINED 69 typedef char WOLFSSL_EVP_MD;
72 #define WOLFSSL_EVP_TYPE_DEFINED 79 WOLFSSL_API
const WOLFSSL_EVP_MD* wolfSSL_EVP_md4(
void);
82 WOLFSSL_API
const WOLFSSL_EVP_MD* wolfSSL_EVP_md5(
void);
84 WOLFSSL_API
const WOLFSSL_EVP_MD* wolfSSL_EVP_mdc2(
void);
85 WOLFSSL_API
const WOLFSSL_EVP_MD* wolfSSL_EVP_sha1(
void);
86 WOLFSSL_API
const WOLFSSL_EVP_MD* wolfSSL_EVP_sha224(
void);
87 WOLFSSL_API
const WOLFSSL_EVP_MD* wolfSSL_EVP_sha256(
void);
88 WOLFSSL_API
const WOLFSSL_EVP_MD* wolfSSL_EVP_sha384(
void);
89 WOLFSSL_API
const WOLFSSL_EVP_MD* wolfSSL_EVP_sha512(
void);
90 WOLFSSL_API
const WOLFSSL_EVP_MD* wolfSSL_EVP_ripemd160(
void);
92 WOLFSSL_API
const WOLFSSL_EVP_MD* wolfSSL_EVP_sha3_224(
void);
93 WOLFSSL_API
const WOLFSSL_EVP_MD* wolfSSL_EVP_sha3_256(
void);
94 WOLFSSL_API
const WOLFSSL_EVP_MD* wolfSSL_EVP_sha3_384(
void);
95 WOLFSSL_API
const WOLFSSL_EVP_MD* wolfSSL_EVP_sha3_512(
void);
97 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_ecb(
void);
98 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_ecb(
void);
99 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_ecb(
void);
100 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_cbc(
void);
101 #if !defined(NO_AES) && defined(HAVE_AES_CBC) 102 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_cbc(
void);
103 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_cbc(
void);
106 #ifdef WOLFSSL_AES_CFB 107 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_cfb1(
void);
108 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_cfb1(
void);
109 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_cfb1(
void);
110 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_cfb8(
void);
111 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_cfb8(
void);
112 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_cfb8(
void);
113 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_cfb128(
void);
114 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_cfb128(
void);
115 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_cfb128(
void);
117 #ifdef WOLFSSL_AES_OFB 118 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_ofb(
void);
119 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_ofb(
void);
120 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_ofb(
void);
122 #ifdef WOLFSSL_AES_XTS 123 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_xts(
void);
124 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_xts(
void);
127 #if !defined(NO_AES) && defined(HAVE_AESGCM) 128 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_gcm(
void);
129 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_gcm(
void);
130 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_gcm(
void);
132 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_ctr(
void);
133 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_ctr(
void);
134 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_ctr(
void);
135 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_des_ecb(
void);
138 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_des_ede3_cbc(
void);
139 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_rc4(
void);
140 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_idea_cbc(
void);
141 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_enc_null(
void);
142 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_rc2_cbc(
void);
153 #ifdef WOLFSSL_SHA224 157 #ifdef WOLFSSL_SHA384 160 #ifdef WOLFSSL_SHA512 163 #ifdef WOLFSSL_RIPEMD 164 WOLFSSL_RIPEMD_CTX ripemd;
166 #ifndef WOLFSSL_NOSHA3_224 167 WOLFSSL_SHA3_224_CTX sha3_224;
169 #ifndef WOLFSSL_NOSHA3_256 170 WOLFSSL_SHA3_256_CTX sha3_256;
172 WOLFSSL_SHA3_384_CTX sha3_384;
173 #ifndef WOLFSSL_NOSHA3_512 174 WOLFSSL_SHA3_512_CTX sha3_512;
196 #ifdef WOLFSSL_AES_XTS 215 AES_128_CBC_TYPE = 1,
216 AES_192_CBC_TYPE = 2,
217 AES_256_CBC_TYPE = 3,
218 AES_128_CTR_TYPE = 4,
219 AES_192_CTR_TYPE = 5,
220 AES_256_CTR_TYPE = 6,
221 AES_128_ECB_TYPE = 7,
222 AES_192_ECB_TYPE = 8,
223 AES_256_ECB_TYPE = 9,
226 DES_EDE3_CBC_TYPE = 12,
227 DES_EDE3_ECB_TYPE = 13,
229 NULL_CIPHER_TYPE = 15,
236 AES_128_GCM_TYPE = 21,
237 AES_192_GCM_TYPE = 22,
238 AES_256_GCM_TYPE = 23,
245 NID_dhKeyAgreement= 28,
246 EVP_PKEY_DH = NID_dhKeyAgreement,
247 EVP_PKEY_HMAC = NID_hmac,
248 AES_128_CFB1_TYPE = 24,
249 AES_192_CFB1_TYPE = 25,
250 AES_256_CFB1_TYPE = 26,
251 AES_128_CFB8_TYPE = 27,
252 AES_192_CFB8_TYPE = 28,
253 AES_256_CFB8_TYPE = 29,
254 AES_128_CFB128_TYPE = 30,
255 AES_192_CFB128_TYPE = 31,
256 AES_256_CFB128_TYPE = 32,
257 AES_128_OFB_TYPE = 33,
258 AES_192_OFB_TYPE = 34,
259 AES_256_OFB_TYPE = 35,
260 AES_128_XTS_TYPE = 36,
261 AES_256_XTS_TYPE = 37
265 NID_md5WithRSA = 104,
266 NID_md5WithRSAEncryption = 8,
267 NID_dsaWithSHA1 = 113,
268 NID_dsaWithSHA1_2 = 70,
269 NID_sha1WithRSA = 115,
270 NID_sha1WithRSAEncryption = 65,
271 NID_sha224WithRSAEncryption = 671,
272 NID_sha256WithRSAEncryption = 668,
273 NID_sha384WithRSAEncryption = 669,
274 NID_sha512WithRSAEncryption = 670,
275 NID_ecdsa_with_SHA1 = 416,
276 NID_ecdsa_with_SHA224 = 793,
277 NID_ecdsa_with_SHA256 = 794,
278 NID_ecdsa_with_SHA384 = 795,
279 NID_ecdsa_with_SHA512 = 796,
280 NID_dsa_with_SHA224 = 802,
281 NID_dsa_with_SHA256 = 803,
289 NID_aes_128_cbc = 419,
290 NID_aes_192_cbc = 423,
291 NID_aes_256_cbc = 427,
292 NID_aes_128_gcm = 895,
293 NID_aes_192_gcm = 898,
294 NID_aes_256_gcm = 901,
295 NID_aes_128_ctr = 904,
296 NID_aes_192_ctr = 905,
297 NID_aes_256_ctr = 906,
298 NID_aes_128_ecb = 418,
299 NID_aes_192_ecb = 422,
300 NID_aes_256_ecb = 426,
303 NID_des_ede3_cbc= 44,
304 NID_des_ede3_ecb= 33,
306 NID_aes_128_cfb1= 650,
307 NID_aes_192_cfb1= 651,
308 NID_aes_256_cfb1= 652,
309 NID_aes_128_cfb8= 653,
310 NID_aes_192_cfb8= 654,
311 NID_aes_256_cfb8= 655,
312 NID_aes_128_cfb128 = 421,
313 NID_aes_192_cfb128 = 425,
314 NID_aes_256_cfb128 = 429,
315 NID_aes_128_ofb = 420,
316 NID_aes_192_ofb = 424,
317 NID_aes_256_ofb = 428,
318 NID_aes_128_xts = 913,
319 NID_aes_256_xts = 914
322 #define NID_X9_62_id_ecPublicKey EVP_PKEY_EC 323 #define NID_dhKeyAgreement EVP_PKEY_DH 324 #define NID_rsaEncryption EVP_PKEY_RSA 325 #define NID_dsa EVP_PKEY_DSA 327 #define WOLFSSL_EVP_BUF_SIZE 16 333 unsigned char cipherType;
336 ALIGN16
unsigned char iv[AES_BLOCK_SIZE];
337 #elif !defined(NO_DES3) 339 ALIGN16
unsigned char iv[DES_BLOCK_SIZE];
340 #elif defined(HAVE_IDEA) 342 ALIGN16
unsigned char iv[IDEA_BLOCK_SIZE];
345 ALIGN16 byte buf[WOLFSSL_EVP_BUF_SIZE];
347 ALIGN16 byte lastBlock[WOLFSSL_EVP_BUF_SIZE];
349 #if !defined(NO_AES) || !defined(NO_DES3) || defined(HAVE_IDEA) || \ 350 defined(HAVE_AESGCM) || defined (WOLFSSL_AES_XTS) 351 #define HAVE_WOLFSSL_EVP_CIPHER_CTX_IV 353 ALIGN16
unsigned char authTag[AES_BLOCK_SIZE];
366 typedef int WOLFSSL_ENGINE ;
367 typedef WOLFSSL_ENGINE ENGINE;
370 #define EVP_PKEY_OP_SIGN (1 << 3) 371 #define EVP_PKEY_OP_ENCRYPT (1 << 6) 372 #define EVP_PKEY_OP_DECRYPT (1 << 7) 373 #define EVP_PKEY_OP_DERIVE (1 << 8) 375 WOLFSSL_API
void wolfSSL_EVP_init(
void);
376 WOLFSSL_API
int wolfSSL_EVP_MD_size(
const WOLFSSL_EVP_MD* md);
377 WOLFSSL_API
int wolfSSL_EVP_MD_type(
const WOLFSSL_EVP_MD *md);
378 WOLFSSL_API
int wolfSSL_EVP_MD_block_size(
const WOLFSSL_EVP_MD *md);
389 WOLFSSL_API
const WOLFSSL_EVP_MD *wolfSSL_EVP_MD_CTX_md(
const WOLFSSL_EVP_MD_CTX *ctx);
390 WOLFSSL_API
const WOLFSSL_EVP_CIPHER *wolfSSL_EVP_get_cipherbyname(
const char *name);
391 WOLFSSL_API
const WOLFSSL_EVP_MD *wolfSSL_EVP_get_digestbyname(
const char *name);
392 WOLFSSL_API
int wolfSSL_EVP_CIPHER_nid(
const WOLFSSL_EVP_CIPHER *cipher);
395 const WOLFSSL_EVP_MD* type);
397 const WOLFSSL_EVP_MD* type,
398 WOLFSSL_ENGINE *impl);
404 unsigned char* md,
unsigned int* s);
408 const WOLFSSL_EVP_MD *type,
412 const void *d,
unsigned int cnt);
414 unsigned char *sig,
size_t *siglen);
418 const WOLFSSL_EVP_MD *type,
422 const void *d,
size_t cnt);
424 const unsigned char *sig,
426 WOLFSSL_API
int wolfSSL_EVP_Digest(
const unsigned char* in,
int inSz,
unsigned char* out,
427 unsigned int* outSz,
const WOLFSSL_EVP_MD* evp,
428 WOLFSSL_ENGINE* eng);
431 WOLFSSL_API
int wolfSSL_EVP_BytesToKey(
const WOLFSSL_EVP_CIPHER*,
432 const WOLFSSL_EVP_MD*,
const unsigned char*,
433 const unsigned char*,
int,
int,
unsigned char*,
439 int type,
int arg,
void *ptr);
441 WOLFSSL_API
int wolfSSL_EVP_CIPHER_iv_length(
const WOLFSSL_EVP_CIPHER*);
442 WOLFSSL_API
int wolfSSL_EVP_Cipher_key_length(
const WOLFSSL_EVP_CIPHER* c);
446 const WOLFSSL_EVP_CIPHER* type,
447 const unsigned char* key,
448 const unsigned char* iv,
451 const WOLFSSL_EVP_CIPHER* type,
452 WOLFSSL_ENGINE *impl,
453 const unsigned char* key,
454 const unsigned char* iv,
457 const WOLFSSL_EVP_CIPHER* type,
458 const unsigned char* key,
459 const unsigned char* iv);
461 const WOLFSSL_EVP_CIPHER* type,
462 WOLFSSL_ENGINE *impl,
463 const unsigned char* key,
464 const unsigned char* iv);
466 const WOLFSSL_EVP_CIPHER* type,
467 const unsigned char* key,
468 const unsigned char* iv);
470 const WOLFSSL_EVP_CIPHER* type,
471 WOLFSSL_ENGINE *impl,
472 const unsigned char* key,
473 const unsigned char* iv);
475 unsigned char *out,
int *outl,
476 const unsigned char *in,
int inl);
478 unsigned char *out,
int *outl);
480 unsigned char *out,
int *outl,
int enc);
482 unsigned char *out,
int *outl);
484 unsigned char *out,
int *outl);
486 unsigned char *out,
int *outl);
488 unsigned char *out,
int *outl);
490 unsigned char *out,
int *outl);
503 unsigned char* dst,
unsigned char* src,
506 WOLFSSL_API
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_get_cipherbynid(
int);
507 WOLFSSL_API
const WOLFSSL_EVP_MD* wolfSSL_EVP_get_digestbynid(
int);
527 WOLFSSL_API
int wolfSSL_EVP_PKEY_assign(
WOLFSSL_EVP_PKEY *pkey,
int type,
void *key);
529 WOLFSSL_API
WOLFSSL_EVP_PKEY* wolfSSL_EVP_PKEY_new_mac_key(
int type, ENGINE* e,
530 const unsigned char* key,
int keylen);
531 WOLFSSL_API
const unsigned char* wolfSSL_EVP_PKEY_get0_hmac(
const WOLFSSL_EVP_PKEY* pkey,
535 unsigned char *sig,
size_t *siglen,
const unsigned char *tbs,
size_t tbslen);
548 WOLFSSL_API
int wolfSSL_EVP_PKEY_derive(
WOLFSSL_EVP_PKEY_CTX *ctx,
unsigned char *key,
size_t *keylen);
551 unsigned char *out,
size_t *outlen,
552 const unsigned char *in,
size_t inlen);
555 unsigned char *out,
size_t *outlen,
556 const unsigned char *in,
size_t inlen);
562 WOLFSSL_API
int wolfSSL_EVP_PKEY_missing_parameters(
WOLFSSL_EVP_PKEY *pkey);
564 WOLFSSL_API
int wolfSSL_EVP_PKEY_type(
int type);
565 WOLFSSL_API
int wolfSSL_EVP_PKEY_id(
const EVP_PKEY *pkey);
566 WOLFSSL_API
int wolfSSL_EVP_PKEY_base_id(
const EVP_PKEY *pkey);
569 WOLFSSL_API
int wolfSSL_EVP_SignInit(
WOLFSSL_EVP_MD_CTX *ctx,
const WOLFSSL_EVP_MD *type);
571 const WOLFSSL_EVP_MD* type,
572 WOLFSSL_ENGINE *impl);
573 WOLFSSL_API
int wolfSSL_EVP_SignUpdate(
WOLFSSL_EVP_MD_CTX *ctx,
const void *data,
size_t len);
576 WOLFSSL_API
int wolfSSL_EVP_VerifyInit(
WOLFSSL_EVP_MD_CTX *ctx,
const WOLFSSL_EVP_MD *type);
577 WOLFSSL_API
int wolfSSL_EVP_VerifyUpdate(
WOLFSSL_EVP_MD_CTX *ctx,
const void *data,
size_t len);
585 unsigned char* iv,
int len);
587 unsigned char* iv,
int len);
594 WOLFSSL_API
unsigned long WOLFSSL_EVP_CIPHER_mode(
const WOLFSSL_EVP_CIPHER *cipher);
595 WOLFSSL_API
unsigned long WOLFSSL_CIPHER_mode(
const WOLFSSL_EVP_CIPHER *cipher);
596 WOLFSSL_API
unsigned long wolfSSL_EVP_CIPHER_flags(
const WOLFSSL_EVP_CIPHER *cipher);
601 WOLFSSL_API
int wolfSSL_EVP_add_digest(
const WOLFSSL_EVP_MD *digest);
602 WOLFSSL_API
int wolfSSL_EVP_add_cipher(
const WOLFSSL_EVP_CIPHER *cipher);
603 WOLFSSL_API
void wolfSSL_EVP_cleanup(
void);
604 WOLFSSL_API
int wolfSSL_add_all_algorithms(
void);
605 WOLFSSL_API
int wolfSSL_OpenSSL_add_all_algorithms_conf(
void);
606 WOLFSSL_API
int wolfSSL_OpenSSL_add_all_algorithms_noconf(
void);
607 WOLFSSL_API
int wolfSSL_EVP_read_pw_string(
char*,
int,
const char*,
int);
609 WOLFSSL_API
int wolfSSL_PKCS5_PBKDF2_HMAC_SHA1(
const char * pass,
int passlen,
610 const unsigned char * salt,
611 int saltlen,
int iter,
612 int keylen,
unsigned char *out);
614 WOLFSSL_API
int wolfSSL_PKCS5_PBKDF2_HMAC(
const char *pass,
int passlen,
615 const unsigned char *salt,
616 int saltlen,
int iter,
617 const WOLFSSL_EVP_MD *digest,
618 int keylen,
unsigned char *out);
620 WOLFSSL_LOCAL
int wolfSSL_EVP_get_hashinfo(
const WOLFSSL_EVP_MD* evp,
621 int* pHash,
int* pHashSz);
623 #define EVP_CIPH_STREAM_CIPHER WOLFSSL_EVP_CIPH_STREAM_CIPHER 624 #define EVP_CIPH_ECB_MODE WOLFSSL_EVP_CIPH_ECB_MODE 625 #define EVP_CIPH_CBC_MODE WOLFSSL_EVP_CIPH_CBC_MODE 626 #define EVP_CIPH_CFB_MODE WOLFSSL_EVP_CIPH_CFB_MODE 627 #define EVP_CIPH_OFB_MODE WOLFSSL_EVP_CIPH_OFB_MODE 628 #define EVP_CIPH_CTR_MODE WOLFSSL_EVP_CIPH_CTR_MODE 629 #define EVP_CIPH_GCM_MODE WOLFSSL_EVP_CIPH_GCM_MODE 630 #define EVP_CIPH_CCM_MODE WOLFSSL_EVP_CIPH_CCM_MODE 631 #define EVP_CIPH_XTS_MODE WOLFSSL_EVP_CIPH_XTS_MODE 633 #define WOLFSSL_EVP_CIPH_MODE 0x0007 634 #define WOLFSSL_EVP_CIPH_STREAM_CIPHER 0x0 635 #define WOLFSSL_EVP_CIPH_ECB_MODE 0x1 636 #define WOLFSSL_EVP_CIPH_CBC_MODE 0x2 637 #define WOLFSSL_EVP_CIPH_CFB_MODE 0x3 638 #define WOLFSSL_EVP_CIPH_OFB_MODE 0x4 639 #define WOLFSSL_EVP_CIPH_CTR_MODE 0x5 640 #define WOLFSSL_EVP_CIPH_GCM_MODE 0x6 641 #define WOLFSSL_EVP_CIPH_CCM_MODE 0x7 642 #define WOLFSSL_EVP_CIPH_XTS_MODE 0x10 643 #define WOLFSSL_EVP_CIPH_NO_PADDING 0x100 644 #define EVP_CIPH_VARIABLE_LENGTH 0x200 645 #define WOLFSSL_EVP_CIPH_TYPE_INIT 0xff 649 typedef WOLFSSL_EVP_MD EVP_MD;
650 typedef WOLFSSL_EVP_CIPHER EVP_CIPHER;
655 #define EVP_md4 wolfSSL_EVP_md4 658 #define EVP_md5 wolfSSL_EVP_md5 660 #define EVP_sha1 wolfSSL_EVP_sha1 661 #define EVP_mdc2 wolfSSL_EVP_mdc2 662 #define EVP_dds1 wolfSSL_EVP_sha1 663 #define EVP_sha224 wolfSSL_EVP_sha224 664 #define EVP_sha256 wolfSSL_EVP_sha256 665 #define EVP_sha384 wolfSSL_EVP_sha384 666 #define EVP_sha512 wolfSSL_EVP_sha512 667 #define EVP_ripemd160 wolfSSL_EVP_ripemd160 669 #define EVP_sha3_224 wolfSSL_EVP_sha3_224 670 #define EVP_sha3_256 wolfSSL_EVP_sha3_256 671 #define EVP_sha3_384 wolfSSL_EVP_sha3_384 672 #define EVP_sha3_512 wolfSSL_EVP_sha3_512 674 #define EVP_aes_128_cbc wolfSSL_EVP_aes_128_cbc 675 #define EVP_aes_192_cbc wolfSSL_EVP_aes_192_cbc 676 #define EVP_aes_256_cbc wolfSSL_EVP_aes_256_cbc 677 #define EVP_aes_128_cfb1 wolfSSL_EVP_aes_128_cfb1 678 #define EVP_aes_192_cfb1 wolfSSL_EVP_aes_192_cfb1 679 #define EVP_aes_256_cfb1 wolfSSL_EVP_aes_256_cfb1 680 #define EVP_aes_128_cfb8 wolfSSL_EVP_aes_128_cfb8 681 #define EVP_aes_192_cfb8 wolfSSL_EVP_aes_192_cfb8 682 #define EVP_aes_256_cfb8 wolfSSL_EVP_aes_256_cfb8 683 #define EVP_aes_128_cfb128 wolfSSL_EVP_aes_128_cfb128 684 #define EVP_aes_192_cfb128 wolfSSL_EVP_aes_192_cfb128 685 #define EVP_aes_256_cfb128 wolfSSL_EVP_aes_256_cfb128 686 #define EVP_aes_128_ofb wolfSSL_EVP_aes_128_ofb 687 #define EVP_aes_192_ofb wolfSSL_EVP_aes_192_ofb 688 #define EVP_aes_256_ofb wolfSSL_EVP_aes_256_ofb 689 #define EVP_aes_128_xts wolfSSL_EVP_aes_128_xts 690 #define EVP_aes_256_xts wolfSSL_EVP_aes_256_xts 691 #define EVP_aes_128_gcm wolfSSL_EVP_aes_128_gcm 692 #define EVP_aes_192_gcm wolfSSL_EVP_aes_192_gcm 693 #define EVP_aes_256_gcm wolfSSL_EVP_aes_256_gcm 694 #define EVP_aes_128_ecb wolfSSL_EVP_aes_128_ecb 695 #define EVP_aes_192_ecb wolfSSL_EVP_aes_192_ecb 696 #define EVP_aes_256_ecb wolfSSL_EVP_aes_256_ecb 697 #define EVP_aes_128_ctr wolfSSL_EVP_aes_128_ctr 698 #define EVP_aes_192_ctr wolfSSL_EVP_aes_192_ctr 699 #define EVP_aes_256_ctr wolfSSL_EVP_aes_256_ctr 700 #define EVP_des_cbc wolfSSL_EVP_des_cbc 701 #define EVP_des_ecb wolfSSL_EVP_des_ecb 702 #define EVP_des_ede3_cbc wolfSSL_EVP_des_ede3_cbc 703 #define EVP_des_ede3_ecb wolfSSL_EVP_des_ede3_ecb 704 #define EVP_rc4 wolfSSL_EVP_rc4 705 #define EVP_idea_cbc wolfSSL_EVP_idea_cbc 706 #define EVP_enc_null wolfSSL_EVP_enc_null 708 #define EVP_MD_size wolfSSL_EVP_MD_size 709 #define EVP_MD_CTX_new wolfSSL_EVP_MD_CTX_new 710 #define EVP_MD_CTX_create wolfSSL_EVP_MD_CTX_new 711 #define EVP_MD_CTX_free wolfSSL_EVP_MD_CTX_free 712 #define EVP_MD_CTX_destroy wolfSSL_EVP_MD_CTX_free 713 #define EVP_MD_CTX_init wolfSSL_EVP_MD_CTX_init 714 #define EVP_MD_CTX_cleanup wolfSSL_EVP_MD_CTX_cleanup 715 #define EVP_MD_CTX_reset wolfSSL_EVP_MD_CTX_cleanup 716 #define EVP_MD_CTX_md wolfSSL_EVP_MD_CTX_md 717 #define EVP_MD_CTX_type wolfSSL_EVP_MD_CTX_type 718 #define EVP_MD_CTX_size wolfSSL_EVP_MD_CTX_size 719 #define EVP_MD_CTX_block_size wolfSSL_EVP_MD_CTX_block_size 720 #define EVP_MD_type wolfSSL_EVP_MD_type 722 #define EVP_Digest wolfSSL_EVP_Digest 723 #define EVP_DigestInit wolfSSL_EVP_DigestInit 724 #define EVP_DigestInit_ex wolfSSL_EVP_DigestInit_ex 725 #define EVP_DigestUpdate wolfSSL_EVP_DigestUpdate 726 #define EVP_DigestFinal wolfSSL_EVP_DigestFinal 727 #define EVP_DigestFinal_ex wolfSSL_EVP_DigestFinal_ex 728 #define EVP_DigestSignInit wolfSSL_EVP_DigestSignInit 729 #define EVP_DigestSignUpdate wolfSSL_EVP_DigestSignUpdate 730 #define EVP_DigestSignFinal wolfSSL_EVP_DigestSignFinal 731 #define EVP_DigestVerifyInit wolfSSL_EVP_DigestVerifyInit 732 #define EVP_DigestVerifyUpdate wolfSSL_EVP_DigestVerifyUpdate 733 #define EVP_DigestVerifyFinal wolfSSL_EVP_DigestVerifyFinal 734 #define EVP_BytesToKey wolfSSL_EVP_BytesToKey 736 #define EVP_get_cipherbyname wolfSSL_EVP_get_cipherbyname 737 #define EVP_get_digestbyname wolfSSL_EVP_get_digestbyname 739 #define EVP_CIPHER_CTX_init wolfSSL_EVP_CIPHER_CTX_init 740 #define EVP_CIPHER_CTX_cleanup wolfSSL_EVP_CIPHER_CTX_cleanup 741 #define EVP_CIPHER_CTX_iv_length wolfSSL_EVP_CIPHER_CTX_iv_length 742 #define EVP_CIPHER_CTX_key_length wolfSSL_EVP_CIPHER_CTX_key_length 743 #define EVP_CIPHER_CTX_set_key_length wolfSSL_EVP_CIPHER_CTX_set_key_length 744 #define EVP_CIPHER_CTX_mode wolfSSL_EVP_CIPHER_CTX_mode 745 #define EVP_CIPHER_CTX_cipher wolfSSL_EVP_CIPHER_CTX_cipher 747 #define EVP_CIPHER_iv_length wolfSSL_EVP_CIPHER_iv_length 748 #define EVP_CIPHER_key_length wolfSSL_EVP_Cipher_key_length 750 #define EVP_CipherInit wolfSSL_EVP_CipherInit 751 #define EVP_CipherInit_ex wolfSSL_EVP_CipherInit_ex 752 #define EVP_EncryptInit wolfSSL_EVP_EncryptInit 753 #define EVP_EncryptInit_ex wolfSSL_EVP_EncryptInit_ex 754 #define EVP_DecryptInit wolfSSL_EVP_DecryptInit 755 #define EVP_DecryptInit_ex wolfSSL_EVP_DecryptInit_ex 757 #define EVP_Cipher wolfSSL_EVP_Cipher 758 #define EVP_CipherUpdate wolfSSL_EVP_CipherUpdate 759 #define EVP_EncryptUpdate wolfSSL_EVP_CipherUpdate 760 #define EVP_DecryptUpdate wolfSSL_EVP_CipherUpdate 761 #define EVP_CipherFinal wolfSSL_EVP_CipherFinal 762 #define EVP_CipherFinal_ex wolfSSL_EVP_CipherFinal 763 #define EVP_EncryptFinal wolfSSL_EVP_CipherFinal 764 #define EVP_EncryptFinal_ex wolfSSL_EVP_CipherFinal 765 #define EVP_DecryptFinal wolfSSL_EVP_CipherFinal 766 #define EVP_DecryptFinal_ex wolfSSL_EVP_CipherFinal 768 #define EVP_CIPHER_CTX_free wolfSSL_EVP_CIPHER_CTX_free 769 #define EVP_CIPHER_CTX_reset wolfSSL_EVP_CIPHER_CTX_reset 770 #define EVP_CIPHER_CTX_new wolfSSL_EVP_CIPHER_CTX_new 772 #define EVP_get_cipherbynid wolfSSL_EVP_get_cipherbynid 773 #define EVP_get_digestbynid wolfSSL_EVP_get_digestbynid 774 #define EVP_get_cipherbyname wolfSSL_EVP_get_cipherbyname 775 #define EVP_get_digestbyname wolfSSL_EVP_get_digestbyname 777 #define EVP_PKEY_assign wolfSSL_EVP_PKEY_assign 778 #define EVP_PKEY_assign_RSA wolfSSL_EVP_PKEY_assign_RSA 779 #define EVP_PKEY_assign_DSA wolfSSL_EVP_PKEY_assign_DSA 780 #define EVP_PKEY_assign_DH wolfSSL_EVP_PKEY_assign_DH 781 #define EVP_PKEY_assign_EC_KEY wolfSSL_EVP_PKEY_assign_EC_KEY 782 #define EVP_PKEY_get1_DSA wolfSSL_EVP_PKEY_get1_DSA 783 #define EVP_PKEY_set1_DSA wolfSSL_EVP_PKEY_set1_DSA 784 #define EVP_PKEY_get0_RSA wolfSSL_EVP_PKEY_get0_RSA 785 #define EVP_PKEY_get1_RSA wolfSSL_EVP_PKEY_get1_RSA 786 #define EVP_PKEY_set1_RSA wolfSSL_EVP_PKEY_set1_RSA 787 #define EVP_PKEY_set1_EC_KEY wolfSSL_EVP_PKEY_set1_EC_KEY 788 #define EVP_PKEY_get1_EC_KEY wolfSSL_EVP_PKEY_get1_EC_KEY 789 #define EVP_PKEY_set1_DH wolfSSL_EVP_PKEY_set1_DH 790 #define EVP_PKEY_get0_DH wolfSSL_EVP_PKEY_get0_DH 791 #define EVP_PKEY_get1_DH wolfSSL_EVP_PKEY_get1_DH 792 #define EVP_PKEY_get0_EC_KEY wolfSSL_EVP_PKEY_get0_EC_KEY 793 #define EVP_PKEY_get0_hmac wolfSSL_EVP_PKEY_get0_hmac 794 #define EVP_PKEY_new_mac_key wolfSSL_EVP_PKEY_new_mac_key 795 #define EVP_MD_CTX_copy wolfSSL_EVP_MD_CTX_copy 796 #define EVP_MD_CTX_copy_ex wolfSSL_EVP_MD_CTX_copy_ex 797 #define EVP_PKEY_sign_init wolfSSL_EVP_PKEY_sign_init 798 #define EVP_PKEY_sign wolfSSL_EVP_PKEY_sign 799 #define EVP_PKEY_keygen wolfSSL_EVP_PKEY_keygen 800 #define EVP_PKEY_keygen_init wolfSSL_EVP_PKEY_keygen_init 801 #define EVP_PKEY_bits wolfSSL_EVP_PKEY_bits 802 #define EVP_PKEY_CTX_free wolfSSL_EVP_PKEY_CTX_free 803 #define EVP_PKEY_CTX_new wolfSSL_EVP_PKEY_CTX_new 804 #define EVP_PKEY_CTX_set_rsa_padding wolfSSL_EVP_PKEY_CTX_set_rsa_padding 805 #define EVP_PKEY_CTX_new_id wolfSSL_EVP_PKEY_CTX_new_id 806 #define EVP_PKEY_CTX_set_rsa_keygen_bits wolfSSL_EVP_PKEY_CTX_set_rsa_keygen_bits 807 #define EVP_PKEY_derive_init wolfSSL_EVP_PKEY_derive_init 808 #define EVP_PKEY_derive_set_peer wolfSSL_EVP_PKEY_derive_set_peer 809 #define EVP_PKEY_derive wolfSSL_EVP_PKEY_derive 810 #define EVP_PKEY_decrypt wolfSSL_EVP_PKEY_decrypt 811 #define EVP_PKEY_decrypt_init wolfSSL_EVP_PKEY_decrypt_init 812 #define EVP_PKEY_encrypt wolfSSL_EVP_PKEY_encrypt 813 #define EVP_PKEY_encrypt_init wolfSSL_EVP_PKEY_encrypt_init 814 #define EVP_PKEY_new wolfSSL_EVP_PKEY_new 815 #define EVP_PKEY_free wolfSSL_EVP_PKEY_free 816 #define EVP_PKEY_up_ref wolfSSL_EVP_PKEY_up_ref 817 #define EVP_PKEY_size wolfSSL_EVP_PKEY_size 818 #define EVP_PKEY_missing_parameters wolfSSL_EVP_PKEY_missing_parameters 819 #define EVP_PKEY_cmp wolfSSL_EVP_PKEY_cmp 820 #define EVP_PKEY_type wolfSSL_EVP_PKEY_type 821 #define EVP_PKEY_base_id wolfSSL_EVP_PKEY_base_id 822 #define EVP_PKEY_id wolfSSL_EVP_PKEY_id 823 #define EVP_SignFinal wolfSSL_EVP_SignFinal 824 #define EVP_SignInit wolfSSL_EVP_SignInit 825 #define EVP_SignInit_ex wolfSSL_EVP_SignInit_ex 826 #define EVP_SignUpdate wolfSSL_EVP_SignUpdate 827 #define EVP_VerifyFinal wolfSSL_EVP_VerifyFinal 828 #define EVP_VerifyInit wolfSSL_EVP_VerifyInit 829 #define EVP_VerifyUpdate wolfSSL_EVP_VerifyUpdate 831 #define EVP_CIPHER_CTX_ctrl wolfSSL_EVP_CIPHER_CTX_ctrl 832 #define EVP_CIPHER_CTX_block_size wolfSSL_EVP_CIPHER_CTX_block_size 833 #define EVP_CIPHER_block_size wolfSSL_EVP_CIPHER_block_size 834 #define EVP_CIPHER_flags wolfSSL_EVP_CIPHER_flags 835 #define EVP_CIPHER_CTX_set_flags wolfSSL_EVP_CIPHER_CTX_set_flags 836 #define EVP_CIPHER_CTX_clear_flags wolfSSL_EVP_CIPHER_CTX_clear_flags 837 #define EVP_CIPHER_CTX_set_padding wolfSSL_EVP_CIPHER_CTX_set_padding 838 #define EVP_CIPHER_CTX_flags wolfSSL_EVP_CIPHER_CTX_flags 839 #define EVP_CIPHER_CTX_set_iv wolfSSL_EVP_CIPHER_CTX_set_iv 840 #define EVP_add_digest wolfSSL_EVP_add_digest 841 #define EVP_add_cipher wolfSSL_EVP_add_cipher 842 #define EVP_cleanup wolfSSL_EVP_cleanup 843 #define EVP_read_pw_string wolfSSL_EVP_read_pw_string 844 #define EVP_rc2_cbc wolfSSL_EVP_rc2_cbc 846 #define OpenSSL_add_all_digests() wolfSSL_EVP_init() 847 #define OpenSSL_add_all_ciphers() wolfSSL_EVP_init() 848 #define OpenSSL_add_all_algorithms wolfSSL_add_all_algorithms 849 #define OpenSSL_add_all_algorithms_noconf wolfSSL_OpenSSL_add_all_algorithms_noconf 850 #define OpenSSL_add_all_algorithms_conf wolfSSL_OpenSSL_add_all_algorithms_conf 852 #define wolfSSL_OPENSSL_add_all_algorithms_noconf wolfSSL_OpenSSL_add_all_algorithms_noconf 853 #define wolfSSL_OPENSSL_add_all_algorithms_conf wolfSSL_OpenSSL_add_all_algorithms_conf 856 #define OPENSSL_add_all_algorithms OpenSSL_add_all_algorithms 857 #define OPENSSL_add_all_algorithms_noconf OpenSSL_add_all_algorithms_noconf 858 #define OPENSSL_add_all_algorithms_conf OpenSSL_add_all_algorithms_conf 860 #define NO_PADDING_BLOCK_SIZE 1 862 #define PKCS5_PBKDF2_HMAC_SHA1 wolfSSL_PKCS5_PBKDF2_HMAC_SHA1 863 #define PKCS5_PBKDF2_HMAC wolfSSL_PKCS5_PBKDF2_HMAC 866 #define EVP_CTRL_INIT 0x0 867 #define EVP_CTRL_SET_KEY_LENGTH 0x1 868 #define EVP_CTRL_SET_RC2_KEY_BITS 0x3 870 #define EVP_CTRL_AEAD_SET_IVLEN 0x9 871 #define EVP_CTRL_AEAD_GET_TAG 0x10 872 #define EVP_CTRL_AEAD_SET_TAG 0x11 873 #define EVP_CTRL_AEAD_SET_IV_FIXED 0x12 874 #define EVP_CTRL_GCM_IV_GEN 0x13 875 #define EVP_CTRL_GCM_SET_IVLEN EVP_CTRL_AEAD_SET_IVLEN 876 #define EVP_CTRL_GCM_GET_TAG EVP_CTRL_AEAD_GET_TAG 877 #define EVP_CTRL_GCM_SET_TAG EVP_CTRL_AEAD_SET_TAG 878 #define EVP_CTRL_GCM_SET_IV_FIXED EVP_CTRL_AEAD_SET_IV_FIXED 880 #define EVP_PKEY_print_private(arg1, arg2, arg3, arg4) 882 #ifndef EVP_MAX_MD_SIZE 883 #define EVP_MAX_MD_SIZE 64 886 #ifndef EVP_MAX_KEY_LENGTH 887 #define EVP_MAX_KEY_LENGTH 64 890 #ifndef EVP_MAX_IV_LENGTH 891 #define EVP_MAX_IV_LENGTH 16 894 #ifndef EVP_MAX_BLOCK_LENGTH 895 #define EVP_MAX_BLOCK_LENGTH 32 899 #ifndef EVP_MAX_IV_LENGTH 900 #define EVP_MAX_IV_LENGTH 16 904 #define EVP_R_BAD_DECRYPT (-MIN_CODE_E + 100 + 1) 905 #define EVP_R_BN_DECODE_ERROR (-MIN_CODE_E + 100 + 2) 906 #define EVP_R_DECODE_ERROR (-MIN_CODE_E + 100 + 3) 907 #define EVP_R_PRIVATE_KEY_DECODE_ERROR (-MIN_CODE_E + 100 + 4) 909 #define EVP_PKEY_NONE NID_undef 910 #define EVP_PKEY_RSA 6 911 #define EVP_PKEY_RSA2 19 912 #define EVP_PKEY_DH 28 913 #define EVP_CIPHER_mode WOLFSSL_CIPHER_mode 915 #define EVP_CIPHER_name(x) x 916 #define EVP_MD_CTX_reset wolfSSL_EVP_MD_CTX_cleanup 918 #define EVP_MD_name(x) x 919 #define EVP_CIPHER_nid wolfSSL_EVP_CIPHER_nid 928 #include <wolfssl/openssl/objects.h>
WOLFSSL_API const WOLFSSL_EVP_CIPHER * wolfSSL_EVP_des_cbc(void)
Getter functions for the respective WOLFSSL_EVP_CIPHER pointers. wolfSSL_EVP_init() must be called on...
Definition: evp.c:3738
WOLFSSL_API const WOLFSSL_EVP_CIPHER * wolfSSL_EVP_des_ede3_ecb(void)
Getter functions for the respective WOLFSSL_EVP_CIPHER pointers. wolfSSL_EVP_init() must be called on...
Definition: evp.c:3762
WOLFSSL_API int wolfSSL_EVP_DigestInit_ex(WOLFSSL_EVP_MD_CTX *ctx, const WOLFSSL_EVP_MD *type, WOLFSSL_ENGINE *impl)
Function for initializing WOLFSSL_EVP_MD_CTX. This function is a wrapper for wolfSSL_EVP_DigestInit()...
Definition: evp.c:370
WOLFSSL_API int wolfSSL_EVP_CIPHER_block_size(const WOLFSSL_EVP_CIPHER *cipher)
This is a getter function for the block size of cipher.
Definition: evp.c:1053
WOLFSSL_API int wolfSSL_EVP_CipherUpdate(WOLFSSL_EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, const unsigned char *in, int inl)
Function for encrypting/decrypting data. In buffer is added to be encrypted or decrypted and out buff...
Definition: evp.c:587
WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_block_size(const WOLFSSL_EVP_CIPHER_CTX *ctx)
This is a getter function for the ctx block size.
Definition: evp.c:870
WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_set_key_length(WOLFSSL_EVP_CIPHER_CTX *ctx, int keylen)
Setter function for WOLFSSL_EVP_CIPHER_CTX structure key length.
Definition: evp.c:4972
WOLFSSL_API void wolfSSL_EVP_CIPHER_CTX_set_flags(WOLFSSL_EVP_CIPHER_CTX *ctx, int flags)
Setter function for WOLFSSL_EVP_CIPHER_CTX structure.
Definition: evp.c:1144
WOLFSSL_API int wolfSSL_EVP_DecryptInit_ex(WOLFSSL_EVP_CIPHER_CTX *ctx, const WOLFSSL_EVP_CIPHER *type, WOLFSSL_ENGINE *impl, const unsigned char *key, const unsigned char *iv)
Function for initializing WOLFSSL_EVP_CIPHER_CTX. This function is a wrapper for wolfSSL_EVP_CipherIn...
Definition: evp.c:260
WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_set_padding(WOLFSSL_EVP_CIPHER_CTX *c, int pad)
Setter function for WOLFSSL_EVP_CIPHER_CTX structure to use padding.
Definition: evp.c:1164
WOLFSSL_API int wolfSSL_EVP_EncryptInit_ex(WOLFSSL_EVP_CIPHER_CTX *ctx, const WOLFSSL_EVP_CIPHER *type, WOLFSSL_ENGINE *impl, const unsigned char *key, const unsigned char *iv)
Function for initializing WOLFSSL_EVP_CIPHER_CTX. This function is a wrapper for wolfSSL_EVP_CipherIn...
Definition: evp.c:241
WOLFSSL_API void wolfSSL_EVP_CIPHER_CTX_clear_flags(WOLFSSL_EVP_CIPHER_CTX *ctx, int flags)
Clearing function for WOLFSSL_EVP_CIPHER_CTX structure.
Definition: evp.c:1151
WOLFSSL_API int wolfSSL_EVP_CipherFinal(WOLFSSL_EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
This function performs the final cipher operations adding in padding. If WOLFSSL_EVP_CIPH_NO_PADDING ...
Definition: evp.c:733
WOLFSSL_API int wolfSSL_EVP_CipherInit_ex(WOLFSSL_EVP_CIPHER_CTX *ctx, const WOLFSSL_EVP_CIPHER *type, WOLFSSL_ENGINE *impl, const unsigned char *key, const unsigned char *iv, int enc)
Function for initializing WOLFSSL_EVP_CIPHER_CTX. This function is a wrapper for wolfSSL_CipherInit()...
Definition: evp.c:323