mirror of https://github.com/wolfSSL/wolfssl.git
going through wolfcrypt
parent
7e9c8028b2
commit
02f16b9232
|
@ -3201,7 +3201,7 @@ static void GHASH(Aes* aes, const byte* a, word32 aSz,
|
|||
|
||||
XMEMCPY(bigH, aes->H, AES_BLOCK_SIZE);
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
ByteReverseWords(bigH, bigH, AES_BLOCK_SIZE);
|
||||
ByteReverseWords(bigH, bigH, AES_BLOCK_SIZE);
|
||||
#endif
|
||||
|
||||
/* Hash in A, the Additional Authentication Data */
|
||||
|
@ -3412,7 +3412,7 @@ int wc_AesGcmDecrypt(Aes* aes, byte* out, const byte* in, word32 sz,
|
|||
return AES_GCM_AUTH_E;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef WOLFSSL_PIC32MZ_CRYPT
|
||||
if(blocks)
|
||||
wc_AesCrypt(aes, out, in, blocks*AES_BLOCK_SIZE,
|
||||
|
@ -3682,7 +3682,7 @@ int wc_AesCcmDecrypt(Aes* aes, byte* out, const byte* in, word32 inSz,
|
|||
for (i = 0; i < lenSz; i++)
|
||||
B[AES_BLOCK_SIZE - 1 - i] = 0;
|
||||
B[15] = 1;
|
||||
|
||||
|
||||
while (oSz >= AES_BLOCK_SIZE) {
|
||||
#ifdef FREESCALE_MMCAU
|
||||
cau_aes_encrypt(B, key, aes->rounds, A);
|
||||
|
@ -3778,7 +3778,7 @@ int wc_AesInitCavium(Aes* aes, int devId)
|
|||
|
||||
aes->devId = devId;
|
||||
aes->magic = WOLFSSL_AES_CAVIUM_MAGIC;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ static void wc_Arc4CaviumSetKey(Arc4* arc4, const byte* key, word32 length)
|
|||
static void wc_Arc4CaviumProcess(Arc4* arc4, byte* out, const byte* in,
|
||||
word32 length)
|
||||
{
|
||||
cyassl_word offset = 0;
|
||||
wolfssl_word offset = 0;
|
||||
word32 requestId;
|
||||
|
||||
while (length > WOLFSSL_MAX_16BIT) {
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
#include <rtl.h>
|
||||
#endif
|
||||
#undef RNG
|
||||
#include "cyassl_MDK_ARM.h"
|
||||
#include "wolfssl_MDK_ARM.h"
|
||||
#undef RNG
|
||||
#define RNG wolfSSL_RNG /*for avoiding name conflict in "stm32f2xx.h" */
|
||||
#define XTIME(tl) (0)
|
||||
|
@ -3094,34 +3094,34 @@ static int ConfirmSignature(const byte* buf, word32 bufSz,
|
|||
#ifdef WOLFSSL_DEBUG_ENCODING
|
||||
{
|
||||
int x;
|
||||
|
||||
printf("cyassl encodedSig:\n");
|
||||
|
||||
|
||||
printf("wolfssl encodedSig:\n");
|
||||
|
||||
for (x = 0; x < encodedSigSz; x++) {
|
||||
printf("%02x ", encodedSig[x]);
|
||||
if ( (x % 16) == 15)
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
||||
printf("\n");
|
||||
printf("actual digest:\n");
|
||||
|
||||
|
||||
for (x = 0; x < verifySz; x++) {
|
||||
printf("%02x ", out[x]);
|
||||
if ( (x % 16) == 15)
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
#endif /* WOLFSSL_DEBUG_ENCODING */
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
wc_FreeRsaKey(pubKey);
|
||||
|
||||
|
||||
#ifdef WOLFSSL_SMALL_STACK
|
||||
XFREE(pubKey, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
XFREE(plain, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
|
|
|
@ -120,7 +120,7 @@ int wc_Chacha_SetKey(ChaCha* ctx, const byte* key, word32 keySz)
|
|||
|
||||
#ifdef XSTREAM_ALIGN
|
||||
word32 alignKey[keySz / 4];
|
||||
if ((cyassl_word)key % 4) {
|
||||
if ((wolfssl_word)key % 4) {
|
||||
WOLFSSL_MSG("wc_ChachaSetKey unaligned key");
|
||||
XMEMCPY(alignKey, key, sizeof(alignKey));
|
||||
k = (byte*)alignKey;
|
||||
|
|
|
@ -290,7 +290,7 @@ static INLINE int DoKey(HC128* ctx, const byte* key, const byte* iv)
|
|||
int wc_Hc128_SetKey(HC128* ctx, const byte* key, const byte* iv)
|
||||
{
|
||||
#ifdef XSTREAM_ALIGN
|
||||
if ((cyassl_word)key % 4) {
|
||||
if ((wolfssl_word)key % 4) {
|
||||
int alignKey[4];
|
||||
|
||||
/* iv gets aligned in SetIV */
|
||||
|
@ -362,7 +362,7 @@ static INLINE int DoProcess(HC128* ctx, byte* output, const byte* input,
|
|||
int wc_Hc128_Process(HC128* ctx, byte* output, const byte* input, word32 msglen)
|
||||
{
|
||||
#ifdef XSTREAM_ALIGN
|
||||
if ((cyassl_word)input % 4 || (cyassl_word)output % 4) {
|
||||
if ((wolfssl_word)input % 4 || (wolfssl_word)output % 4) {
|
||||
#ifndef NO_WOLFSSL_ALLOC_ALIGN
|
||||
byte* tmp;
|
||||
WOLFSSL_MSG("Hc128Process unaligned");
|
||||
|
|
|
@ -108,7 +108,7 @@ int wc_HmacFinal_fips(Hmac* hmac, byte* out)
|
|||
|
||||
#endif /* HAVE_FIPS */
|
||||
#else
|
||||
#ifdef CYASSL_PIC32MZ_HASH
|
||||
#ifdef WOLFSSL_PIC32MZ_HASH
|
||||
|
||||
#define wc_InitMd5 wc_InitMd5_sw
|
||||
#define wc_Md5Update wc_Md5Update_sw
|
||||
|
@ -203,7 +203,7 @@ int wc_HmacSetKey(Hmac* hmac, int type, const byte* key, word32 length)
|
|||
int ret;
|
||||
|
||||
#ifdef HAVE_CAVIUM
|
||||
if (hmac->magic == CYASSL_HMAC_CAVIUM_MAGIC)
|
||||
if (hmac->magic == WOLFSSL_HMAC_CAVIUM_MAGIC)
|
||||
return HmacCaviumSetKey(hmac, type, key, length);
|
||||
#endif
|
||||
|
||||
|
@ -419,7 +419,7 @@ int wc_HmacUpdate(Hmac* hmac, const byte* msg, word32 length)
|
|||
int ret;
|
||||
|
||||
#ifdef HAVE_CAVIUM
|
||||
if (hmac->magic == CYASSL_HMAC_CAVIUM_MAGIC)
|
||||
if (hmac->magic == WOLFSSL_HMAC_CAVIUM_MAGIC)
|
||||
return HmacCaviumUpdate(hmac, msg, length);
|
||||
#endif
|
||||
|
||||
|
@ -487,7 +487,7 @@ int wc_HmacFinal(Hmac* hmac, byte* hash)
|
|||
int ret;
|
||||
|
||||
#ifdef HAVE_CAVIUM
|
||||
if (hmac->magic == CYASSL_HMAC_CAVIUM_MAGIC)
|
||||
if (hmac->magic == WOLFSSL_HMAC_CAVIUM_MAGIC)
|
||||
return HmacCaviumFinal(hmac, hash);
|
||||
#endif
|
||||
|
||||
|
@ -648,7 +648,7 @@ int wc_HmacInitCavium(Hmac* hmac, int devId)
|
|||
hmac->dataLen = 0;
|
||||
hmac->type = 0;
|
||||
hmac->devId = devId;
|
||||
hmac->magic = CYASSL_HMAC_CAVIUM_MAGIC;
|
||||
hmac->magic = WOLFSSL_HMAC_CAVIUM_MAGIC;
|
||||
hmac->data = NULL; /* buffered input data */
|
||||
|
||||
hmac->innerHashKeyed = 0;
|
||||
|
@ -677,7 +677,7 @@ static void HmacCaviumFinal(Hmac* hmac, byte* hash)
|
|||
if (CspHmac(CAVIUM_BLOCKING, hmac->type, NULL, hmac->keyLen,
|
||||
(byte*)hmac->ipad, hmac->dataLen, hmac->data, hash, &requestId,
|
||||
hmac->devId) != 0) {
|
||||
CYASSL_MSG("Cavium Hmac failed");
|
||||
WOLFSSL_MSG("Cavium Hmac failed");
|
||||
}
|
||||
hmac->innerHashKeyed = 0; /* tell update to start over if used again */
|
||||
}
|
||||
|
@ -689,8 +689,8 @@ static void HmacCaviumUpdate(Hmac* hmac, const byte* msg, word32 length)
|
|||
word32 total;
|
||||
byte* tmp;
|
||||
|
||||
if (length > CYASSL_MAX_16BIT) {
|
||||
CYASSL_MSG("Too big msg for cavium hmac");
|
||||
if (length > WOLFSSL_MAX_16BIT) {
|
||||
WOLFSSL_MSG("Too big msg for cavium hmac");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -700,14 +700,14 @@ static void HmacCaviumUpdate(Hmac* hmac, const byte* msg, word32 length)
|
|||
}
|
||||
|
||||
total = add + hmac->dataLen;
|
||||
if (total > CYASSL_MAX_16BIT) {
|
||||
CYASSL_MSG("Too big msg for cavium hmac");
|
||||
if (total > WOLFSSL_MAX_16BIT) {
|
||||
WOLFSSL_MSG("Too big msg for cavium hmac");
|
||||
return;
|
||||
}
|
||||
|
||||
tmp = XMALLOC(hmac->dataLen + add, NULL,DYNAMIC_TYPE_CAVIUM_TMP);
|
||||
if (tmp == NULL) {
|
||||
CYASSL_MSG("Out of memory for cavium update");
|
||||
WOLFSSL_MSG("Out of memory for cavium update");
|
||||
return;
|
||||
}
|
||||
if (hmac->dataLen)
|
||||
|
@ -731,7 +731,7 @@ static void HmacCaviumSetKey(Hmac* hmac, int type, const byte* key,
|
|||
else if (type == SHA256)
|
||||
hmac->type = SHA256_TYPE;
|
||||
else {
|
||||
CYASSL_MSG("unsupported cavium hmac type");
|
||||
WOLFSSL_MSG("unsupported cavium hmac type");
|
||||
}
|
||||
|
||||
hmac->innerHashKeyed = 0; /* should we key Startup flag */
|
||||
|
@ -785,13 +785,13 @@ static INLINE int GetHashSizeByType(int type)
|
|||
break;
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_SHA384
|
||||
#ifdef WOLFSSL_SHA384
|
||||
case SHA384:
|
||||
return SHA384_DIGEST_SIZE;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_SHA512
|
||||
#ifdef WOLFSSL_SHA512
|
||||
case SHA512:
|
||||
return SHA512_DIGEST_SIZE;
|
||||
break;
|
||||
|
@ -817,7 +817,7 @@ int wc_HKDF(int type, const byte* inKey, word32 inKeySz,
|
|||
byte* out, word32 outSz)
|
||||
{
|
||||
Hmac myHmac;
|
||||
#ifdef CYASSL_SMALL_STACK
|
||||
#ifdef WOLFSSL_SMALL_STACK
|
||||
byte* tmp;
|
||||
byte* prk;
|
||||
#else
|
||||
|
@ -833,7 +833,7 @@ int wc_HKDF(int type, const byte* inKey, word32 inKeySz,
|
|||
if (hashSz < 0)
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
#ifdef CYASSL_SMALL_STACK
|
||||
#ifdef WOLFSSL_SMALL_STACK
|
||||
tmp = (byte*)XMALLOC(MAX_DIGEST_SIZE, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
if (tmp == NULL)
|
||||
return MEMORY_E;
|
||||
|
@ -891,7 +891,7 @@ int wc_HKDF(int type, const byte* inKey, word32 inKeySz,
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef CYASSL_SMALL_STACK
|
||||
#ifdef WOLFSSL_SMALL_STACK
|
||||
XFREE(tmp, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
XFREE(prk, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
#endif
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#if !defined(NO_MD5)
|
||||
|
||||
#ifdef CYASSL_PIC32MZ_HASH
|
||||
#ifdef WOLFSSL_PIC32MZ_HASH
|
||||
#define wc_InitMd5 InitMd5_sw
|
||||
#define wc_Md5Update Md5Update_sw
|
||||
#define wc_Md5Final Md5Final_sw
|
||||
|
@ -365,13 +365,13 @@ void wc_Md5Final(Md5* md5, byte* hash)
|
|||
|
||||
int wc_Md5Hash(const byte* data, word32 len, byte* hash)
|
||||
{
|
||||
#ifdef CYASSL_SMALL_STACK
|
||||
#ifdef WOLFSSL_SMALL_STACK
|
||||
Md5* md5;
|
||||
#else
|
||||
Md5 md5[1];
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_SMALL_STACK
|
||||
#ifdef WOLFSSL_SMALL_STACK
|
||||
md5 = (Md5*)XMALLOC(sizeof(Md5), NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
if (md5 == NULL)
|
||||
return MEMORY_E;
|
||||
|
@ -381,7 +381,7 @@ int wc_Md5Hash(const byte* data, word32 len, byte* hash)
|
|||
wc_Md5Update(md5, data, len);
|
||||
wc_Md5Final(md5, hash);
|
||||
|
||||
#ifdef CYASSL_SMALL_STACK
|
||||
#ifdef WOLFSSL_SMALL_STACK
|
||||
XFREE(md5, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ void* wolfSSL_Malloc(size_t size)
|
|||
else
|
||||
res = malloc(size);
|
||||
|
||||
#ifdef CYASSL_MALLOC_CHECK
|
||||
#ifdef WOLFSSL_MALLOC_CHECK
|
||||
if (res == NULL)
|
||||
puts("wolfSSL_malloc failed");
|
||||
#endif
|
||||
|
@ -173,7 +173,7 @@ void* XREALLOC(void *p, size_t n, void* heap, int type)
|
|||
}
|
||||
|
||||
|
||||
/* unit api calls, let's make sure visible with CYASSL_API */
|
||||
/* unit api calls, let's make sure visible with WOLFSSL_API */
|
||||
WOLFSSL_API void XFREE(void *p, void* heap, int type)
|
||||
{
|
||||
(void)heap;
|
||||
|
|
|
@ -202,7 +202,7 @@ static INLINE int DoKey(Rabbit* ctx, const byte* key, const byte* iv)
|
|||
int wc_RabbitSetKey(Rabbit* ctx, const byte* key, const byte* iv)
|
||||
{
|
||||
#ifdef XSTREAM_ALIGN
|
||||
if ((cyassl_word)key % 4) {
|
||||
if ((wolfssl_word)key % 4) {
|
||||
int alignKey[4];
|
||||
|
||||
/* iv aligned in SetIV */
|
||||
|
@ -282,7 +282,7 @@ static INLINE int DoProcess(Rabbit* ctx, byte* output, const byte* input,
|
|||
int wc_RabbitProcess(Rabbit* ctx, byte* output, const byte* input, word32 msglen)
|
||||
{
|
||||
#ifdef XSTREAM_ALIGN
|
||||
if ((cyassl_word)input % 4 || (cyassl_word)output % 4) {
|
||||
if ((wolfssl_word)input % 4 || (wolfssl_word)output % 4) {
|
||||
#ifndef NO_WOLFSSL_ALLOC_ALIGN
|
||||
byte* tmp;
|
||||
WOLFSSL_MSG("wc_RabbitProcess unaligned");
|
||||
|
|
|
@ -672,7 +672,7 @@ int wc_RNG_GenerateByte(RNG* rng, byte* b)
|
|||
|
||||
#ifdef HAVE_CAVIUM
|
||||
|
||||
#include <cyassl/ctaocrypt/logging.h>
|
||||
#include <wolfssl/ctaocrypt/logging.h>
|
||||
#include "cavium_common.h"
|
||||
|
||||
/* Initiliaze RNG for use with Nitrox device */
|
||||
|
@ -690,7 +690,7 @@ int wc_InitRngCavium(RNG* rng, int devId)
|
|||
|
||||
static void CaviumRNG_GenerateBlock(RNG* rng, byte* output, word32 sz)
|
||||
{
|
||||
cyassl_word offset = 0;
|
||||
wolfssl_word offset = 0;
|
||||
word32 requestId;
|
||||
|
||||
while (sz > WOLFSSL_MAX_16BIT) {
|
||||
|
|
|
@ -201,7 +201,7 @@ int UnLockMutex(wolfSSL_Mutex *m)
|
|||
|
||||
int InitMutex(wolfSSL_Mutex* m)
|
||||
{
|
||||
if (tx_mutex_create(m, "CyaSSL Mutex", TX_NO_INHERIT) == 0)
|
||||
if (tx_mutex_create(m, "wolfSSL Mutex", TX_NO_INHERIT) == 0)
|
||||
return 0;
|
||||
else
|
||||
return BAD_MUTEX_E;
|
||||
|
|
Loading…
Reference in New Issue