clean up comments on c files and fix duplicate in chacah header

This commit is contained in:
Jacob Barthelmeh
2015-01-04 23:26:26 -07:00
parent e6ebbf4fc2
commit 966ca9c97e
7 changed files with 37 additions and 47 deletions

View File

@@ -53,13 +53,13 @@
#include "ntru_crypto.h" #include "ntru_crypto.h"
#endif #endif
//#if defined(WOLFSSL_SHA512) || defined(WOLFSSL_SHA384) #if defined(WOLFSSL_SHA512) || defined(WOLFSSL_SHA384)
// #include <wolfssl/wolfcrypt/sha512.h> #include <wolfssl/wolfcrypt/sha512.h>
//#endif #endif
//#ifndef NO_SHA256 #ifndef NO_SHA256
// #include <wolfssl/wolfcrypt/sha256.h> #include <wolfssl/wolfcrypt/sha256.h>
//#endif #endif
#ifdef HAVE_ECC #ifdef HAVE_ECC
#include <wolfssl/wolfcrypt/ecc.h> #include <wolfssl/wolfcrypt/ecc.h>

View File

@@ -2,14 +2,14 @@
* *
* Copyright (C) 2006-2014 wolfSSL Inc. * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@@ -2,14 +2,14 @@
* *
* Copyright (C) 2006-2014 wolfSSL Inc. * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
@@ -41,18 +41,18 @@
#endif #endif
#ifdef DEBUG_CYASSL #ifdef DEBUG_WOLFSSL
/* Set these to default values initially. */ /* Set these to default values initially. */
static wolfSSL_Logging_cb log_function = 0; static wolfSSL_Logging_cb log_function = 0;
static int loggingEnabled = 0; static int loggingEnabled = 0;
#endif /* DEBUG_CYASSL */ #endif /* DEBUG_WOLFSSL */
int wolfSSL_SetLoggingCb(wolfSSL_Logging_cb f) int wolfSSL_SetLoggingCb(wolfSSL_Logging_cb f)
{ {
#ifdef DEBUG_CYASSL #ifdef DEBUG_WOLFSSL
int res = 0; int res = 0;
if (f) if (f)
@@ -70,7 +70,7 @@ int wolfSSL_SetLoggingCb(wolfSSL_Logging_cb f)
int wolfSSL_Debugging_ON(void) int wolfSSL_Debugging_ON(void)
{ {
#ifdef DEBUG_CYASSL #ifdef DEBUG_WOLFSSL
loggingEnabled = 1; loggingEnabled = 1;
return 0; return 0;
#else #else
@@ -81,13 +81,13 @@ int wolfSSL_Debugging_ON(void)
void wolfSSL_Debugging_OFF(void) void wolfSSL_Debugging_OFF(void)
{ {
#ifdef DEBUG_CYASSL #ifdef DEBUG_WOLFSSL
loggingEnabled = 0; loggingEnabled = 0;
#endif #endif
} }
#ifdef DEBUG_CYASSL #ifdef DEBUG_WOLFSSL
#ifdef FREESCALE_MQX #ifdef FREESCALE_MQX
#include <fio.h> #include <fio.h>
@@ -99,7 +99,7 @@ void wolfSSL_Debugging_OFF(void)
int dc_log_printf(char*, ...); int dc_log_printf(char*, ...);
#endif #endif
static void cyassl_log(const int logLevel, const char *const logMessage) static void wolfssl_log(const int logLevel, const char *const logMessage)
{ {
if (log_function) if (log_function)
log_function(logLevel, logMessage); log_function(logLevel, logMessage);
@@ -111,7 +111,7 @@ static void cyassl_log(const int logLevel, const char *const logMessage)
#if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED) #if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
NetSecure_TraceOut((CPU_CHAR *)logMessage); NetSecure_TraceOut((CPU_CHAR *)logMessage);
#endif #endif
#elif defined(CYASSL_MDK_ARM) #elif defined(WOLFSSL_MDK_ARM)
fflush(stdout) ; fflush(stdout) ;
printf("%s\n", logMessage); printf("%s\n", logMessage);
fflush(stdout) ; fflush(stdout) ;
@@ -126,7 +126,7 @@ static void cyassl_log(const int logLevel, const char *const logMessage)
void WOLFSSL_MSG(const char* msg) void WOLFSSL_MSG(const char* msg)
{ {
if (loggingEnabled) if (loggingEnabled)
cyassl_log(INFO_LOG , msg); wolfssl_log(INFO_LOG , msg);
} }
@@ -135,7 +135,7 @@ void WOLFSSL_ENTER(const char* msg)
if (loggingEnabled) { if (loggingEnabled) {
char buffer[80]; char buffer[80];
sprintf(buffer, "wolfSSL Entering %s", msg); sprintf(buffer, "wolfSSL Entering %s", msg);
cyassl_log(ENTER_LOG , buffer); wolfssl_log(ENTER_LOG , buffer);
} }
} }
@@ -145,7 +145,7 @@ void WOLFSSL_LEAVE(const char* msg, int ret)
if (loggingEnabled) { if (loggingEnabled) {
char buffer[80]; char buffer[80];
sprintf(buffer, "wolfSSL Leaving %s, return %d", msg, ret); sprintf(buffer, "wolfSSL Leaving %s, return %d", msg, ret);
cyassl_log(LEAVE_LOG , buffer); wolfssl_log(LEAVE_LOG , buffer);
} }
} }
@@ -155,7 +155,7 @@ void WOLFSSL_ERROR(int error)
if (loggingEnabled) { if (loggingEnabled) {
char buffer[80]; char buffer[80];
sprintf(buffer, "wolfSSL error occured, error = %d", error); sprintf(buffer, "wolfSSL error occured, error = %d", error);
cyassl_log(ERROR_LOG , buffer); wolfssl_log(ERROR_LOG , buffer);
} }
} }

View File

@@ -37,10 +37,6 @@ typedef struct ChaCha {
word32 X[16]; /* state of cipher */ word32 X[16]; /* state of cipher */
} ChaCha; } ChaCha;
WOLFSSL_API int wc_Chacha_Process(ChaCha* ctx, byte* cipher, const byte* plain,
word32 msglen);
WOLFSSL_API int wc_Chacha_SetKey(ChaCha* ctx, const byte* key, word32 keySz);
/** /**
* IV(nonce) changes with each record * IV(nonce) changes with each record
* counter is for what value the block counter should start ... usually 0 * counter is for what value the block counter should start ... usually 0
@@ -51,12 +47,6 @@ WOLFSSL_API int wc_Chacha_Process(ChaCha* ctx, byte* cipher, const byte* plain,
word32 msglen); word32 msglen);
WOLFSSL_API int wc_Chacha_SetKey(ChaCha* ctx, const byte* key, word32 keySz); WOLFSSL_API int wc_Chacha_SetKey(ChaCha* ctx, const byte* key, word32 keySz);
/**
* IV(nonce) changes with each record
* counter is for what value the block counter should start ... usually 0
*/
WOLFSSL_API int wc_Chacha_SetIV(ChaCha* ctx, const byte* inIv, word32 counter);
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */
#endif #endif