wolfssl/openssl/ headers updated

This commit is contained in:
kaleb-himes 2014-12-30 11:52:21 -07:00
parent 8594ccf2df
commit 7da867135f
17 changed files with 422 additions and 422 deletions

View File

@ -65,7 +65,6 @@ include cyassl/include.am
else
include wolfssl/include.am
endif
#-------------------------------------#
include certs/include.am
include certs/1024/include.am

View File

@ -121,6 +121,7 @@
#define CyaSSL_CertManagerDisableOCSP wolfSSL_CertManagerDisableOCSP
#define CyaSSL_get_current_cipher_suite wolfSSL_get_current_cipher_suite
#define CyaSSL_CTX_load_verify_locations wolfSSL_CTX_load_verify_locations
#define CyaSSL_CTX_set_default_passwd_cb wolfSSL_CTX_set_default_passwd_cb
#define CyaSSL_use_old_poly wolfSSL_use_old_poly

View File

@ -1,8 +1,8 @@
/* bio.h for openssl */
#ifndef CYASSL_BIO_H_
#define CYASSL_BIO_H_
#ifndef WOLFSSL_BIO_H_
#define WOLFSSL_BIO_H_
#include <cyassl/openssl/ssl.h>
@ -19,5 +19,5 @@
#endif
#endif /* CYASSL_BIO_H_ */
#endif /* WOLFSSL_BIO_H_ */

View File

@ -1,109 +1,109 @@
/* bn.h for openssl */
#ifndef CYASSL_BN_H_
#define CYASSL_BN_H_
#ifndef WOLFSSL_BN_H_
#define WOLFSSL_BN_H_
#include <cyassl/ctaocrypt/settings.h>
#include <wolfssl/ctaocrypt/settings.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct CYASSL_BIGNUM {
typedef struct WOLFSSL_BIGNUM {
int neg; /* openssh deference */
void* internal; /* our big num */
} CYASSL_BIGNUM;
} WOLFSSL_BIGNUM;
typedef struct CYASSL_BN_CTX CYASSL_BN_CTX;
typedef struct WOLFSSL_BN_CTX WOLFSSL_BN_CTX;
CYASSL_API CYASSL_BN_CTX* CyaSSL_BN_CTX_new(void);
CYASSL_API void CyaSSL_BN_CTX_init(CYASSL_BN_CTX*);
CYASSL_API void CyaSSL_BN_CTX_free(CYASSL_BN_CTX*);
WOLFSSL_API WOLFSSL_BN_CTX* wolfSSL_BN_CTX_new(void);
WOLFSSL_API void wolfSSL_BN_CTX_init(WOLFSSL_BN_CTX*);
WOLFSSL_API void wolfSSL_BN_CTX_free(WOLFSSL_BN_CTX*);
CYASSL_API CYASSL_BIGNUM* CyaSSL_BN_new(void);
CYASSL_API void CyaSSL_BN_free(CYASSL_BIGNUM*);
CYASSL_API void CyaSSL_BN_clear_free(CYASSL_BIGNUM*);
WOLFSSL_API WOLFSSL_BIGNUM* wolfSSL_BN_new(void);
WOLFSSL_API void wolfSSL_BN_free(WOLFSSL_BIGNUM*);
WOLFSSL_API void wolfSSL_BN_clear_free(WOLFSSL_BIGNUM*);
CYASSL_API int CyaSSL_BN_sub(CYASSL_BIGNUM*, const CYASSL_BIGNUM*,
const CYASSL_BIGNUM*);
CYASSL_API int CyaSSL_BN_mod(CYASSL_BIGNUM*, const CYASSL_BIGNUM*,
const CYASSL_BIGNUM*, const CYASSL_BN_CTX*);
WOLFSSL_API int wolfSSL_BN_sub(WOLFSSL_BIGNUM*, const WOLFSSL_BIGNUM*,
const WOLFSSL_BIGNUM*);
WOLFSSL_API int wolfSSL_BN_mod(WOLFSSL_BIGNUM*, const WOLFSSL_BIGNUM*,
const WOLFSSL_BIGNUM*, const WOLFSSL_BN_CTX*);
CYASSL_API const CYASSL_BIGNUM* CyaSSL_BN_value_one(void);
WOLFSSL_API const WOLFSSL_BIGNUM* wolfSSL_BN_value_one(void);
CYASSL_API int CyaSSL_BN_num_bytes(const CYASSL_BIGNUM*);
CYASSL_API int CyaSSL_BN_num_bits(const CYASSL_BIGNUM*);
WOLFSSL_API int wolfSSL_BN_num_bytes(const WOLFSSL_BIGNUM*);
WOLFSSL_API int wolfSSL_BN_num_bits(const WOLFSSL_BIGNUM*);
CYASSL_API int CyaSSL_BN_is_zero(const CYASSL_BIGNUM*);
CYASSL_API int CyaSSL_BN_is_one(const CYASSL_BIGNUM*);
CYASSL_API int CyaSSL_BN_is_odd(const CYASSL_BIGNUM*);
WOLFSSL_API int wolfSSL_BN_is_zero(const WOLFSSL_BIGNUM*);
WOLFSSL_API int wolfSSL_BN_is_one(const WOLFSSL_BIGNUM*);
WOLFSSL_API int wolfSSL_BN_is_odd(const WOLFSSL_BIGNUM*);
CYASSL_API int CyaSSL_BN_cmp(const CYASSL_BIGNUM*, const CYASSL_BIGNUM*);
WOLFSSL_API int wolfSSL_BN_cmp(const WOLFSSL_BIGNUM*, const WOLFSSL_BIGNUM*);
CYASSL_API int CyaSSL_BN_bn2bin(const CYASSL_BIGNUM*, unsigned char*);
CYASSL_API CYASSL_BIGNUM* CyaSSL_BN_bin2bn(const unsigned char*, int len,
CYASSL_BIGNUM* ret);
WOLFSSL_API int wolfSSL_BN_bn2bin(const WOLFSSL_BIGNUM*, unsigned char*);
WOLFSSL_API WOLFSSL_BIGNUM* wolfSSL_BN_bin2bn(const unsigned char*, int len,
WOLFSSL_BIGNUM* ret);
CYASSL_API int CyaSSL_mask_bits(CYASSL_BIGNUM*, int n);
WOLFSSL_API int wolfSSL_mask_bits(WOLFSSL_BIGNUM*, int n);
CYASSL_API int CyaSSL_BN_rand(CYASSL_BIGNUM*, int bits, int top, int bottom);
CYASSL_API int CyaSSL_BN_is_bit_set(const CYASSL_BIGNUM*, int n);
CYASSL_API int CyaSSL_BN_hex2bn(CYASSL_BIGNUM**, const char* str);
WOLFSSL_API int wolfSSL_BN_rand(WOLFSSL_BIGNUM*, int bits, int top, int bottom);
WOLFSSL_API int wolfSSL_BN_is_bit_set(const WOLFSSL_BIGNUM*, int n);
WOLFSSL_API int wolfSSL_BN_hex2bn(WOLFSSL_BIGNUM**, const char* str);
CYASSL_API CYASSL_BIGNUM* CyaSSL_BN_dup(const CYASSL_BIGNUM*);
CYASSL_API CYASSL_BIGNUM* CyaSSL_BN_copy(CYASSL_BIGNUM*, const CYASSL_BIGNUM*);
WOLFSSL_API WOLFSSL_BIGNUM* wolfSSL_BN_dup(const WOLFSSL_BIGNUM*);
WOLFSSL_API WOLFSSL_BIGNUM* wolfSSL_BN_copy(WOLFSSL_BIGNUM*, const WOLFSSL_BIGNUM*);
CYASSL_API int CyaSSL_BN_set_word(CYASSL_BIGNUM*, unsigned long w);
WOLFSSL_API int wolfSSL_BN_set_word(WOLFSSL_BIGNUM*, unsigned long w);
CYASSL_API int CyaSSL_BN_dec2bn(CYASSL_BIGNUM**, const char* str);
CYASSL_API char* CyaSSL_BN_bn2dec(const CYASSL_BIGNUM*);
WOLFSSL_API int wolfSSL_BN_dec2bn(WOLFSSL_BIGNUM**, const char* str);
WOLFSSL_API char* wolfSSL_BN_bn2dec(const WOLFSSL_BIGNUM*);
typedef CYASSL_BIGNUM BIGNUM;
typedef CYASSL_BN_CTX BN_CTX;
typedef WOLFSSL_BIGNUM BIGNUM;
typedef WOLFSSL_BN_CTX BN_CTX;
#define BN_CTX_new CyaSSL_BN_CTX_new
#define BN_CTX_init CyaSSL_BN_CTX_init
#define BN_CTX_free CyaSSL_BN_CTX_free
#define BN_CTX_new wolfSSL_BN_CTX_new
#define BN_CTX_init wolfSSL_BN_CTX_init
#define BN_CTX_free wolfSSL_BN_CTX_free
#define BN_new CyaSSL_BN_new
#define BN_free CyaSSL_BN_free
#define BN_clear_free CyaSSL_BN_clear_free
#define BN_new wolfSSL_BN_new
#define BN_free wolfSSL_BN_free
#define BN_clear_free wolfSSL_BN_clear_free
#define BN_num_bytes CyaSSL_BN_num_bytes
#define BN_num_bits CyaSSL_BN_num_bits
#define BN_num_bytes wolfSSL_BN_num_bytes
#define BN_num_bits wolfSSL_BN_num_bits
#define BN_is_zero CyaSSL_BN_is_zero
#define BN_is_one CyaSSL_BN_is_one
#define BN_is_odd CyaSSL_BN_is_odd
#define BN_is_zero wolfSSL_BN_is_zero
#define BN_is_one wolfSSL_BN_is_one
#define BN_is_odd wolfSSL_BN_is_odd
#define BN_cmp CyaSSL_BN_cmp
#define BN_cmp wolfSSL_BN_cmp
#define BN_bn2bin CyaSSL_BN_bn2bin
#define BN_bin2bn CyaSSL_BN_bin2bn
#define BN_bn2bin wolfSSL_BN_bn2bin
#define BN_bin2bn wolfSSL_BN_bin2bn
#define BN_mod CyaSSL_BN_mod
#define BN_sub CyaSSL_BN_sub
#define BN_value_one CyaSSL_BN_value_one
#define BN_mod wolfSSL_BN_mod
#define BN_sub wolfSSL_BN_sub
#define BN_value_one wolfSSL_BN_value_one
#define BN_mask_bits CyaSSL_mask_bits
#define BN_mask_bits wolfSSL_mask_bits
#define BN_rand CyaSSL_BN_rand
#define BN_is_bit_set CyaSSL_BN_is_bit_set
#define BN_hex2bn CyaSSL_BN_hex2bn
#define BN_rand wolfSSL_BN_rand
#define BN_is_bit_set wolfSSL_BN_is_bit_set
#define BN_hex2bn wolfSSL_BN_hex2bn
#define BN_dup CyaSSL_BN_dup
#define BN_copy CyaSSL_BN_copy
#define BN_dup wolfSSL_BN_dup
#define BN_copy wolfSSL_BN_copy
#define BN_set_word CyaSSL_BN_set_word
#define BN_set_word wolfSSL_BN_set_word
#define BN_dec2bn CyaSSL_BN_dec2bn
#define BN_bn2dec CyaSSL_BN_bn2dec
#define BN_dec2bn wolfSSL_BN_dec2bn
#define BN_bn2dec wolfSSL_BN_bn2dec
#ifdef __cplusplus
@ -111,5 +111,5 @@ typedef CYASSL_BN_CTX BN_CTX;
#endif
#endif /* CYASSL__H_ */
#endif /* WOLFSSL__H_ */

View File

@ -1,21 +1,21 @@
/* crypto.h for openSSL */
#ifndef CYASSL_CRYPTO_H_
#define CYASSL_CRYPTO_H_
#ifndef WOLFSSL_CRYPTO_H_
#define WOLFSSL_CRYPTO_H_
#include <cyassl/ctaocrypt/settings.h>
#include <wolfssl/wolfcrypt/settings.h>
#ifdef YASSL_PREFIX
#ifdef WOLFSSL_PREFIX
#include "prefix_crypto.h"
#endif
CYASSL_API const char* CyaSSLeay_version(int type);
CYASSL_API unsigned long CyaSSLeay(void);
WOLFSSL_API const char* wolfSSLeay_version(int type);
WOLFSSL_API unsigned long wolfSSLeay(void);
#define SSLeay_version CyaSSLeay_version
#define SSLeay CyaSSLeay
#define SSLeay_version wolfSSLeay_version
#define SSLeay wolfSSLeay
#define SSLEAY_VERSION 0x0090600fL

View File

@ -2,14 +2,14 @@
*
* Copyright (C) 2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
* This file is part of wolfSSL. (formerly known as wolfSSL)
*
* CyaSSL is free software; you can redistribute it and/or modify
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* CyaSSL is distributed in the hope that it will be useful,
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@ -25,12 +25,12 @@
*/
#ifndef CYASSL_DES_H_
#define CYASSL_DES_H_
#ifndef WOLFSSL_DES_H_
#define WOLFSSL_DES_H_
#include <cyassl/ctaocrypt/settings.h>
#include <wolfssl/wolfcrypt/settings.h>
#ifdef YASSL_PREFIX
#ifdef WOLFSSL_PREFIX
#include "prefix_des.h"
#endif
@ -39,9 +39,9 @@
extern "C" {
#endif
typedef unsigned char CYASSL_DES_cblock[8];
typedef /* const */ CYASSL_DES_cblock CYASSL_const_DES_cblock;
typedef CYASSL_DES_cblock CYASSL_DES_key_schedule;
typedef unsigned char WOLFSSL_DES_cblock[8];
typedef /* const */ WOLFSSL_DES_cblock WOLFSSL_const_DES_cblock;
typedef WOLFSSL_DES_cblock WOLFSSL_DES_key_schedule;
enum {
@ -50,38 +50,38 @@ enum {
};
CYASSL_API void CyaSSL_DES_set_key_unchecked(CYASSL_const_DES_cblock*,
CYASSL_DES_key_schedule*);
CYASSL_API int CyaSSL_DES_key_sched(CYASSL_const_DES_cblock* key,
CYASSL_DES_key_schedule* schedule);
CYASSL_API void CyaSSL_DES_cbc_encrypt(const unsigned char* input,
WOLFSSL_API void wolfSSL_DES_set_key_unchecked(WOLFSSL_const_DES_cblock*,
WOLFSSL_DES_key_schedule*);
WOLFSSL_API int wolfSSL_DES_key_sched(WOLFSSL_const_DES_cblock* key,
WOLFSSL_DES_key_schedule* schedule);
WOLFSSL_API void wolfSSL_DES_cbc_encrypt(const unsigned char* input,
unsigned char* output, long length,
CYASSL_DES_key_schedule* schedule, CYASSL_DES_cblock* ivec,
WOLFSSL_DES_key_schedule* schedule, WOLFSSL_DES_cblock* ivec,
int enc);
CYASSL_API void CyaSSL_DES_ncbc_encrypt(const unsigned char* input,
WOLFSSL_API void wolfSSL_DES_ncbc_encrypt(const unsigned char* input,
unsigned char* output, long length,
CYASSL_DES_key_schedule* schedule,
CYASSL_DES_cblock* ivec, int enc);
WOLFSSL_DES_key_schedule* schedule,
WOLFSSL_DES_cblock* ivec, int enc);
CYASSL_API void CyaSSL_DES_set_odd_parity(CYASSL_DES_cblock*);
CYASSL_API void CyaSSL_DES_ecb_encrypt(CYASSL_DES_cblock*, CYASSL_DES_cblock*,
CYASSL_DES_key_schedule*, int);
WOLFSSL_API void wolfSSL_DES_set_odd_parity(WOLFSSL_DES_cblock*);
WOLFSSL_API void wolfSSL_DES_ecb_encrypt(WOLFSSL_DES_cblock*, WOLFSSL_DES_cblock*,
WOLFSSL_DES_key_schedule*, int);
typedef CYASSL_DES_cblock DES_cblock;
typedef CYASSL_const_DES_cblock const_DES_cblock;
typedef CYASSL_DES_key_schedule DES_key_schedule;
typedef WOLFSSL_DES_cblock DES_cblock;
typedef WOLFSSL_const_DES_cblock const_DES_cblock;
typedef WOLFSSL_DES_key_schedule DES_key_schedule;
#define DES_set_key_unchecked CyaSSL_DES_set_key_unchecked
#define DES_key_sched CyaSSL_DES_key_sched
#define DES_cbc_encrypt CyaSSL_DES_cbc_encrypt
#define DES_ncbc_encrypt CyaSSL_DES_ncbc_encrypt
#define DES_set_odd_parity CyaSSL_DES_set_odd_parity
#define DES_ecb_encrypt CyaSSL_DES_ecb_encrypt
#define DES_set_key_unchecked wolfSSL_DES_set_key_unchecked
#define DES_key_sched wolfSSL_DES_key_sched
#define DES_cbc_encrypt wolfSSL_DES_cbc_encrypt
#define DES_ncbc_encrypt wolfSSL_DES_ncbc_encrypt
#define DES_set_odd_parity wolfSSL_DES_set_odd_parity
#define DES_ecb_encrypt wolfSSL_DES_ecb_encrypt
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* CYASSL_DES_H_ */
#endif /* WOLFSSL_DES_H_ */

View File

@ -1,12 +1,12 @@
/* dh.h for openSSL */
#ifndef CYASSL_DH_H_
#define CYASSL_DH_H_
#ifndef WOLFSSL_DH_H_
#define WOLFSSL_DH_H_
#include <cyassl/openssl/ssl.h>
#include <cyassl/openssl/bn.h>
#include <wolfssl/openssl/ssl.h>
#include <wolfssl/openssl/bn.h>
#ifdef __cplusplus
@ -16,33 +16,33 @@
typedef struct CYASSL_DH {
CYASSL_BIGNUM* p;
CYASSL_BIGNUM* g;
CYASSL_BIGNUM* pub_key; /* openssh deference g^x */
CYASSL_BIGNUM* priv_key; /* openssh deference x */
typedef struct WOLFSSL_DH {
WOLFSSL_BIGNUM* p;
WOLFSSL_BIGNUM* g;
WOLFSSL_BIGNUM* pub_key; /* openssh deference g^x */
WOLFSSL_BIGNUM* priv_key; /* openssh deference x */
void* internal; /* our DH */
char inSet; /* internal set from external ? */
char exSet; /* external set from internal ? */
} CYASSL_DH;
} WOLFSSL_DH;
CYASSL_API CYASSL_DH* CyaSSL_DH_new(void);
CYASSL_API void CyaSSL_DH_free(CYASSL_DH*);
WOLFSSL_API WOLFSSL_DH* wolfSSL_DH_new(void);
WOLFSSL_API void wolfSSL_DH_free(WOLFSSL_DH*);
CYASSL_API int CyaSSL_DH_size(CYASSL_DH*);
CYASSL_API int CyaSSL_DH_generate_key(CYASSL_DH*);
CYASSL_API int CyaSSL_DH_compute_key(unsigned char* key, CYASSL_BIGNUM* pub,
CYASSL_DH*);
WOLFSSL_API int wolfSSL_DH_size(WOLFSSL_DH*);
WOLFSSL_API int wolfSSL_DH_generate_key(WOLFSSL_DH*);
WOLFSSL_API int wolfSSL_DH_compute_key(unsigned char* key, WOLFSSL_BIGNUM* pub,
WOLFSSL_DH*);
typedef CYASSL_DH DH;
typedef WOLFSSL_DH DH;
#define DH_new CyaSSL_DH_new
#define DH_free CyaSSL_DH_free
#define DH_new wolfSSL_DH_new
#define DH_free wolfSSL_DH_free
#define DH_size CyaSSL_DH_size
#define DH_generate_key CyaSSL_DH_generate_key
#define DH_compute_key CyaSSL_DH_compute_key
#define DH_size wolfSSL_DH_size
#define DH_generate_key wolfSSL_DH_generate_key
#define DH_compute_key wolfSSL_DH_compute_key
#ifdef __cplusplus

View File

@ -1,12 +1,12 @@
/* dsa.h for openSSL */
#ifndef CYASSL_DSA_H_
#define CYASSL_DSA_H_
#ifndef WOLFSSL_DSA_H_
#define WOLFSSL_DSA_H_
#include <cyassl/openssl/ssl.h>
#include <cyassl/openssl/bn.h>
#include <wolfssl/openssl/ssl.h>
#include <wolfssl/openssl/bn.h>
#ifdef __cplusplus
@ -15,35 +15,35 @@
struct CYASSL_DSA {
CYASSL_BIGNUM* p;
CYASSL_BIGNUM* q;
CYASSL_BIGNUM* g;
CYASSL_BIGNUM* pub_key; /* our y */
CYASSL_BIGNUM* priv_key; /* our x */
struct WOLFSSL_DSA {
WOLFSSL_BIGNUM* p;
WOLFSSL_BIGNUM* q;
WOLFSSL_BIGNUM* g;
WOLFSSL_BIGNUM* pub_key; /* our y */
WOLFSSL_BIGNUM* priv_key; /* our x */
void* internal; /* our Dsa Key */
char inSet; /* internal set from external ? */
char exSet; /* external set from internal ? */
};
CYASSL_API CYASSL_DSA* CyaSSL_DSA_new(void);
CYASSL_API void CyaSSL_DSA_free(CYASSL_DSA*);
WOLFSSL_API WOLFSSL_DSA* wolfSSL_DSA_new(void);
WOLFSSL_API void wolfSSL_DSA_free(WOLFSSL_DSA*);
CYASSL_API int CyaSSL_DSA_generate_key(CYASSL_DSA*);
CYASSL_API int CyaSSL_DSA_generate_parameters_ex(CYASSL_DSA*, int bits,
WOLFSSL_API int wolfSSL_DSA_generate_key(WOLFSSL_DSA*);
WOLFSSL_API int wolfSSL_DSA_generate_parameters_ex(WOLFSSL_DSA*, int bits,
unsigned char* seed, int seedLen, int* counterRet,
unsigned long* hRet, void* cb);
CYASSL_API int CyaSSL_DSA_LoadDer(CYASSL_DSA*, const unsigned char*, int sz);
CYASSL_API int CyaSSL_DSA_do_sign(const unsigned char* d, unsigned char* sigRet,
CYASSL_DSA* dsa);
WOLFSSL_API int wolfSSL_DSA_LoadDer(WOLFSSL_DSA*, const unsigned char*, int sz);
WOLFSSL_API int wolfSSL_DSA_do_sign(const unsigned char* d, unsigned char* sigRet,
WOLFSSL_DSA* dsa);
#define DSA_new CyaSSL_DSA_new
#define DSA_free CyaSSL_DSA_free
#define DSA_new wolfSSL_DSA_new
#define DSA_free wolfSSL_DSA_free
#define DSA_generate_key CyaSSL_DSA_generate_key
#define DSA_generate_parameters_ex CyaSSL_DSA_generate_parameters_ex
#define DSA_generate_key wolfSSL_DSA_generate_key
#define DSA_generate_parameters_ex wolfSSL_DSA_generate_parameters_ex
#ifdef __cplusplus

View File

@ -2,14 +2,14 @@
*
* Copyright (C) 2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
* This file is part of wolfSSL. (formerly known as CyaSSL)
*
* CyaSSL is free software; you can redistribute it and/or modify
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* CyaSSL is distributed in the hope that it will be useful,
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@ -25,72 +25,72 @@
*/
#ifndef CYASSL_EVP_H_
#define CYASSL_EVP_H_
#ifndef WOLFSSL_EVP_H_
#define WOLFSSL_EVP_H_
#include <cyassl/ctaocrypt/settings.h>
#include <wolfssl/wolfcrypt/settings.h>
#ifdef YASSL_PREFIX
#ifdef WOLFSSL_PREFIX
#include "prefix_evp.h"
#endif
#include <cyassl/openssl/md5.h>
#include <cyassl/openssl/sha.h>
#include <cyassl/openssl/ripemd.h>
#include <cyassl/openssl/rsa.h>
#include <cyassl/openssl/dsa.h>
#include <wolfssl/openssl/md5.h>
#include <wolfssl/openssl/sha.h>
#include <wolfssl/openssl/ripemd.h>
#include <wolfssl/openssl/rsa.h>
#include <wolfssl/openssl/dsa.h>
#include <cyassl/ctaocrypt/aes.h>
#include <cyassl/ctaocrypt/des3.h>
#include <cyassl/ctaocrypt/arc4.h>
#include <wolfssl/wolfcrypt/aes.h>
#include <wolfssl/wolfcrypt/des3.h>
#include <wolfssl/wolfcrypt/arc4.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef char CYASSL_EVP_MD;
typedef char CYASSL_EVP_CIPHER;
typedef char WOLFSSL_EVP_MD;
typedef char WOLFSSL_EVP_CIPHER;
CYASSL_API const CYASSL_EVP_MD* CyaSSL_EVP_md5(void);
CYASSL_API const CYASSL_EVP_MD* CyaSSL_EVP_sha1(void);
CYASSL_API const CYASSL_EVP_MD* CyaSSL_EVP_sha256(void);
CYASSL_API const CYASSL_EVP_MD* CyaSSL_EVP_sha384(void);
CYASSL_API const CYASSL_EVP_MD* CyaSSL_EVP_sha512(void);
CYASSL_API const CYASSL_EVP_MD* CyaSSL_EVP_ripemd160(void);
WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_md5(void);
WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha1(void);
WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha256(void);
WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha384(void);
WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha512(void);
WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_ripemd160(void);
CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_128_cbc(void);
CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_192_cbc(void);
CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_256_cbc(void);
CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_128_ctr(void);
CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_192_ctr(void);
CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_256_ctr(void);
CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_des_cbc(void);
CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_des_ede3_cbc(void);
CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_rc4(void);
CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_enc_null(void);
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_cbc(void);
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_cbc(void);
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_cbc(void);
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_ctr(void);
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_ctr(void);
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_ctr(void);
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_des_cbc(void);
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_des_ede3_cbc(void);
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_rc4(void);
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_enc_null(void);
typedef union {
CYASSL_MD5_CTX md5;
CYASSL_SHA_CTX sha;
CYASSL_SHA256_CTX sha256;
#ifdef CYASSL_SHA384
CYASSL_SHA384_CTX sha384;
WOLFSSL_MD5_CTX md5;
WOLFSSL_SHA_CTX sha;
WOLFSSL_SHA256_CTX sha256;
#ifdef WOLFSSL_SHA384
WOLFSSL_SHA384_CTX sha384;
#endif
#ifdef CYASSL_SHA512
CYASSL_SHA512_CTX sha512;
#ifdef WOLFSSL_SHA512
WOLFSSL_SHA512_CTX sha512;
#endif
#ifdef CYASSL_RIPEMD
CYASSL_RIPEMD_CTX ripemd;
#ifdef WOLFSSL_RIPEMD
WOLFSSL_RIPEMD_CTX ripemd;
#endif
} CYASSL_Hasher;
} WOLFSSL_Hasher;
typedef struct CYASSL_EVP_MD_CTX {
typedef struct WOLFSSL_EVP_MD_CTX {
unsigned char macType;
CYASSL_Hasher hash;
} CYASSL_EVP_MD_CTX;
WOLFSSL_Hasher hash;
} WOLFSSL_EVP_MD_CTX;
typedef union {
@ -100,7 +100,7 @@ typedef union {
Des3 des3;
#endif
Arc4 arc4;
} CYASSL_Cipher;
} WOLFSSL_Cipher;
enum {
@ -121,113 +121,113 @@ enum {
};
typedef struct CYASSL_EVP_CIPHER_CTX {
typedef struct WOLFSSL_EVP_CIPHER_CTX {
int keyLen; /* user may set for variable */
unsigned char enc; /* if encrypt side, then true */
unsigned char cipherType;
unsigned char iv[AES_BLOCK_SIZE]; /* working iv pointer into cipher */
CYASSL_Cipher cipher;
} CYASSL_EVP_CIPHER_CTX;
WOLFSSL_Cipher cipher;
} WOLFSSL_EVP_CIPHER_CTX;
CYASSL_API int CyaSSL_EVP_MD_size(const CYASSL_EVP_MD* md);
CYASSL_API void CyaSSL_EVP_MD_CTX_init(CYASSL_EVP_MD_CTX* ctx);
CYASSL_API int CyaSSL_EVP_MD_CTX_cleanup(CYASSL_EVP_MD_CTX* ctx);
WOLFSSL_API int wolfSSL_EVP_MD_size(const WOLFSSL_EVP_MD* md);
WOLFSSL_API void wolfSSL_EVP_MD_CTX_init(WOLFSSL_EVP_MD_CTX* ctx);
WOLFSSL_API int wolfSSL_EVP_MD_CTX_cleanup(WOLFSSL_EVP_MD_CTX* ctx);
CYASSL_API int CyaSSL_EVP_DigestInit(CYASSL_EVP_MD_CTX* ctx,
const CYASSL_EVP_MD* type);
CYASSL_API int CyaSSL_EVP_DigestUpdate(CYASSL_EVP_MD_CTX* ctx, const void* data,
WOLFSSL_API int wolfSSL_EVP_DigestInit(WOLFSSL_EVP_MD_CTX* ctx,
const WOLFSSL_EVP_MD* type);
WOLFSSL_API int wolfSSL_EVP_DigestUpdate(WOLFSSL_EVP_MD_CTX* ctx, const void* data,
unsigned long sz);
CYASSL_API int CyaSSL_EVP_DigestFinal(CYASSL_EVP_MD_CTX* ctx, unsigned char* md,
WOLFSSL_API int wolfSSL_EVP_DigestFinal(WOLFSSL_EVP_MD_CTX* ctx, unsigned char* md,
unsigned int* s);
CYASSL_API int CyaSSL_EVP_DigestFinal_ex(CYASSL_EVP_MD_CTX* ctx,
WOLFSSL_API int wolfSSL_EVP_DigestFinal_ex(WOLFSSL_EVP_MD_CTX* ctx,
unsigned char* md, unsigned int* s);
CYASSL_API int CyaSSL_EVP_BytesToKey(const CYASSL_EVP_CIPHER*,
const CYASSL_EVP_MD*, const unsigned char*,
WOLFSSL_API int wolfSSL_EVP_BytesToKey(const WOLFSSL_EVP_CIPHER*,
const WOLFSSL_EVP_MD*, const unsigned char*,
const unsigned char*, int, int, unsigned char*,
unsigned char*);
CYASSL_API void CyaSSL_EVP_CIPHER_CTX_init(CYASSL_EVP_CIPHER_CTX* ctx);
CYASSL_API int CyaSSL_EVP_CIPHER_CTX_cleanup(CYASSL_EVP_CIPHER_CTX* ctx);
WOLFSSL_API void wolfSSL_EVP_CIPHER_CTX_init(WOLFSSL_EVP_CIPHER_CTX* ctx);
WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_cleanup(WOLFSSL_EVP_CIPHER_CTX* ctx);
CYASSL_API int CyaSSL_EVP_CIPHER_CTX_iv_length(const CYASSL_EVP_CIPHER_CTX*);
WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_iv_length(const WOLFSSL_EVP_CIPHER_CTX*);
CYASSL_API int CyaSSL_EVP_CipherInit(CYASSL_EVP_CIPHER_CTX* ctx,
const CYASSL_EVP_CIPHER* type,
WOLFSSL_API int wolfSSL_EVP_CipherInit(WOLFSSL_EVP_CIPHER_CTX* ctx,
const WOLFSSL_EVP_CIPHER* type,
unsigned char* key, unsigned char* iv,
int enc);
CYASSL_API int CyaSSL_EVP_CIPHER_CTX_key_length(CYASSL_EVP_CIPHER_CTX* ctx);
CYASSL_API int CyaSSL_EVP_CIPHER_CTX_set_key_length(CYASSL_EVP_CIPHER_CTX* ctx,
WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_key_length(WOLFSSL_EVP_CIPHER_CTX* ctx);
WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_set_key_length(WOLFSSL_EVP_CIPHER_CTX* ctx,
int keylen);
CYASSL_API int CyaSSL_EVP_Cipher(CYASSL_EVP_CIPHER_CTX* ctx,
WOLFSSL_API int wolfSSL_EVP_Cipher(WOLFSSL_EVP_CIPHER_CTX* ctx,
unsigned char* dst, unsigned char* src,
unsigned int len);
CYASSL_API const CYASSL_EVP_MD* CyaSSL_EVP_get_digestbynid(int);
WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_get_digestbynid(int);
CYASSL_API CYASSL_RSA* CyaSSL_EVP_PKEY_get1_RSA(CYASSL_EVP_PKEY*);
CYASSL_API CYASSL_DSA* CyaSSL_EVP_PKEY_get1_DSA(CYASSL_EVP_PKEY*);
WOLFSSL_API WOLFSSL_RSA* wolfSSL_EVP_PKEY_get1_RSA(WOLFSSL_EVP_PKEY*);
WOLFSSL_API WOLFSSL_DSA* wolfSSL_EVP_PKEY_get1_DSA(WOLFSSL_EVP_PKEY*);
/* these next ones don't need real OpenSSL type, for OpenSSH compat only */
CYASSL_API void* CyaSSL_EVP_X_STATE(const CYASSL_EVP_CIPHER_CTX* ctx);
CYASSL_API int CyaSSL_EVP_X_STATE_LEN(const CYASSL_EVP_CIPHER_CTX* ctx);
WOLFSSL_API void* wolfSSL_EVP_X_STATE(const WOLFSSL_EVP_CIPHER_CTX* ctx);
WOLFSSL_API int wolfSSL_EVP_X_STATE_LEN(const WOLFSSL_EVP_CIPHER_CTX* ctx);
CYASSL_API void CyaSSL_3des_iv(CYASSL_EVP_CIPHER_CTX* ctx, int doset,
WOLFSSL_API void wolfSSL_3des_iv(WOLFSSL_EVP_CIPHER_CTX* ctx, int doset,
unsigned char* iv, int len);
CYASSL_API void CyaSSL_aes_ctr_iv(CYASSL_EVP_CIPHER_CTX* ctx, int doset,
WOLFSSL_API void wolfSSL_aes_ctr_iv(WOLFSSL_EVP_CIPHER_CTX* ctx, int doset,
unsigned char* iv, int len);
CYASSL_API int CyaSSL_StoreExternalIV(CYASSL_EVP_CIPHER_CTX* ctx);
CYASSL_API int CyaSSL_SetInternalIV(CYASSL_EVP_CIPHER_CTX* ctx);
WOLFSSL_API int wolfSSL_StoreExternalIV(WOLFSSL_EVP_CIPHER_CTX* ctx);
WOLFSSL_API int wolfSSL_SetInternalIV(WOLFSSL_EVP_CIPHER_CTX* ctx);
/* end OpenSSH compat */
typedef CYASSL_EVP_MD EVP_MD;
typedef CYASSL_EVP_CIPHER EVP_CIPHER;
typedef CYASSL_EVP_MD_CTX EVP_MD_CTX;
typedef CYASSL_EVP_CIPHER_CTX EVP_CIPHER_CTX;
typedef WOLFSSL_EVP_MD EVP_MD;
typedef WOLFSSL_EVP_CIPHER EVP_CIPHER;
typedef WOLFSSL_EVP_MD_CTX EVP_MD_CTX;
typedef WOLFSSL_EVP_CIPHER_CTX EVP_CIPHER_CTX;
#define EVP_md5 CyaSSL_EVP_md5
#define EVP_sha1 CyaSSL_EVP_sha1
#define EVP_sha256 CyaSSL_EVP_sha256
#define EVP_sha384 CyaSSL_EVP_sha384
#define EVP_sha512 CyaSSL_EVP_sha512
#define EVP_ripemd160 CyaSSL_EVP_ripemd160
#define EVP_md5 wolfSSL_EVP_md5
#define EVP_sha1 wolfSSL_EVP_sha1
#define EVP_sha256 wolfSSL_EVP_sha256
#define EVP_sha384 wolfSSL_EVP_sha384
#define EVP_sha512 wolfSSL_EVP_sha512
#define EVP_ripemd160 wolfSSL_EVP_ripemd160
#define EVP_aes_128_cbc CyaSSL_EVP_aes_128_cbc
#define EVP_aes_192_cbc CyaSSL_EVP_aes_192_cbc
#define EVP_aes_256_cbc CyaSSL_EVP_aes_256_cbc
#define EVP_aes_128_ctr CyaSSL_EVP_aes_128_ctr
#define EVP_aes_192_ctr CyaSSL_EVP_aes_192_ctr
#define EVP_aes_256_ctr CyaSSL_EVP_aes_256_ctr
#define EVP_des_cbc CyaSSL_EVP_des_cbc
#define EVP_des_ede3_cbc CyaSSL_EVP_des_ede3_cbc
#define EVP_rc4 CyaSSL_EVP_rc4
#define EVP_enc_null CyaSSL_EVP_enc_null
#define EVP_aes_128_cbc wolfSSL_EVP_aes_128_cbc
#define EVP_aes_192_cbc wolfSSL_EVP_aes_192_cbc
#define EVP_aes_256_cbc wolfSSL_EVP_aes_256_cbc
#define EVP_aes_128_ctr wolfSSL_EVP_aes_128_ctr
#define EVP_aes_192_ctr wolfSSL_EVP_aes_192_ctr
#define EVP_aes_256_ctr wolfSSL_EVP_aes_256_ctr
#define EVP_des_cbc wolfSSL_EVP_des_cbc
#define EVP_des_ede3_cbc wolfSSL_EVP_des_ede3_cbc
#define EVP_rc4 wolfSSL_EVP_rc4
#define EVP_enc_null wolfSSL_EVP_enc_null
#define EVP_MD_size CyaSSL_EVP_MD_size
#define EVP_MD_CTX_init CyaSSL_EVP_MD_CTX_init
#define EVP_MD_CTX_cleanup CyaSSL_EVP_MD_CTX_cleanup
#define EVP_DigestInit CyaSSL_EVP_DigestInit
#define EVP_DigestUpdate CyaSSL_EVP_DigestUpdate
#define EVP_DigestFinal CyaSSL_EVP_DigestFinal
#define EVP_DigestFinal_ex CyaSSL_EVP_DigestFinal_ex
#define EVP_BytesToKey CyaSSL_EVP_BytesToKey
#define EVP_MD_size wolfSSL_EVP_MD_size
#define EVP_MD_CTX_init wolfSSL_EVP_MD_CTX_init
#define EVP_MD_CTX_cleanup wolfSSL_EVP_MD_CTX_cleanup
#define EVP_DigestInit wolfSSL_EVP_DigestInit
#define EVP_DigestUpdate wolfSSL_EVP_DigestUpdate
#define EVP_DigestFinal wolfSSL_EVP_DigestFinal
#define EVP_DigestFinal_ex wolfSSL_EVP_DigestFinal_ex
#define EVP_BytesToKey wolfSSL_EVP_BytesToKey
#define EVP_CIPHER_CTX_init CyaSSL_EVP_CIPHER_CTX_init
#define EVP_CIPHER_CTX_cleanup CyaSSL_EVP_CIPHER_CTX_cleanup
#define EVP_CIPHER_CTX_iv_length CyaSSL_EVP_CIPHER_CTX_iv_length
#define EVP_CIPHER_CTX_key_length CyaSSL_EVP_CIPHER_CTX_key_length
#define EVP_CIPHER_CTX_set_key_length CyaSSL_EVP_CIPHER_CTX_set_key_length
#define EVP_CipherInit CyaSSL_EVP_CipherInit
#define EVP_Cipher CyaSSL_EVP_Cipher
#define EVP_CIPHER_CTX_init wolfSSL_EVP_CIPHER_CTX_init
#define EVP_CIPHER_CTX_cleanup wolfSSL_EVP_CIPHER_CTX_cleanup
#define EVP_CIPHER_CTX_iv_length wolfSSL_EVP_CIPHER_CTX_iv_length
#define EVP_CIPHER_CTX_key_length wolfSSL_EVP_CIPHER_CTX_key_length
#define EVP_CIPHER_CTX_set_key_length wolfSSL_EVP_CIPHER_CTX_set_key_length
#define EVP_CipherInit wolfSSL_EVP_CipherInit
#define EVP_Cipher wolfSSL_EVP_Cipher
#define EVP_get_digestbynid CyaSSL_EVP_get_digestbynid
#define EVP_get_digestbynid wolfSSL_EVP_get_digestbynid
#define EVP_PKEY_get1_RSA CyaSSL_EVP_PKEY_get1_RSA
#define EVP_PKEY_get1_DSA CyaSSL_EVP_PKEY_get1_DSA
#define EVP_PKEY_get1_RSA wolfSSL_EVP_PKEY_get1_RSA
#define EVP_PKEY_get1_DSA wolfSSL_EVP_PKEY_get1_DSA
#ifndef EVP_MAX_MD_SIZE
#define EVP_MAX_MD_SIZE 64 /* sha512 */
@ -238,4 +238,4 @@ typedef CYASSL_EVP_CIPHER_CTX EVP_CIPHER_CTX;
#endif
#endif /* CYASSL_EVP_H_ */
#endif /* WOLFSSL_EVP_H_ */

View File

@ -2,14 +2,14 @@
*
* Copyright (C) 2013 wolfSSL Inc.
*
* This file is part of CyaSSL.
* This file is part of wolfSSL. (formerly known as CyaSSL)
*
* CyaSSL is free software; you can redistribute it and/or modify
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* CyaSSL is distributed in the hope that it will be useful,
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@ -25,52 +25,52 @@
*/
#ifndef CYASSL_HMAC_H_
#define CYASSL_HMAC_H_
#ifndef WOLFSSL_HMAC_H_
#define WOLFSSL_HMAC_H_
#include <cyassl/ctaocrypt/settings.h>
#include <wolfssl/wolfcrypt/settings.h>
#ifdef YASSL_PREFIX
#ifdef WOLFSSL_PREFIX
#include "prefix_hmac.h"
#endif
#include <cyassl/openssl/evp.h>
#include <cyassl/ctaocrypt/hmac.h>
#include <wolfssl/openssl/evp.h>
#include <wolfssl/wolfcrypt/hmac.h>
#ifdef __cplusplus
extern "C" {
#endif
CYASSL_API unsigned char* CyaSSL_HMAC(const CYASSL_EVP_MD* evp_md,
WOLFSSL_API unsigned char* wolfSSL_HMAC(const WOLFSSL_EVP_MD* evp_md,
const void* key, int key_len,
const unsigned char* d, int n, unsigned char* md,
unsigned int* md_len);
typedef struct CYASSL_HMAC_CTX {
typedef struct WOLFSSL_HMAC_CTX {
Hmac hmac;
int type;
} CYASSL_HMAC_CTX;
} WOLFSSL_HMAC_CTX;
CYASSL_API void CyaSSL_HMAC_Init(CYASSL_HMAC_CTX* ctx, const void* key,
WOLFSSL_API void wolfSSL_HMAC_Init(WOLFSSL_HMAC_CTX* ctx, const void* key,
int keylen, const EVP_MD* type);
CYASSL_API void CyaSSL_HMAC_Update(CYASSL_HMAC_CTX* ctx,
WOLFSSL_API void wolfSSL_HMAC_Update(WOLFSSL_HMAC_CTX* ctx,
const unsigned char* data, int len);
CYASSL_API void CyaSSL_HMAC_Final(CYASSL_HMAC_CTX* ctx, unsigned char* hash,
WOLFSSL_API void wolfSSL_HMAC_Final(WOLFSSL_HMAC_CTX* ctx, unsigned char* hash,
unsigned int* len);
CYASSL_API void CyaSSL_HMAC_cleanup(CYASSL_HMAC_CTX* ctx);
WOLFSSL_API void wolfSSL_HMAC_cleanup(WOLFSSL_HMAC_CTX* ctx);
typedef struct CYASSL_HMAC_CTX HMAC_CTX;
typedef struct WOLFSSL_HMAC_CTX HMAC_CTX;
#define HMAC(a,b,c,d,e,f,g) CyaSSL_HMAC((a),(b),(c),(d),(e),(f),(g))
#define HMAC(a,b,c,d,e,f,g) wolfSSL_HMAC((a),(b),(c),(d),(e),(f),(g))
#define HMAC_Init CyaSSL_HMAC_Init
#define HMAC_Update CyaSSL_HMAC_Update
#define HMAC_Final CyaSSL_HMAC_Final
#define HMAC_cleanup CyaSSL_HMAC_cleanup
#define HMAC_Init wolfSSL_HMAC_Init
#define HMAC_Update wolfSSL_HMAC_Update
#define HMAC_Final wolfSSL_HMAC_Final
#define HMAC_cleanup wolfSSL_HMAC_cleanup
#ifdef __cplusplus
@ -78,4 +78,4 @@ typedef struct CYASSL_HMAC_CTX HMAC_CTX;
#endif
#endif /* CYASSL_HMAC_H_ */
#endif /* WOLFSSL_HMAC_H_ */

View File

@ -1,12 +1,12 @@
/* md5.h for openssl */
#ifndef CYASSL_MD5_H_
#define CYASSL_MD5_H_
#ifndef WOLFSSL_MD5_H_
#define WOLFSSL_MD5_H_
#include <cyassl/ctaocrypt/settings.h>
#include <wolfssl/wolfcrypt/settings.h>
#ifdef YASSL_PREFIX
#ifdef WOLFSSL_PREFIX
#include "prefix_md5.h"
#endif
@ -15,25 +15,25 @@
#endif
typedef struct CYASSL_MD5_CTX {
typedef struct WOLFSSL_MD5_CTX {
int holder[24]; /* big enough to hold ctaocrypt md5, but check on init */
} CYASSL_MD5_CTX;
} WOLFSSL_MD5_CTX;
CYASSL_API void CyaSSL_MD5_Init(CYASSL_MD5_CTX*);
CYASSL_API void CyaSSL_MD5_Update(CYASSL_MD5_CTX*, const void*, unsigned long);
CYASSL_API void CyaSSL_MD5_Final(unsigned char*, CYASSL_MD5_CTX*);
WOLFSSL_API void wolfSSL_MD5_Init(WOLFSSL_MD5_CTX*);
WOLFSSL_API void wolfSSL_MD5_Update(WOLFSSL_MD5_CTX*, const void*, unsigned long);
WOLFSSL_API void wolfSSL_MD5_Final(unsigned char*, WOLFSSL_MD5_CTX*);
typedef CYASSL_MD5_CTX MD5_CTX;
typedef WOLFSSL_MD5_CTX MD5_CTX;
#define MD5_Init CyaSSL_MD5_Init
#define MD5_Update CyaSSL_MD5_Update
#define MD5_Final CyaSSL_MD5_Final
#define MD5_Init wolfSSL_MD5_Init
#define MD5_Update wolfSSL_MD5_Update
#define MD5_Final wolfSSL_MD5_Final
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* CYASSL_MD5_H_ */
#endif /* WOLFSSL_MD5_H_ */

View File

@ -1,7 +1,7 @@
/* opensslv.h compatibility */
#ifndef CYASSL_OPENSSLV_H_
#define CYASSL_OPENSSLV_H_
#ifndef WOLFSSL_OPENSSLV_H_
#define WOLFSSL_OPENSSLV_H_
/* api version compatibility */

View File

@ -1,35 +1,35 @@
/* pem.h for openssl */
#ifndef CYASSL_PEM_H_
#define CYASSL_PEM_H_
#ifndef WOLFSSL_PEM_H_
#define WOLFSSL_PEM_H_
#include <cyassl/openssl/evp.h>
#include <cyassl/openssl/bio.h>
#include <cyassl/openssl/rsa.h>
#include <cyassl/openssl/dsa.h>
#include <wolfssl/openssl/evp.h>
#include <wolfssl/openssl/bio.h>
#include <wolfssl/openssl/rsa.h>
#include <wolfssl/openssl/dsa.h>
#ifdef __cplusplus
extern "C" {
#endif
CYASSL_API int CyaSSL_PEM_write_bio_RSAPrivateKey(CYASSL_BIO* bio, RSA* rsa,
WOLFSSL_API int wolfSSL_PEM_write_bio_RSAPrivateKey(WOLFSSL_BIO* bio, RSA* rsa,
const EVP_CIPHER* cipher,
unsigned char* passwd, int len,
pem_password_cb cb, void* arg);
CYASSL_API int CyaSSL_PEM_write_bio_DSAPrivateKey(CYASSL_BIO* bio, DSA* rsa,
WOLFSSL_API int wolfSSL_PEM_write_bio_DSAPrivateKey(WOLFSSL_BIO* bio, DSA* rsa,
const EVP_CIPHER* cipher,
unsigned char* passwd, int len,
pem_password_cb cb, void* arg);
CYASSL_API CYASSL_EVP_PKEY* CyaSSL_PEM_read_bio_PrivateKey(CYASSL_BIO* bio,
CYASSL_EVP_PKEY**, pem_password_cb cb, void* arg);
WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_PEM_read_bio_PrivateKey(WOLFSSL_BIO* bio,
WOLFSSL_EVP_PKEY**, pem_password_cb cb, void* arg);
#define PEM_write_bio_RSAPrivateKey CyaSSL_PEM_write_bio_RSAPrivateKey
#define PEM_write_bio_DSAPrivateKey CyaSSL_PEM_write_bio_DSAPrivateKey
#define PEM_read_bio_PrivateKey CyaSSL_PEM_read_bio_PrivateKey
#define PEM_write_bio_RSAPrivateKey wolfSSL_PEM_write_bio_RSAPrivateKey
#define PEM_write_bio_DSAPrivateKey wolfSSL_PEM_write_bio_DSAPrivateKey
#define PEM_read_bio_PrivateKey wolfSSL_PEM_read_bio_PrivateKey
#ifdef __cplusplus
@ -37,5 +37,5 @@ CYASSL_API CYASSL_EVP_PKEY* CyaSSL_PEM_read_bio_PrivateKey(CYASSL_BIO* bio,
#endif
#endif /* CYASSL_PEM_H_ */
#endif /* WOLFSSL_PEM_H_ */

View File

@ -1,31 +1,31 @@
/* ripemd.h for openssl */
#ifndef CYASSL_RIPEMD_H_
#define CYASSL_RIPEMD_H_
#ifndef WOLFSSL_RIPEMD_H_
#define WOLFSSL_RIPEMD_H_
#include <cyassl/ctaocrypt/settings.h>
#include <wolfssl/wolfcrypt/settings.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct CYASSL_RIPEMD_CTX {
typedef struct WOLFSSL_RIPEMD_CTX {
int holder[32]; /* big enough to hold ctaocrypt, but check on init */
} CYASSL_RIPEMD_CTX;
} WOLFSSL_RIPEMD_CTX;
CYASSL_API void CyaSSL_RIPEMD_Init(CYASSL_RIPEMD_CTX*);
CYASSL_API void CyaSSL_RIPEMD_Update(CYASSL_RIPEMD_CTX*, const void*,
WOLFSSL_API void wolfSSL_RIPEMD_Init(WOLFSSL_RIPEMD_CTX*);
WOLFSSL_API void wolfSSL_RIPEMD_Update(WOLFSSL_RIPEMD_CTX*, const void*,
unsigned long);
CYASSL_API void CyaSSL_RIPEMD_Final(unsigned char*, CYASSL_RIPEMD_CTX*);
WOLFSSL_API void wolfSSL_RIPEMD_Final(unsigned char*, WOLFSSL_RIPEMD_CTX*);
typedef CYASSL_RIPEMD_CTX RIPEMD_CTX;
typedef WOLFSSL_RIPEMD_CTX RIPEMD_CTX;
#define RIPEMD_Init CyaSSL_RIPEMD_Init
#define RIPEMD_Update CyaSSL_RIPEMD_Update
#define RIPEMD_Final CyaSSL_RIPEMD_Final
#define RIPEMD_Init wolfSSL_RIPEMD_Init
#define RIPEMD_Update wolfSSL_RIPEMD_Update
#define RIPEMD_Final wolfSSL_RIPEMD_Final
#ifdef __cplusplus
@ -33,5 +33,5 @@ typedef CYASSL_RIPEMD_CTX RIPEMD_CTX;
#endif
#endif /* CYASSL_MD5_H_ */
#endif /* WOLFSSL_MD5_H_ */

View File

@ -1,11 +1,11 @@
/* rsa.h for openSSL */
#ifndef CYASSL_RSA_H_
#define CYASSL_RSA_H_
#ifndef WOLFSSL_RSA_H_
#define WOLFSSL_RSA_H_
#include <cyassl/openssl/ssl.h>
#include <cyassl/openssl/bn.h>
#include <wolfssl/openssl/ssl.h>
#include <wolfssl/openssl/bn.h>
#ifdef __cplusplus
@ -17,55 +17,55 @@ enum {
RSA_PKCS1_PADDING = 1
};
struct CYASSL_RSA {
CYASSL_BIGNUM* n;
CYASSL_BIGNUM* e;
CYASSL_BIGNUM* d;
CYASSL_BIGNUM* p;
CYASSL_BIGNUM* q;
CYASSL_BIGNUM* dmp1; /* dP */
CYASSL_BIGNUM* dmq1; /* dQ */
CYASSL_BIGNUM* iqmp; /* u */
struct WOLFSSL_RSA {
WOLFSSL_BIGNUM* n;
WOLFSSL_BIGNUM* e;
WOLFSSL_BIGNUM* d;
WOLFSSL_BIGNUM* p;
WOLFSSL_BIGNUM* q;
WOLFSSL_BIGNUM* dmp1; /* dP */
WOLFSSL_BIGNUM* dmq1; /* dQ */
WOLFSSL_BIGNUM* iqmp; /* u */
void* internal; /* our RSA */
char inSet; /* internal set from external ? */
char exSet; /* external set from internal ? */
};
CYASSL_API CYASSL_RSA* CyaSSL_RSA_new(void);
CYASSL_API void CyaSSL_RSA_free(CYASSL_RSA*);
WOLFSSL_API WOLFSSL_RSA* wolfSSL_RSA_new(void);
WOLFSSL_API void wolfSSL_RSA_free(WOLFSSL_RSA*);
CYASSL_API int CyaSSL_RSA_generate_key_ex(CYASSL_RSA*, int bits, CYASSL_BIGNUM*,
WOLFSSL_API int wolfSSL_RSA_generate_key_ex(WOLFSSL_RSA*, int bits, WOLFSSL_BIGNUM*,
void* cb);
CYASSL_API int CyaSSL_RSA_blinding_on(CYASSL_RSA*, CYASSL_BN_CTX*);
CYASSL_API int CyaSSL_RSA_public_encrypt(int len, unsigned char* fr,
unsigned char* to, CYASSL_RSA*, int padding);
CYASSL_API int CyaSSL_RSA_private_decrypt(int len, unsigned char* fr,
unsigned char* to, CYASSL_RSA*, int padding);
WOLFSSL_API int wolfSSL_RSA_blinding_on(WOLFSSL_RSA*, WOLFSSL_BN_CTX*);
WOLFSSL_API int wolfSSL_RSA_public_encrypt(int len, unsigned char* fr,
unsigned char* to, WOLFSSL_RSA*, int padding);
WOLFSSL_API int wolfSSL_RSA_private_decrypt(int len, unsigned char* fr,
unsigned char* to, WOLFSSL_RSA*, int padding);
CYASSL_API int CyaSSL_RSA_size(const CYASSL_RSA*);
CYASSL_API int CyaSSL_RSA_sign(int type, const unsigned char* m,
WOLFSSL_API int wolfSSL_RSA_size(const WOLFSSL_RSA*);
WOLFSSL_API int wolfSSL_RSA_sign(int type, const unsigned char* m,
unsigned int mLen, unsigned char* sigRet,
unsigned int* sigLen, CYASSL_RSA*);
CYASSL_API int CyaSSL_RSA_public_decrypt(int flen, unsigned char* from,
unsigned char* to, CYASSL_RSA*, int padding);
CYASSL_API int CyaSSL_RSA_GenAdd(CYASSL_RSA*);
CYASSL_API int CyaSSL_RSA_LoadDer(CYASSL_RSA*, const unsigned char*, int sz);
unsigned int* sigLen, WOLFSSL_RSA*);
WOLFSSL_API int wolfSSL_RSA_public_decrypt(int flen, unsigned char* from,
unsigned char* to, WOLFSSL_RSA*, int padding);
WOLFSSL_API int wolfSSL_RSA_GenAdd(WOLFSSL_RSA*);
WOLFSSL_API int wolfSSL_RSA_LoadDer(WOLFSSL_RSA*, const unsigned char*, int sz);
#define RSA_new CyaSSL_RSA_new
#define RSA_free CyaSSL_RSA_free
#define RSA_new wolfSSL_RSA_new
#define RSA_free wolfSSL_RSA_free
#define RSA_generate_key_ex CyaSSL_RSA_generate_key_ex
#define RSA_generate_key_ex wolfSSL_RSA_generate_key_ex
#define RSA_blinding_on CyaSSL_RSA_blinding_on
#define RSA_public_encrypt CyaSSL_RSA_public_encrypt
#define RSA_private_decrypt CyaSSL_RSA_private_decrypt
#define RSA_blinding_on wolfSSL_RSA_blinding_on
#define RSA_public_encrypt wolfSSL_RSA_public_encrypt
#define RSA_private_decrypt wolfSSL_RSA_private_decrypt
#define RSA_size CyaSSL_RSA_size
#define RSA_sign CyaSSL_RSA_sign
#define RSA_public_decrypt CyaSSL_RSA_public_decrypt
#define RSA_size wolfSSL_RSA_size
#define RSA_sign wolfSSL_RSA_sign
#define RSA_public_decrypt wolfSSL_RSA_public_decrypt
#ifdef __cplusplus

View File

@ -1,12 +1,12 @@
/* sha.h for openssl */
#ifndef CYASSL_SHA_H_
#define CYASSL_SHA_H_
#ifndef WOLFSSL_SHA_H_
#define WOLFSSL_SHA_H_
#include <cyassl/ctaocrypt/settings.h>
#include <wolfssl/wolfcrypt/settings.h>
#ifdef YASSL_PREFIX
#ifdef WOLFSSL_PREFIX
#include "prefix_sha.h"
#endif
@ -15,103 +15,103 @@
#endif
typedef struct CYASSL_SHA_CTX {
typedef struct WOLFSSL_SHA_CTX {
int holder[24]; /* big enough to hold ctaocrypt sha, but check on init */
} CYASSL_SHA_CTX;
} WOLFSSL_SHA_CTX;
CYASSL_API void CyaSSL_SHA_Init(CYASSL_SHA_CTX*);
CYASSL_API void CyaSSL_SHA_Update(CYASSL_SHA_CTX*, const void*, unsigned long);
CYASSL_API void CyaSSL_SHA_Final(unsigned char*, CYASSL_SHA_CTX*);
WOLFSSL_API void wolfSSL_SHA_Init(WOLFSSL_SHA_CTX*);
WOLFSSL_API void wolfSSL_SHA_Update(WOLFSSL_SHA_CTX*, const void*, unsigned long);
WOLFSSL_API void wolfSSL_SHA_Final(unsigned char*, WOLFSSL_SHA_CTX*);
/* SHA1 points to above, shouldn't use SHA0 ever */
CYASSL_API void CyaSSL_SHA1_Init(CYASSL_SHA_CTX*);
CYASSL_API void CyaSSL_SHA1_Update(CYASSL_SHA_CTX*, const void*, unsigned long);
CYASSL_API void CyaSSL_SHA1_Final(unsigned char*, CYASSL_SHA_CTX*);
WOLFSSL_API void wolfSSL_SHA1_Init(WOLFSSL_SHA_CTX*);
WOLFSSL_API void wolfSSL_SHA1_Update(WOLFSSL_SHA_CTX*, const void*, unsigned long);
WOLFSSL_API void wolfSSL_SHA1_Final(unsigned char*, WOLFSSL_SHA_CTX*);
enum {
SHA_DIGEST_LENGTH = 20
};
typedef CYASSL_SHA_CTX SHA_CTX;
typedef WOLFSSL_SHA_CTX SHA_CTX;
#define SHA_Init CyaSSL_SHA_Init
#define SHA_Update CyaSSL_SHA_Update
#define SHA_Final CyaSSL_SHA_Final
#define SHA_Init wolfSSL_SHA_Init
#define SHA_Update wolfSSL_SHA_Update
#define SHA_Final wolfSSL_SHA_Final
#define SHA1_Init CyaSSL_SHA1_Init
#define SHA1_Update CyaSSL_SHA1_Update
#define SHA1_Final CyaSSL_SHA1_Final
#define SHA1_Init wolfSSL_SHA1_Init
#define SHA1_Update wolfSSL_SHA1_Update
#define SHA1_Final wolfSSL_SHA1_Final
typedef struct CYASSL_SHA256_CTX {
typedef struct WOLFSSL_SHA256_CTX {
int holder[28]; /* big enough to hold ctaocrypt sha, but check on init */
} CYASSL_SHA256_CTX;
} WOLFSSL_SHA256_CTX;
CYASSL_API void CyaSSL_SHA256_Init(CYASSL_SHA256_CTX*);
CYASSL_API void CyaSSL_SHA256_Update(CYASSL_SHA256_CTX*, const void*,
WOLFSSL_API void wolfSSL_SHA256_Init(WOLFSSL_SHA256_CTX*);
WOLFSSL_API void wolfSSL_SHA256_Update(WOLFSSL_SHA256_CTX*, const void*,
unsigned long);
CYASSL_API void CyaSSL_SHA256_Final(unsigned char*, CYASSL_SHA256_CTX*);
WOLFSSL_API void wolfSSL_SHA256_Final(unsigned char*, WOLFSSL_SHA256_CTX*);
enum {
SHA256_DIGEST_LENGTH = 32
};
typedef CYASSL_SHA256_CTX SHA256_CTX;
typedef WOLFSSL_SHA256_CTX SHA256_CTX;
#define SHA256_Init CyaSSL_SHA256_Init
#define SHA256_Update CyaSSL_SHA256_Update
#define SHA256_Final CyaSSL_SHA256_Final
#define SHA256_Init wolfSSL_SHA256_Init
#define SHA256_Update wolfSSL_SHA256_Update
#define SHA256_Final wolfSSL_SHA256_Final
#ifdef CYASSL_SHA384
#ifdef WOLFSSL_SHA384
typedef struct CYASSL_SHA384_CTX {
typedef struct WOLFSSL_SHA384_CTX {
long long holder[32]; /* big enough, but check on init */
} CYASSL_SHA384_CTX;
} WOLFSSL_SHA384_CTX;
CYASSL_API void CyaSSL_SHA384_Init(CYASSL_SHA384_CTX*);
CYASSL_API void CyaSSL_SHA384_Update(CYASSL_SHA384_CTX*, const void*,
WOLFSSL_API void wolfSSL_SHA384_Init(WOLFSSL_SHA384_CTX*);
WOLFSSL_API void wolfSSL_SHA384_Update(WOLFSSL_SHA384_CTX*, const void*,
unsigned long);
CYASSL_API void CyaSSL_SHA384_Final(unsigned char*, CYASSL_SHA384_CTX*);
WOLFSSL_API void wolfSSL_SHA384_Final(unsigned char*, WOLFSSL_SHA384_CTX*);
enum {
SHA384_DIGEST_LENGTH = 48
};
typedef CYASSL_SHA384_CTX SHA384_CTX;
typedef WOLFSSL_SHA384_CTX SHA384_CTX;
#define SHA384_Init CyaSSL_SHA384_Init
#define SHA384_Update CyaSSL_SHA384_Update
#define SHA384_Final CyaSSL_SHA384_Final
#define SHA384_Init wolfSSL_SHA384_Init
#define SHA384_Update wolfSSL_SHA384_Update
#define SHA384_Final wolfSSL_SHA384_Final
#endif /* CYASSL_SHA384 */
#endif /* WOLFSSL_SHA384 */
#ifdef CYASSL_SHA512
#ifdef WOLFSSL_SHA512
typedef struct CYASSL_SHA512_CTX {
typedef struct WOLFSSL_SHA512_CTX {
long long holder[36]; /* big enough, but check on init */
} CYASSL_SHA512_CTX;
} WOLFSSL_SHA512_CTX;
CYASSL_API void CyaSSL_SHA512_Init(CYASSL_SHA512_CTX*);
CYASSL_API void CyaSSL_SHA512_Update(CYASSL_SHA512_CTX*, const void*,
WOLFSSL_API void wolfSSL_SHA512_Init(WOLFSSL_SHA512_CTX*);
WOLFSSL_API void wolfSSL_SHA512_Update(WOLFSSL_SHA512_CTX*, const void*,
unsigned long);
CYASSL_API void CyaSSL_SHA512_Final(unsigned char*, CYASSL_SHA512_CTX*);
WOLFSSL_API void wolfSSL_SHA512_Final(unsigned char*, WOLFSSL_SHA512_CTX*);
enum {
SHA512_DIGEST_LENGTH = 64
};
typedef CYASSL_SHA512_CTX SHA512_CTX;
typedef WOLFSSL_SHA512_CTX SHA512_CTX;
#define SHA512_Init CyaSSL_SHA512_Init
#define SHA512_Update CyaSSL_SHA512_Update
#define SHA512_Final CyaSSL_SHA512_Final
#define SHA512_Init wolfSSL_SHA512_Init
#define SHA512_Update wolfSSL_SHA512_Update
#define SHA512_Final wolfSSL_SHA512_Final
#endif /* CYASSL_SHA512 */
#endif /* WOLFSSL_SHA512 */
@ -121,5 +121,5 @@ typedef CYASSL_SHA512_CTX SHA512_CTX;
#endif
#endif /* CYASSL_SHA_H_ */
#endif /* WOLFSSL_SHA_H_ */

View File

@ -2,7 +2,7 @@
*
* Copyright (C) 2006-2014 wolfSSL Inc.
*
* This file is part of wolfSSL.
* This file is part of wolfSSL. (formerly known as CyaSSL)
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by