Skip to content

Commit

Permalink
Merge pull request #6650 from DimitriPapadopoulos/spaces
Browse files Browse the repository at this point in the history
Fix tab/space inconsistencies
  • Loading branch information
JacobBarthelmeh authored Jul 26, 2023
2 parents 3e5e16f + 4ff99a6 commit 8d77090
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 44 deletions.
2 changes: 1 addition & 1 deletion IDE/HEXAGON/ecc-verify-benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ static int hash_firmware_verify_dsp(int numThreads, int domain)
ret = wolfSSL_open(sp_URI_value, &(handle[i]));
if (ret != 0) {
printf("unable to open CDSP? retVal = %d\n", ret);
return -1;
return -1;
}
wc_ecc_set_handle(&(eccKey[i]), handle[i]);
}
Expand Down
28 changes: 12 additions & 16 deletions IDE/MDK-ARM/LPC43xx/time-LCP43xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@

static void init_RTC()
{
/* Enable GPIO register interface clock */
LPC_CCU1->CLK_M4_GPIO_CFG |= 1;
while (!(LPC_CCU1->CLK_M4_GPIO_STAT & 1)) ;
/* Enable GPIO register interface clock */
LPC_CCU1->CLK_M4_GPIO_CFG |= 1;
while (!(LPC_CCU1->CLK_M4_GPIO_STAT & 1)) ;

/* RTC Block section ------------------------------------------------------ */
/* Init RTC module */
Expand Down Expand Up @@ -82,7 +82,7 @@ double current_time()


void init_time(void) {
init_RTC() ;
init_RTC() ;
init_TIM() ;
}

Expand All @@ -93,7 +93,7 @@ struct tm *Cyassl_MDK_gmtime(const time_t *c)
static struct tm date ;

RTC_TIME_Type RTCFullTime;
RTC_GetFullTime (LPC_RTC, &RTCFullTime);
RTC_GetFullTime (LPC_RTC, &RTCFullTime);

date.tm_year = RTCFullTime.YEAR + 100 ;
date.tm_mon = RTCFullTime.MONTH - 1 ;
Expand All @@ -104,7 +104,7 @@ struct tm *Cyassl_MDK_gmtime(const time_t *c)

#if defined(DEBUG_CYASSL)
{
extern void CYASSL_MSG(char *msg) ;
extern void CYASSL_MSG(char *msg) ;
char msg[100] ;
sprintf(msg, "Debug::Cyassl_KEIL_gmtime(DATE=/%4d/%02d/%02d TIME=%02d:%02d:%02d)\n",
RTCFullTime.YEAR+2000, RTCFullTime.MONTH, RTCFullTime.DOM,
Expand All @@ -127,14 +127,14 @@ typedef struct func_args {
void time_main(void *args)
{
char * datetime ;
int year ;
int year ;
RTC_TIME_Type RTCFullTime;

if( args == NULL || ((func_args *)args)->argc == 1) {
RTC_GetFullTime (LPC_RTC, &RTCFullTime);
RTC_GetFullTime (LPC_RTC, &RTCFullTime);
printf("Date: %d/%d/%d, Time: %02d:%02d:%02d\n",
RTCFullTime.MONTH, RTCFullTime.DOM, RTCFullTime.YEAR+2000,
RTCFullTime.HOUR, RTCFullTime.MIN, RTCFullTime.SEC) ;
RTCFullTime.MONTH, RTCFullTime.DOM, RTCFullTime.YEAR+2000,
RTCFullTime.HOUR, RTCFullTime.MIN, RTCFullTime.SEC) ;
} else if(((func_args *)args)->argc == 3 &&
((func_args *)args)->argv[1][0] == '-' &&
((func_args *)args)->argv[1][1] == 'd' ) {
Expand All @@ -143,13 +143,13 @@ void time_main(void *args)
sscanf(datetime, "%d/%d/%d",
(int *)&RTCFullTime.MONTH, (int *)&RTCFullTime.DOM, &year) ;
RTCFullTime.YEAR = year - 2000 ;
RTC_SetTime (LPC_RTC, RTC_TIMETYPE_MONTH, RTCFullTime.MONTH);
RTC_SetTime (LPC_RTC, RTC_TIMETYPE_MONTH, RTCFullTime.MONTH);
RTC_SetTime (LPC_RTC, RTC_TIMETYPE_YEAR, RTCFullTime.YEAR);
RTC_SetTime (LPC_RTC, RTC_TIMETYPE_DAYOFMONTH, RTCFullTime.DOM);
} else if(((func_args *)args)->argc == 3 &&
((func_args *)args)->argv[1][0] == '-' &&
((func_args *)args)->argv[1][1] == 't' ) {
RTC_GetFullTime (LPC_RTC, &RTCFullTime);
RTC_GetFullTime (LPC_RTC, &RTCFullTime);
datetime = ((func_args *)args)->argv[2];
sscanf(datetime, "%d:%d:%d",
(int *)&RTCFullTime.HOUR,
Expand All @@ -161,7 +161,3 @@ void time_main(void *args)
RTC_SetTime (LPC_RTC, RTC_TIMETYPE_HOUR, RTCFullTime.HOUR);
} else printf("Invalid argument\n") ;
}




6 changes: 3 additions & 3 deletions IDE/MDK5-ARM/Projects/wolfSSL-Full/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ int main()
{
void *arg = NULL;

SystemClock_Config();
#if !defined(NO_FILESYSTEM)
SystemClock_Config();
#if !defined(NO_FILESYSTEM)
init_filesystem ();
#endif
#endif

netInitialize();
osDelay(300);
Expand Down
18 changes: 9 additions & 9 deletions IDE/MDK5-ARM/Projects/wolfSSL-Full/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ static wolfSSL_Mutex command_mutex ;
#endif

void exit_command(void) {
printf("Command Aborted\n") ;
printf("Command Aborted\n") ;
#ifdef WOLFSSL_CMSIS_RTOS
osThreadTerminate(osThreadGetId()) ;
#else
Expand Down Expand Up @@ -617,7 +617,7 @@ void shell_main(void *arg) {
func_args args ;
int bf_flg ;
#if defined(WOLFSSL_CMSIS_RTOS)
osThreadId cmd ;
osThreadId cmd ;
#endif
i = BackGround ;
/* Dummy for avoiding warning: BackGround is defined but not used. */
Expand All @@ -641,14 +641,14 @@ void shell_main(void *arg) {
os_tsk_pass ();
#else
#if defined(WOLFSSL_CMSIS_RTOS)
wc_UnLockMutex((wolfSSL_Mutex *)&command_mutex) ;
cmd = osThreadCreate (osThread (command_invoke) , &args);
if(cmd == NULL) {
printf("Cannon create command thread\n") ;
}
osThreadYield ();
wc_UnLockMutex((wolfSSL_Mutex *)&command_mutex) ;
cmd = osThreadCreate (osThread (command_invoke) , &args);
if(cmd == NULL) {
printf("Cannon create command thread\n") ;
}
osThreadYield ();
#else
command_invoke(&args) ;
command_invoke(&args) ;
#endif
#endif
#ifdef HAVE_KEIL_RTX
Expand Down
2 changes: 1 addition & 1 deletion IDE/ROWLEY-CROSSWORKS-ARM/arm_startup.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void memcpy32(uint32_t* src, uint32_t* dst_beg, uint32_t* dst_end)
void meminit32(uint32_t* start, uint32_t* end)
{
while (start < end) {
*start++ = 0;
*start++ = 0;
}
}

Expand Down
4 changes: 2 additions & 2 deletions mqx/util_lib/Sources/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ int sdcard_open(MQX_FILE_PTR *com_handle, MQX_FILE_PTR *sdcard_handle,
}

int sdcard_close(MQX_FILE_PTR *sdcard_handle, MQX_FILE_PTR *partman_handle,
MQX_FILE_PTR *filesystem_handle,
char *partman_name, char *filesystem_name)
MQX_FILE_PTR *filesystem_handle,
char *partman_name, char *filesystem_name)
{
_mqx_int error_code;

Expand Down
8 changes: 4 additions & 4 deletions mqx/util_lib/Sources/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#define UTIL_H_

int sdcard_open(MQX_FILE_PTR *com_handle, MQX_FILE_PTR *sdcard_handle,
MQX_FILE_PTR *partman_handle, MQX_FILE_PTR *filesystem_handle,
char *partman_name, char *filesystem_name);
MQX_FILE_PTR *partman_handle, MQX_FILE_PTR *filesystem_handle,
char *partman_name, char *filesystem_name);

int sdcard_close(MQX_FILE_PTR *sdcard_handle, MQX_FILE_PTR *partman_handle,
MQX_FILE_PTR *filesystem_handle,
char *partman_name, char *filesystem_name);
MQX_FILE_PTR *filesystem_handle,
char *partman_name, char *filesystem_name);

#endif /* UTIL_H_ */
2 changes: 1 addition & 1 deletion wolfcrypt/src/port/Renesas/renesas_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ void wc_CryptoCb_CleanupRenesasCmn(int* id)

#endif /* WOLF_CRYPTO_CB */
#endif /* WOLFSSL_RENESAS_SCEPROTECT || WOLFSSL_RENESAS_SCEPROTECT_CRYPTONLY
/* WOLFSSL_RENESAS_TSIP_TLS*/
/* WOLFSSL_RENESAS_TSIP_TLS*/

#if defined(WOLFSSL_RENESAS_SCEPROTECT) || defined(WOLFSSL_RENESAS_TSIP_TLS)

Expand Down
2 changes: 1 addition & 1 deletion wolfcrypt/src/port/kcapi/kcapi_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static int KcapiHashUpdate(wolfssl_KCAPI_Hash* hash, const byte* in, word32 sz)
hash->heap, DYNAMIC_TYPE_TMP_BUFFER);
if (pt == NULL) {
ret = MEMORY_E;
}
}
else {
hash->msg = pt;
}
Expand Down
12 changes: 6 additions & 6 deletions wolfcrypt/src/sp_dsp32.c
Original file line number Diff line number Diff line change
Expand Up @@ -4464,10 +4464,10 @@ int wolfSSL_DSP_ECC_Verify_256(remote_handle64 h, int32 *u1, int hashLen, int32*
u2 = u2d;
tmp = tmpd;

XMEMCPY(u2, r, 40);
XMEMCPY(p2->x, x, 40);
XMEMCPY(p2->y, y, 40);
XMEMCPY(p2->z, z, 40);
XMEMCPY(u2, r, 40);
XMEMCPY(p2->x, x, 40);
XMEMCPY(p2->y, y, 40);
XMEMCPY(p2->z, z, 40);

sp_256_mul_10(s, s, p256_norm_order);
err = sp_256_mod_10(s, s, p256_order);
Expand All @@ -4492,7 +4492,7 @@ int wolfSSL_DSP_ECC_Verify_256(remote_handle64 h, int32 *u1, int hashLen, int32*

/* (r + n*order).z'.z' mod prime == (u1.G + u2.Q)->x' */
/* Reload r and convert to Montgomery form. */
XMEMCPY(u2, r, 40);
XMEMCPY(u2, r, 40);
err = sp_256_mod_mul_norm_10(u2, u2, p256_mod);
}

Expand All @@ -4503,7 +4503,7 @@ int wolfSSL_DSP_ECC_Verify_256(remote_handle64 h, int32 *u1, int hashLen, int32*
*res = (int)(sp_256_cmp_10(p1->x, u1) == 0);
if (*res == 0) {
/* Reload r and add order. */
XMEMCPY(u2, r, 40);
XMEMCPY(u2, r, 40);
carry = sp_256_add_10(u2, u2, p256_order);
/* Carry means result is greater than mod and is not valid. */
if (carry == 0) {
Expand Down

0 comments on commit 8d77090

Please sign in to comment.