forked from wolfSSL/wolfssl
IAR EWARM project: test, benchmark
This commit is contained in:
13
IDE/IAR-EWARM/Projects/CyaSSL-Lib/CyaSSL-Lib.eww
Normal file
13
IDE/IAR-EWARM/Projects/CyaSSL-Lib/CyaSSL-Lib.eww
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
|
|
||||||
|
<workspace>
|
||||||
|
<project>
|
||||||
|
<path>$WS_DIR$\wolfCrypt-benchmark.ewp</path>
|
||||||
|
</project>
|
||||||
|
<project>
|
||||||
|
<path>$WS_DIR$\wolfCrypt-test.ewp</path>
|
||||||
|
</project>
|
||||||
|
<batchBuild/>
|
||||||
|
</workspace>
|
||||||
|
|
||||||
|
|
40
IDE/IAR-EWARM/Projects/CyaSSL-Lib/benchmark-main.c
Normal file
40
IDE/IAR-EWARM/Projects/CyaSSL-Lib/benchmark-main.c
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/* benchmark-main.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||||
|
*
|
||||||
|
* This file is part of CyaSSL.
|
||||||
|
*
|
||||||
|
* CyaSSL 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,
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "stdio.h"
|
||||||
|
|
||||||
|
typedef struct func_args {
|
||||||
|
int argc;
|
||||||
|
char** argv;
|
||||||
|
int return_code;
|
||||||
|
} func_args;
|
||||||
|
|
||||||
|
func_args args = { 0 } ;
|
||||||
|
|
||||||
|
extern int benchmark_test(void *args) ;
|
||||||
|
|
||||||
|
main(void) {
|
||||||
|
benchmark_test(&args) ;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
34
IDE/IAR-EWARM/Projects/CyaSSL-Lib/main.c
Normal file
34
IDE/IAR-EWARM/Projects/CyaSSL-Lib/main.c
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/* test.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 2006-2014 wolfSSL Inc.
|
||||||
|
*
|
||||||
|
* This file is part of CyaSSL.
|
||||||
|
*
|
||||||
|
* CyaSSL 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,
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef struct func_args {
|
||||||
|
int argc;
|
||||||
|
char** argv;
|
||||||
|
int return_code;
|
||||||
|
} func_args ;
|
||||||
|
|
||||||
|
func_args args = { 0 } ;
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
ctaocrypt_test(&args);
|
||||||
|
return 0;
|
||||||
|
}
|
36
IDE/IAR-EWARM/Projects/CyaSSL-Lib/test-main.c
Normal file
36
IDE/IAR-EWARM/Projects/CyaSSL-Lib/test-main.c
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
/* test-main.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||||
|
*
|
||||||
|
* This file is part of CyaSSL.
|
||||||
|
*
|
||||||
|
* CyaSSL 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,
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct func_args {
|
||||||
|
int argc;
|
||||||
|
char** argv;
|
||||||
|
int return_code;
|
||||||
|
} func_args;
|
||||||
|
|
||||||
|
func_args args = { 0 } ;
|
||||||
|
|
||||||
|
extern int ctaocrypt_test(void *args) ;
|
||||||
|
|
||||||
|
main(void) {
|
||||||
|
ctaocrypt_test(&args) ;
|
||||||
|
return 0;
|
||||||
|
}
|
2601
IDE/IAR-EWARM/Projects/CyaSSL-Lib/wolfCrypt-benchmark.ewd
Normal file
2601
IDE/IAR-EWARM/Projects/CyaSSL-Lib/wolfCrypt-benchmark.ewd
Normal file
File diff suppressed because it is too large
Load Diff
1877
IDE/IAR-EWARM/Projects/CyaSSL-Lib/wolfCrypt-benchmark.ewp
Normal file
1877
IDE/IAR-EWARM/Projects/CyaSSL-Lib/wolfCrypt-benchmark.ewp
Normal file
File diff suppressed because it is too large
Load Diff
2601
IDE/IAR-EWARM/Projects/CyaSSL-Lib/wolfCrypt-test.ewd
Normal file
2601
IDE/IAR-EWARM/Projects/CyaSSL-Lib/wolfCrypt-test.ewd
Normal file
File diff suppressed because it is too large
Load Diff
1877
IDE/IAR-EWARM/Projects/CyaSSL-Lib/wolfCrypt-test.ewp
Normal file
1877
IDE/IAR-EWARM/Projects/CyaSSL-Lib/wolfCrypt-test.ewp
Normal file
File diff suppressed because it is too large
Load Diff
31
IDE/IAR-EWARM/Projects/CyaSSL-Lib/wolfCrypt-test.icf
Normal file
31
IDE/IAR-EWARM/Projects/CyaSSL-Lib/wolfCrypt-test.icf
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/*###ICF### Section handled by ICF editor, don't touch! ****/
|
||||||
|
/*-Editor annotation file-*/
|
||||||
|
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
|
||||||
|
/*-Specials-*/
|
||||||
|
define symbol __ICFEDIT_intvec_start__ = 0x0;
|
||||||
|
/*-Memory Regions-*/
|
||||||
|
define symbol __ICFEDIT_region_ROM_start__ = 0x0;
|
||||||
|
define symbol __ICFEDIT_region_ROM_end__ = 0x000FFFFF;
|
||||||
|
define symbol __ICFEDIT_region_RAM_start__ = 0x1FFF0000;
|
||||||
|
define symbol __ICFEDIT_region_RAM_end__ = 0x2000FFFF;
|
||||||
|
/*-Sizes-*/
|
||||||
|
define symbol __ICFEDIT_size_cstack__ = 0x2000;
|
||||||
|
define symbol __ICFEDIT_size_heap__ = 0x4000;
|
||||||
|
/**** End of ICF editor section. ###ICF###*/
|
||||||
|
|
||||||
|
|
||||||
|
define memory mem with size = 4G;
|
||||||
|
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
|
||||||
|
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
|
||||||
|
|
||||||
|
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
|
||||||
|
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
|
||||||
|
|
||||||
|
initialize by copy { readwrite };
|
||||||
|
do not initialize { section .noinit };
|
||||||
|
|
||||||
|
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
|
||||||
|
|
||||||
|
place in ROM_region { readonly };
|
||||||
|
place in RAM_region { readwrite,
|
||||||
|
block CSTACK, block HEAP };
|
@ -752,7 +752,7 @@ static void set_Bench_RSA_File(char * cert) { certRSAname = cert ; }
|
|||||||
#elif defined(CYASSL_MDK_SHELL)
|
#elif defined(CYASSL_MDK_SHELL)
|
||||||
/* nothing */
|
/* nothing */
|
||||||
#else
|
#else
|
||||||
static const char *certRSAname = "certs/rsa2048.der" ;
|
/* nothing */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void bench_rsa(void)
|
void bench_rsa(void)
|
||||||
@ -857,12 +857,15 @@ void set_Bench_DH_File(char * cert) { certDHname = cert ; }
|
|||||||
#elif defined(CYASSL_MDK_SHELL)
|
#elif defined(CYASSL_MDK_SHELL)
|
||||||
/* nothing */
|
/* nothing */
|
||||||
#else
|
#else
|
||||||
static const char *certDHname = "certs/dh2048.der" ;
|
/* nothing */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void bench_dh(void)
|
void bench_dh(void)
|
||||||
{
|
{
|
||||||
int i, ret;
|
#if !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048)
|
||||||
|
int ret;
|
||||||
|
#endif
|
||||||
|
int i ;
|
||||||
byte tmp[1024];
|
byte tmp[1024];
|
||||||
size_t bytes;
|
size_t bytes;
|
||||||
word32 idx = 0, pubSz, privSz = 0, pubSz2, privSz2, agreeSz;
|
word32 idx = 0, pubSz, privSz = 0, pubSz2, privSz2, agreeSz;
|
||||||
@ -1105,7 +1108,6 @@ void bench_eccKeyAgree(void)
|
|||||||
}
|
}
|
||||||
#endif /* HAVE_ECC */
|
#endif /* HAVE_ECC */
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
@ -1153,10 +1155,10 @@ void bench_eccKeyAgree(void)
|
|||||||
return ( ns / CLOCK * 2.0);
|
return ( ns / CLOCK * 2.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined CYASSL_MDK_ARM
|
#elif defined(CYASSL_IAR_ARM) || defined (CYASSL_MDK_ARM)
|
||||||
|
#warning "Write your current_time()"
|
||||||
extern double current_time(int reset) ;
|
double current_time(int reset) { return 0.0 ; }
|
||||||
|
|
||||||
#elif defined FREERTOS
|
#elif defined FREERTOS
|
||||||
|
|
||||||
double current_time(int reset)
|
double current_time(int reset)
|
||||||
|
@ -84,11 +84,11 @@
|
|||||||
/* Uncomment next line if using QL SEP settings */
|
/* Uncomment next line if using QL SEP settings */
|
||||||
/* #define CYASSL_QL */
|
/* #define CYASSL_QL */
|
||||||
|
|
||||||
/* Uncomment next line if using LwIP native TCP socket settings */
|
|
||||||
/* #define HAVE_LWIP_NATIVE */
|
|
||||||
|
|
||||||
/* Uncomment next line if building for EROAD */
|
/* Uncomment next line if building for EROAD */
|
||||||
/* #define CYASSL_EROAD */
|
/* #define CYASSL_EROAD */
|
||||||
|
|
||||||
|
/* Uncomment next line if building for IAR EWARM */
|
||||||
|
/* #define CYASSL_IAR_ARM */
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/visibility.h>
|
#include <cyassl/ctaocrypt/visibility.h>
|
||||||
|
|
||||||
@ -134,7 +134,14 @@
|
|||||||
#define CYASSL_USER_IO
|
#define CYASSL_USER_IO
|
||||||
#define NO_FILESYSTEM
|
#define NO_FILESYSTEM
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(CYASSL_IAR_ARM)
|
||||||
|
#define NO_MAIN_DRIVER
|
||||||
|
#define SINGLE_THREADED
|
||||||
|
#define USE_CERT_BUFFERS_1024
|
||||||
|
#define BENCH_EMBEDDED
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef MICROCHIP_PIC32
|
#ifdef MICROCHIP_PIC32
|
||||||
/* #define CYASSL_MICROCHIP_PIC32MZ */
|
/* #define CYASSL_MICROCHIP_PIC32MZ */
|
||||||
#define SIZEOF_LONG_LONG 8
|
#define SIZEOF_LONG_LONG 8
|
||||||
|
Reference in New Issue
Block a user