diff --git a/configure.ac b/configure.ac index c1e295255..303e93653 100644 --- a/configure.ac +++ b/configure.ac @@ -187,7 +187,7 @@ AC_ARG_ENABLE([fortress], if test "$ENABLED_FORTRESS" = "yes" then - AM_CFLAGS="$AM_CFLAGS -DFORTRESS -DCYASSL_ALWAYS_VERIFY_CB -DOPENSSL_EXTRA -DCYASSL_DES_ECB -DCYASSL_AES_COUNTER -DCYASSL_AES_DIRECT -DCYASSL_DER_LOAD -DCYASSL_SHA512 -DCYASSL_SHA384 -DCYASSL_KEY_GEN" + AM_CFLAGS="$AM_CFLAGS -DFORTRESS -DCYASSL_ALWAYS_VERIFY_CB -DOPENSSL_EXTRA -DCYASSL_DES_ECB -DCYASSL_AES_COUNTER -DCYASSL_AES_DIRECT -DCYASSL_DER_LOAD -DCYASSL_SHA512 -DCYASSL_SHA384 -DWOLFSSL_KEY_GEN" fi @@ -200,7 +200,7 @@ AC_ARG_ENABLE([bump], if test "$ENABLED_BUMP" = "yes" then - AM_CFLAGS="$AM_CFLAGS -DLARGE_STATIC_BUFFERS -DCYASSL_CERT_GEN -DCYASSL_KEY_GEN -DHUGE_SESSION_CACHE -DOPENSSL_EXTRA -DFP_MAX_BITS=8192 -DCYASSL_DER_LOAD -DCYASSL_ALT_NAMES -DCYASSL_TEST_CERT" + AM_CFLAGS="$AM_CFLAGS -DLARGE_STATIC_BUFFERS -DCYASSL_CERT_GEN -DWOLFSSL_KEY_GEN -DHUGE_SESSION_CACHE -DOPENSSL_EXTRA -DFP_MAX_BITS=8192 -DCYASSL_DER_LOAD -DCYASSL_ALT_NAMES -DCYASSL_TEST_CERT" fi ENABLED_SLOWMATH="yes" @@ -536,7 +536,7 @@ AC_ARG_ENABLE([keygen], if test "$ENABLED_KEYGEN" = "yes" then - AM_CFLAGS="$AM_CFLAGS -DCYASSL_KEY_GEN" + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN" fi @@ -1441,7 +1441,7 @@ then if test "x$ENABLED_KEYGEN" = "xno" then ENABLED_KEYGEN="yes" - AM_CFLAGS="$AM_CFLAGS -DCYASSL_KEY_GEN" + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN" fi if test "x$ENABLED_CERTGEN" = "xno" then diff --git a/cyassl/ctaocrypt/types.h b/cyassl/ctaocrypt/types.h index 27d8a5de8..bf7dac728 100644 --- a/cyassl/ctaocrypt/types.h +++ b/cyassl/ctaocrypt/types.h @@ -26,11 +26,11 @@ #ifndef HAVE_FIPS #include /* compatibility macros */ -#define CYASSL_WORD_SIZE WOLFSSL_WORD_SIZE -#define CYASSL_BIT_SIZE WOLFSSL_BIT_SIZE -#define CYASSL_MAX_16BIT WOLFSSL_MAX_16BIT +#define CYASSL_WORD_SIZE WOLFSSL_WORD_SIZE +#define CYASSL_BIT_SIZE WOLFSSL_BIT_SIZE +#define CYASSL_MAX_16BIT WOLFSSL_MAX_16BIT +#define CYASSL_MAX_ERROR_SZ WOLFSSL_MAX_ERROR_SZ #define cyassl_word wolfssl_word - #else #include diff --git a/src/internal.c b/src/internal.c index 6f31bc39d..7854d0797 100644 --- a/src/internal.c +++ b/src/internal.c @@ -5758,18 +5758,18 @@ static INLINE int Encrypt(WOLFSSL* ssl, byte* out, const byte* input, word16 sz) #ifdef HAVE_CAMELLIA case wolfssl_camellia: - CamelliaCbcEncrypt(ssl->encrypt.cam, out, input, sz); + wc_CamelliaCbcEncrypt(ssl->encrypt.cam, out, input, sz); break; #endif #ifdef HAVE_HC128 case wolfssl_hc128: - return Hc128_Process(ssl->encrypt.hc128, out, input, sz); + return wc_Hc128_Process(ssl->encrypt.hc128, out, input, sz); #endif #ifdef BUILD_RABBIT case wolfssl_rabbit: - return RabbitProcess(ssl->encrypt.rabbit, out, input, sz); + return wc_RabbitProcess(ssl->encrypt.rabbit, out, input, sz); #endif #ifdef HAVE_CHACHA diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 437a7f61a..dd4aea5ef 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -911,10 +911,10 @@ static int DecryptKey(const char* password, int passwordSz, byte* salt, #endif if (version == PKCS5v2) - ret = PBKDF2(key, (byte*)password, passwordSz, salt, saltSz, iterations, + ret = wc_PBKDF2(key, (byte*)password, passwordSz, salt, saltSz, iterations, derivedLen, typeH); else if (version == PKCS5) - ret = PBKDF1(key, (byte*)password, passwordSz, salt, saltSz, iterations, + ret = wc_PBKDF1(key, (byte*)password, passwordSz, salt, saltSz, iterations, derivedLen, typeH); else if (version == PKCS12) { int i, idx = 0; @@ -935,10 +935,10 @@ static int DecryptKey(const char* password, int passwordSz, byte* salt, unicodePasswd[idx++] = 0x00; unicodePasswd[idx++] = 0x00; - ret = PKCS12_PBKDF(key, unicodePasswd, idx, salt, saltSz, + ret = wc_PKCS12_PBKDF(key, unicodePasswd, idx, salt, saltSz, iterations, derivedLen, typeH, 1); if (decryptionType != RC4_TYPE) - ret += PKCS12_PBKDF(cbcIv, unicodePasswd, idx, salt, saltSz, + ret += wc_PKCS12_PBKDF(cbcIv, unicodePasswd, idx, salt, saltSz, iterations, 8, typeH, 2); } else { @@ -965,7 +965,7 @@ static int DecryptKey(const char* password, int passwordSz, byte* salt, if (version == PKCS5v2 || version == PKCS12) desIv = cbcIv; - ret = Des_SetKey(&dec, key, desIv, DES_DECRYPTION); + ret = wc_Des_SetKey(&dec, key, desIv, DES_DECRYPTION); if (ret != 0) { #ifdef WOLFSSL_SMALL_STACK XFREE(key, NULL, DYNAMIC_TYPE_TMP_BUFFER); @@ -973,7 +973,7 @@ static int DecryptKey(const char* password, int passwordSz, byte* salt, return ret; } - Des_CbcDecrypt(&dec, input, input, length); + wc_Des_CbcDecrypt(&dec, input, input, length); break; } @@ -984,14 +984,14 @@ static int DecryptKey(const char* password, int passwordSz, byte* salt, if (version == PKCS5v2 || version == PKCS12) desIv = cbcIv; - ret = Des3_SetKey(&dec, key, desIv, DES_DECRYPTION); + ret = wc_Des3_SetKey(&dec, key, desIv, DES_DECRYPTION); if (ret != 0) { #ifdef WOLFSSL_SMALL_STACK XFREE(key, NULL, DYNAMIC_TYPE_TMP_BUFFER); #endif return ret; } - ret = Des3_CbcDecrypt(&dec, input, input, length); + ret = wc_Des3_CbcDecrypt(&dec, input, input, length); if (ret != 0) { #ifdef WOLFSSL_SMALL_STACK XFREE(key, NULL, DYNAMIC_TYPE_TMP_BUFFER); @@ -1006,8 +1006,8 @@ static int DecryptKey(const char* password, int passwordSz, byte* salt, { Arc4 dec; - Arc4SetKey(&dec, key, derivedLen); - Arc4Process(&dec, input, input, length); + wc_Arc4SetKey(&dec, key, derivedLen); + wc_Arc4Process(&dec, input, input, length); break; } #endif @@ -1276,7 +1276,7 @@ int RsaPublicKeyDecodeRaw(const byte* n, word32 nSz, const byte* e, word32 eSz, #ifndef NO_DH -int DhKeyDecode(const byte* input, word32* inOutIdx, DhKey* key, word32 inSz) +int wc_DhKeyDecode(const byte* input, word32* inOutIdx, DhKey* key, word32 inSz) { int length; @@ -1289,7 +1289,7 @@ int DhKeyDecode(const byte* input, word32* inOutIdx, DhKey* key, word32 inSz) return 0; } -int DhSetKey(DhKey* key, const byte* p, word32 pSz, const byte* g, word32 gSz) +int wc_DhSetKey(DhKey* key, const byte* p, word32 pSz, const byte* g, word32 gSz) { if (key == NULL || p == NULL || g == NULL || pSz == 0 || gSz == 0) return BAD_FUNC_ARG; @@ -1324,7 +1324,7 @@ int DhSetKey(DhKey* key, const byte* p, word32 pSz, const byte* g, word32 gSz) } -int DhParamsLoad(const byte* input, word32 inSz, byte* p, word32* pInOutSz, +int wc_DhParamsLoad(const byte* input, word32 inSz, byte* p, word32* pInOutSz, byte* g, word32* gInOutSz) { word32 i = 0; @@ -4629,7 +4629,7 @@ static INLINE void FreeTmpRsas(byte** tmps, void* heap) /* Convert RsaKey key to DER format, write to output (inLen), return bytes written */ -int RsaKeyToDer(RsaKey* key, byte* output, word32 inLen) +int wc_RsaKeyToDer(RsaKey* key, byte* output, word32 inLen) { word32 seqSz, verSz, rawLen, intTotalLen = 0; word32 sizes[RSA_INTS]; diff --git a/wolfcrypt/src/hc128.c b/wolfcrypt/src/hc128.c index 6ad27a5e0..5a4e66db0 100644 --- a/wolfcrypt/src/hc128.c +++ b/wolfcrypt/src/hc128.c @@ -23,18 +23,18 @@ #include #endif -#include +#include #ifdef HAVE_HC128 -#include -#include -#include +#include +#include +#include #ifdef NO_INLINE - #include - #include + #include + #include #else - #include + #include #endif diff --git a/wolfssl/wolfcrypt/hc128.h b/wolfssl/wolfcrypt/hc128.h index 766a79b2e..3f4ccb867 100644 --- a/wolfssl/wolfcrypt/hc128.h +++ b/wolfssl/wolfcrypt/hc128.h @@ -2,14 +2,14 @@ * * Copyright (C) 2006-2014 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. @@ -22,10 +22,10 @@ #ifndef NO_HC128 -#ifndef CTAO_CRYPT_HC128_H -#define CTAO_CRYPT_HC128_H +#ifndef WOLF_CRYPT_HC128_H +#define WOLF_CRYPT_HC128_H -#include +#include #ifdef __cplusplus extern "C" { @@ -47,14 +47,14 @@ typedef struct HC128 { } HC128; -CYASSL_API int Hc128_Process(HC128*, byte*, const byte*, word32); -CYASSL_API int Hc128_SetKey(HC128*, const byte* key, const byte* iv); +WOLFSSL_API int wc_Hc128_Process(HC128*, byte*, const byte*, word32); +WOLFSSL_API int wc_Hc128_SetKey(HC128*, const byte* key, const byte* iv); #ifdef __cplusplus } /* extern "C" */ #endif -#endif /* CTAO_CRYPT_HC128_H */ +#endif /* WOLF_CRYPT_HC128_H */ #endif /* HAVE_HC128 */ diff --git a/wolfssl/wolfcrypt/integer.h b/wolfssl/wolfcrypt/integer.h index fbae8139f..d9cd7e648 100644 --- a/wolfssl/wolfcrypt/integer.h +++ b/wolfssl/wolfcrypt/integer.h @@ -301,14 +301,14 @@ int mp_sub_d (mp_int * a, mp_digit b, mp_int * c); int mp_init_multi(mp_int* a, mp_int* b, mp_int* c, mp_int* d, mp_int* e, mp_int* f); -#if defined(HAVE_ECC) || defined(CYASSL_KEY_GEN) +#if defined(HAVE_ECC) || defined(WOLFSSL_KEY_GEN) int mp_sqrmod(mp_int* a, mp_int* b, mp_int* c); #endif #ifdef HAVE_ECC int mp_read_radix(mp_int* a, const char* str, int radix); #endif -#ifdef CYASSL_KEY_GEN +#ifdef WOLFSSL_KEY_GEN int mp_prime_is_prime (mp_int * a, int t, int *result); int mp_gcd (mp_int * a, mp_int * b, mp_int * c); int mp_lcm (mp_int * a, mp_int * b, mp_int * c); diff --git a/wolfssl/wolfcrypt/rsa.h b/wolfssl/wolfcrypt/rsa.h index 782603986..923d93408 100644 --- a/wolfssl/wolfcrypt/rsa.h +++ b/wolfssl/wolfcrypt/rsa.h @@ -64,13 +64,13 @@ WOLFSSL_API int wc_RsaFlattenPublicKey(RsaKey*, byte*, word32*, byte*, word32*); #ifdef WOLFSSL_KEY_GEN - WOLFSSL_API int MakeRsaKey(RsaKey* key, int size, long e, RNG* rng); - WOLFSSL_API int RsaKeyToDer(RsaKey*, byte* output, word32 inLen); + WOLFSSL_API int wc_MakeRsaKey(RsaKey* key, int size, long e, RNG* rng); + WOLFSSL_API int wc_RsaKeyToDer(RsaKey*, byte* output, word32 inLen); #endif #ifdef HAVE_CAVIUM - WOLFSSL_API int RsaInitCavium(RsaKey*, int); - WOLFSSL_API void RsaFreeCavium(RsaKey*); + WOLFSSL_API int wc_RsaInitCavium(RsaKey*, int); + WOLFSSL_API void wc_RsaFreeCavium(RsaKey*); #endif