mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
For PIC32MZ
This commit is contained in:
@@ -1063,29 +1063,28 @@ void bench_eccKeyAgree(void)
|
||||
}
|
||||
|
||||
#elif defined MICROCHIP_PIC32
|
||||
|
||||
#include <peripheral/timer.h>
|
||||
#if defined(CYASSL_MICROCHIP_PIC32MZ)
|
||||
#define CLOCK 8000000.0
|
||||
#else
|
||||
#include <peripheral/timer.h>
|
||||
#define CLOCK 4000000.0
|
||||
#endif
|
||||
|
||||
double current_time(int reset)
|
||||
{
|
||||
/* NOTE: core timer tick rate = 40 Mhz, 1 tick = 25 ns */
|
||||
|
||||
unsigned int ns;
|
||||
|
||||
/* should we reset our timer back to zero? Helps prevent timer
|
||||
rollover */
|
||||
|
||||
if (reset) {
|
||||
WriteCoreTimer(0);
|
||||
}
|
||||
|
||||
/* get timer in ns */
|
||||
ns = ReadCoreTimer() * 25;
|
||||
ns = ReadCoreTimer();
|
||||
|
||||
/* return seconds as a double */
|
||||
return ( ns / 1000000000.0 );
|
||||
return ( ns / CLOCK * 2.0);
|
||||
}
|
||||
|
||||
|
||||
#elif defined CYASSL_MDK_ARM
|
||||
extern double current_time(int reset) ;
|
||||
#else
|
||||
|
@@ -23,6 +23,8 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <cyassl/ctaocrypt/settings.h>
|
||||
|
||||
/* on HPUX 11 you may need to install /dev/random see
|
||||
http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=KRNG11I
|
||||
|
||||
@@ -460,8 +462,10 @@ int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
||||
|
||||
#ifdef MICROCHIP_MPLAB_HARMONY
|
||||
#define PIC32_SEED_COUNT _CP0_GET_COUNT
|
||||
#else
|
||||
#include <peripheral/timer.h>
|
||||
#else
|
||||
#if !defined(CYASSL_MICROCHIP_PIC32MZ)
|
||||
#include <peripheral/timer.h>
|
||||
#endif
|
||||
#define PIC32_SEED_COUNT ReadCoreTimer
|
||||
#endif
|
||||
|
||||
|
@@ -805,8 +805,10 @@ CYASSL_API char* CyaSSL_X509_get_next_altname(CYASSL_X509*);
|
||||
|
||||
CYASSL_API CYASSL_X509*
|
||||
CyaSSL_X509_d2i(CYASSL_X509** x509, const unsigned char* in, int len);
|
||||
#ifndef NO_FILESYSTEM
|
||||
CYASSL_API CYASSL_X509*
|
||||
CyaSSL_X509_d2i_fp(CYASSL_X509** x509, FILE* file);
|
||||
#endif
|
||||
CYASSL_API CYASSL_X509*
|
||||
CyaSSL_X509_load_certificate_file(const char* fname, int format);
|
||||
|
||||
|
28
mcapi/PIC32MZ-serial.h
Normal file
28
mcapi/PIC32MZ-serial.h
Normal file
@@ -0,0 +1,28 @@
|
||||
void _mon_putc(char c);
|
||||
|
||||
static void init_serial() {
|
||||
#ifdef MICROCHIP_PIC32
|
||||
#if defined (__32MZ2048ECH144__) || (__32MZ2048ECM144__)
|
||||
/* Set up PB2 divisor for UART2 */
|
||||
SYSKEY = 0x00000000;
|
||||
SYSKEY = 0xAA996655;
|
||||
SYSKEY = 0x556699AA;
|
||||
PB2DIV = 0x00008018;
|
||||
SYSKEY = 0x33333333;
|
||||
|
||||
/* UART2 Init */
|
||||
// U2BRG = 0x0C;
|
||||
U2BRG = 0x7;
|
||||
ANSELBCLR = 0x4000;
|
||||
ANSELGCLR = 0x0040;
|
||||
RPB14R = 0x02;
|
||||
U2RXR = 0x01;
|
||||
U2MODE = 0x8000;
|
||||
U2STA = 0x400;
|
||||
#elif defined __PIC32MX__
|
||||
SYSTEMConfigPerformance(80000000);
|
||||
DBINIT();
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
@@ -12,7 +12,7 @@
|
||||
<logicalFolder name="SourceFiles"
|
||||
displayName="Source Files"
|
||||
projectFiles="true">
|
||||
<itemPath>../../mcapi/test.c</itemPath>
|
||||
<itemPath>../mcapi_test.c</itemPath>
|
||||
</logicalFolder>
|
||||
<logicalFolder name="ExternalFiles"
|
||||
displayName="Important Files"
|
||||
@@ -20,6 +20,9 @@
|
||||
<itemPath>Makefile</itemPath>
|
||||
</logicalFolder>
|
||||
</logicalFolder>
|
||||
<sourceRootList>
|
||||
<Elem>..</Elem>
|
||||
</sourceRootList>
|
||||
<projectmakefile>Makefile</projectmakefile>
|
||||
<confs>
|
||||
<conf name="default" type="2">
|
||||
@@ -30,8 +33,8 @@
|
||||
<targetPluginBoard></targetPluginBoard>
|
||||
<platformTool>SKDEPIC32PlatformTool</platformTool>
|
||||
<languageToolchain>XC32</languageToolchain>
|
||||
<languageToolchainVersion>1.10</languageToolchainVersion>
|
||||
<platform>4</platform>
|
||||
<languageToolchainVersion>1.30</languageToolchainVersion>
|
||||
<platform>3</platform>
|
||||
</toolsSet>
|
||||
<compileType>
|
||||
<linkerTool>
|
||||
@@ -106,6 +109,7 @@
|
||||
<property key="strict-ansi" value="false"/>
|
||||
<property key="support-ansi" value="false"/>
|
||||
<property key="use-cci" value="false"/>
|
||||
<property key="use-iar" value="false"/>
|
||||
<property key="use-indirect-calls" value="false"/>
|
||||
</C32>
|
||||
<C32-AS>
|
||||
@@ -123,6 +127,7 @@
|
||||
<property key="linker-symbols" value=""/>
|
||||
<property key="map-file" value=""/>
|
||||
<property key="no-startup-files" value="false"/>
|
||||
<property key="oXC32ld-extra-opts" value=""/>
|
||||
<property key="optimization-level" value=""/>
|
||||
<property key="preprocessor-macros" value=""/>
|
||||
<property key="remove-unused-sections" value="false"/>
|
||||
@@ -133,10 +138,59 @@
|
||||
<property key="warn-section-align" value="false"/>
|
||||
</C32-LD>
|
||||
<C32CPP>
|
||||
<property key="additional-warnings" value="false"/>
|
||||
<property key="check-new" value="false"/>
|
||||
<property key="eh-specs" value="true"/>
|
||||
<property key="enable-app-io" value="false"/>
|
||||
<property key="enable-omit-frame-pointer" value="false"/>
|
||||
<property key="enable-symbols" value="true"/>
|
||||
<property key="enable-unroll-loops" value="false"/>
|
||||
<property key="exceptions" value="true"/>
|
||||
<property key="exclude-floating-point" value="false"/>
|
||||
<property key="extra-include-directories" value=""/>
|
||||
<property key="generate-16-bit-code" value="false"/>
|
||||
<property key="isolate-each-function" value="false"/>
|
||||
<property key="make-warnings-into-errors" value="false"/>
|
||||
<property key="optimization-level" value=""/>
|
||||
<property key="place-data-into-section" value="false"/>
|
||||
<property key="post-instruction-scheduling" value="default"/>
|
||||
<property key="pre-instruction-scheduling" value="default"/>
|
||||
<property key="preprocessor-macros" value=""/>
|
||||
<property key="rtti" value="true"/>
|
||||
<property key="strict-ansi" value="false"/>
|
||||
<property key="use-cci" value="false"/>
|
||||
<property key="use-iar" value="false"/>
|
||||
<property key="use-indirect-calls" value="false"/>
|
||||
</C32CPP>
|
||||
<C32Global>
|
||||
<property key="legacy-libc" value="false"/>
|
||||
<property key="save-temps" value="false"/>
|
||||
<property key="wpo-lto" value="false"/>
|
||||
</C32Global>
|
||||
<PKOBSKDEPlatformTool>
|
||||
<property key="AutoSelectMemRanges" value="auto"/>
|
||||
<property key="SecureSegment.SegmentProgramming" value="FullChipProgramming"/>
|
||||
<property key="ToolFirmwareFilePath"
|
||||
value="Press to browse for a specific firmware version"/>
|
||||
<property key="ToolFirmwareOption.UseLatestFirmware" value="true"/>
|
||||
<property key="memories.configurationmemory" value="false"/>
|
||||
<property key="memories.eeprom" value="false"/>
|
||||
<property key="memories.id" value="false"/>
|
||||
<property key="memories.programmemory" value="true"/>
|
||||
<property key="memories.programmemory.end" value="0x1d07ffff"/>
|
||||
<property key="memories.programmemory.start" value="0x1d000000"/>
|
||||
<property key="poweroptions.powerenable" value="false"/>
|
||||
<property key="programoptions.eraseb4program" value="true"/>
|
||||
<property key="programoptions.preserveeeprom" value="false"/>
|
||||
<property key="programoptions.preserveprogramrange" value="false"/>
|
||||
<property key="programoptions.preserveprogramrange.end" value="0x1d0001ff"/>
|
||||
<property key="programoptions.preserveprogramrange.start" value="0x1d000000"/>
|
||||
<property key="programoptions.usehighvoltageonmclr" value="false"/>
|
||||
<property key="programoptions.uselvpprogramming" value="false"/>
|
||||
<property key="voltagevalue" value="3.25"/>
|
||||
</PKOBSKDEPlatformTool>
|
||||
<SKDEPIC32PlatformTool>
|
||||
<property key="whatToProgram" value="all"/>
|
||||
</SKDEPIC32PlatformTool>
|
||||
</conf>
|
||||
</confs>
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>com.microchip.mplab.nbide.embedded.makeproject</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/make-project/1">
|
||||
|
@@ -13,8 +13,8 @@
|
||||
<logicalFolder name="SourceFiles"
|
||||
displayName="Source Files"
|
||||
projectFiles="true">
|
||||
<itemPath>main.c</itemPath>
|
||||
<itemPath>../../ctaocrypt/test/test.c</itemPath>
|
||||
<itemPath>../../mplabx/test_main.c</itemPath>
|
||||
</logicalFolder>
|
||||
<logicalFolder name="ExternalFiles"
|
||||
displayName="Important Files"
|
||||
@@ -22,6 +22,9 @@
|
||||
<itemPath>Makefile</itemPath>
|
||||
</logicalFolder>
|
||||
</logicalFolder>
|
||||
<sourceRootList>
|
||||
<Elem>../../mplabx</Elem>
|
||||
</sourceRootList>
|
||||
<projectmakefile>Makefile</projectmakefile>
|
||||
<confs>
|
||||
<conf name="default" type="2">
|
||||
@@ -32,8 +35,8 @@
|
||||
<targetPluginBoard></targetPluginBoard>
|
||||
<platformTool>SKDEPIC32PlatformTool</platformTool>
|
||||
<languageToolchain>XC32</languageToolchain>
|
||||
<languageToolchainVersion>1.10</languageToolchainVersion>
|
||||
<platform>4</platform>
|
||||
<languageToolchainVersion>1.30</languageToolchainVersion>
|
||||
<platform>3</platform>
|
||||
</toolsSet>
|
||||
<compileType>
|
||||
<linkerTool>
|
||||
@@ -108,6 +111,7 @@
|
||||
<property key="strict-ansi" value="false"/>
|
||||
<property key="support-ansi" value="false"/>
|
||||
<property key="use-cci" value="false"/>
|
||||
<property key="use-iar" value="false"/>
|
||||
<property key="use-indirect-calls" value="false"/>
|
||||
</C32>
|
||||
<C32-AS>
|
||||
@@ -141,6 +145,7 @@
|
||||
<property key="linker-symbols" value=""/>
|
||||
<property key="map-file" value=""/>
|
||||
<property key="no-startup-files" value="false"/>
|
||||
<property key="oXC32ld-extra-opts" value=""/>
|
||||
<property key="optimization-level" value="-Os"/>
|
||||
<property key="preprocessor-macros" value=""/>
|
||||
<property key="remove-unused-sections" value="true"/>
|
||||
@@ -176,7 +181,31 @@
|
||||
</C32CPP>
|
||||
<C32Global>
|
||||
<property key="legacy-libc" value="false"/>
|
||||
<property key="save-temps" value="false"/>
|
||||
<property key="wpo-lto" value="false"/>
|
||||
</C32Global>
|
||||
<PKOBSKDEPlatformTool>
|
||||
<property key="AutoSelectMemRanges" value="auto"/>
|
||||
<property key="SecureSegment.SegmentProgramming" value="FullChipProgramming"/>
|
||||
<property key="ToolFirmwareFilePath"
|
||||
value="Press to browse for a specific firmware version"/>
|
||||
<property key="ToolFirmwareOption.UseLatestFirmware" value="true"/>
|
||||
<property key="memories.configurationmemory" value="false"/>
|
||||
<property key="memories.eeprom" value="false"/>
|
||||
<property key="memories.id" value="false"/>
|
||||
<property key="memories.programmemory" value="true"/>
|
||||
<property key="memories.programmemory.end" value="0x1d07ffff"/>
|
||||
<property key="memories.programmemory.start" value="0x1d000000"/>
|
||||
<property key="poweroptions.powerenable" value="false"/>
|
||||
<property key="programoptions.eraseb4program" value="true"/>
|
||||
<property key="programoptions.preserveeeprom" value="false"/>
|
||||
<property key="programoptions.preserveprogramrange" value="false"/>
|
||||
<property key="programoptions.preserveprogramrange.end" value="0x1d0001ff"/>
|
||||
<property key="programoptions.preserveprogramrange.start" value="0x1d000000"/>
|
||||
<property key="programoptions.usehighvoltageonmclr" value="false"/>
|
||||
<property key="programoptions.uselvpprogramming" value="false"/>
|
||||
<property key="voltagevalue" value="3.25"/>
|
||||
</PKOBSKDEPlatformTool>
|
||||
<SKDEPIC32PlatformTool>
|
||||
<property key="whatToProgram" value="all"/>
|
||||
</SKDEPIC32PlatformTool>
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>com.microchip.mplab.nbide.embedded.makeproject</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/make-project/1">
|
||||
|
@@ -52,6 +52,7 @@
|
||||
<itemPath>../../mcapi/crypto.c</itemPath>
|
||||
<itemPath>../../ctaocrypt/src/compress.c</itemPath>
|
||||
<itemPath>../../ctaocrypt/src/camellia.c</itemPath>
|
||||
<itemPath>../../ctaocrypt/src/port.c</itemPath>
|
||||
</logicalFolder>
|
||||
<logicalFolder name="ExternalFiles"
|
||||
displayName="Important Files"
|
||||
@@ -61,6 +62,7 @@
|
||||
</logicalFolder>
|
||||
<sourceRootList>
|
||||
<Elem>..</Elem>
|
||||
<Elem>../../ctaocrypt/src</Elem>
|
||||
</sourceRootList>
|
||||
<projectmakefile>Makefile</projectmakefile>
|
||||
<confs>
|
||||
@@ -72,8 +74,8 @@
|
||||
<targetPluginBoard></targetPluginBoard>
|
||||
<platformTool>SKDEPIC32PlatformTool</platformTool>
|
||||
<languageToolchain>XC32</languageToolchain>
|
||||
<languageToolchainVersion>1.10</languageToolchainVersion>
|
||||
<platform>4</platform>
|
||||
<languageToolchainVersion>1.30</languageToolchainVersion>
|
||||
<platform>3</platform>
|
||||
</toolsSet>
|
||||
<compileType>
|
||||
<archiverTool>
|
||||
@@ -109,6 +111,7 @@
|
||||
<property key="strict-ansi" value="false"/>
|
||||
<property key="support-ansi" value="false"/>
|
||||
<property key="use-cci" value="false"/>
|
||||
<property key="use-iar" value="false"/>
|
||||
<property key="use-indirect-calls" value="false"/>
|
||||
</C32>
|
||||
<C32-AS>
|
||||
@@ -142,6 +145,7 @@
|
||||
<property key="linker-symbols" value=""/>
|
||||
<property key="map-file" value=""/>
|
||||
<property key="no-startup-files" value="false"/>
|
||||
<property key="oXC32ld-extra-opts" value=""/>
|
||||
<property key="optimization-level" value="-Os"/>
|
||||
<property key="preprocessor-macros" value=""/>
|
||||
<property key="remove-unused-sections" value="true"/>
|
||||
@@ -177,6 +181,8 @@
|
||||
</C32CPP>
|
||||
<C32Global>
|
||||
<property key="legacy-libc" value="false"/>
|
||||
<property key="save-temps" value="false"/>
|
||||
<property key="wpo-lto" value="false"/>
|
||||
</C32Global>
|
||||
<SKDEPIC32PlatformTool>
|
||||
<property key="whatToProgram" value="all"/>
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>com.microchip.mplab.nbide.embedded.makeproject</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/make-project/1">
|
||||
|
@@ -44,16 +44,24 @@
|
||||
#define USE_CERT_BUFFERS_1024
|
||||
#include <cyassl/certs_test.h>
|
||||
|
||||
/* c stdlib headers */
|
||||
#include <stdio.h>
|
||||
|
||||
/* pic32 specific */
|
||||
#ifdef MICROCHIP_PIC32
|
||||
#if defined(CYASSL_MICROCHIP_PIC32MZ)
|
||||
#define MICROCHIP_PIC32
|
||||
#include <xc.h>
|
||||
#pragma config ICESEL = ICS_PGx2
|
||||
/* ICE/ICD Comm Channel Select (Communicate on PGEC2/PGED2) */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PIC32MZ-serial.h"
|
||||
#define SYSTEMConfigPerformance /* void out SYSTEMConfigPerformance(); */
|
||||
#else
|
||||
#define PIC32_STARTER_KIT
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <p32xxxx.h>
|
||||
#include <plib.h>
|
||||
#include <sys/appio.h>
|
||||
#define init_serial() /* void out init_serial() */
|
||||
#endif
|
||||
|
||||
#define OUR_DATA_SIZE 1024
|
||||
static byte ourData[OUR_DATA_SIZE];
|
||||
static byte* key = NULL;
|
||||
@@ -85,10 +93,9 @@ int main(int argc, char** argv)
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
#ifdef MICROCHIP_PIC32
|
||||
init_serial() ; /* initialize PIC32MZ serial I/O */
|
||||
SYSTEMConfigPerformance(80000000);
|
||||
DBINIT();
|
||||
#endif
|
||||
|
||||
/* align key, iv pointers */
|
||||
key = (byte*)XMALLOC(32, NULL, DYNAMIC_TYPE_KEY);
|
@@ -44,8 +44,8 @@
|
||||
<targetPluginBoard></targetPluginBoard>
|
||||
<platformTool>SKDEPIC32PlatformTool</platformTool>
|
||||
<languageToolchain>XC32</languageToolchain>
|
||||
<languageToolchainVersion>1.10</languageToolchainVersion>
|
||||
<platform>4</platform>
|
||||
<languageToolchainVersion>1.30</languageToolchainVersion>
|
||||
<platform>3</platform>
|
||||
</toolsSet>
|
||||
<compileType>
|
||||
<archiverTool>
|
||||
@@ -80,6 +80,7 @@
|
||||
<property key="strict-ansi" value="false"/>
|
||||
<property key="support-ansi" value="false"/>
|
||||
<property key="use-cci" value="false"/>
|
||||
<property key="use-iar" value="false"/>
|
||||
<property key="use-indirect-calls" value="false"/>
|
||||
</C32>
|
||||
<C32-AS>
|
||||
@@ -113,6 +114,7 @@
|
||||
<property key="linker-symbols" value=""/>
|
||||
<property key="map-file" value=""/>
|
||||
<property key="no-startup-files" value="false"/>
|
||||
<property key="oXC32ld-extra-opts" value=""/>
|
||||
<property key="optimization-level" value=""/>
|
||||
<property key="preprocessor-macros" value=""/>
|
||||
<property key="remove-unused-sections" value="false"/>
|
||||
@@ -148,6 +150,8 @@
|
||||
</C32CPP>
|
||||
<C32Global>
|
||||
<property key="legacy-libc" value="false"/>
|
||||
<property key="save-temps" value="false"/>
|
||||
<property key="wpo-lto" value="false"/>
|
||||
</C32Global>
|
||||
<SKDEPIC32PlatformTool>
|
||||
<property key="whatToProgram" value="all"/>
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>com.microchip.mplab.nbide.embedded.makeproject</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/make-project/1">
|
||||
|
10
mplabx/PIC32MZ-Putc.c
Normal file
10
mplabx/PIC32MZ-Putc.c
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
#ifdef MICROCHIP_PIC32
|
||||
#if defined (__32MZ2048ECH144__) || defined (__32MZ2048ECM144__)
|
||||
void _mon_putc (char c)
|
||||
{
|
||||
while (U2STAbits.UTXBF);
|
||||
U2TXREG = c;
|
||||
}
|
||||
#endif
|
||||
#endif
|
28
mplabx/PIC32MZ-serial.h
Normal file
28
mplabx/PIC32MZ-serial.h
Normal file
@@ -0,0 +1,28 @@
|
||||
void _mon_putc(char c);
|
||||
|
||||
static void init_serial() {
|
||||
#ifdef MICROCHIP_PIC32
|
||||
#if defined (__32MZ2048ECH144__) || (__32MZ2048ECM144__)
|
||||
/* Set up PB2 divisor for UART2 */
|
||||
SYSKEY = 0x00000000;
|
||||
SYSKEY = 0xAA996655;
|
||||
SYSKEY = 0x556699AA;
|
||||
PB2DIV = 0x00008018;
|
||||
SYSKEY = 0x33333333;
|
||||
|
||||
/* UART2 Init */
|
||||
// U2BRG = 0x0C;
|
||||
U2BRG = 0x7;
|
||||
ANSELBCLR = 0x4000;
|
||||
ANSELGCLR = 0x0040;
|
||||
RPB14R = 0x02;
|
||||
U2RXR = 0x01;
|
||||
U2MODE = 0x8000;
|
||||
U2STA = 0x400;
|
||||
#elif defined __PIC32MX__
|
||||
SYSTEMConfigPerformance(80000000);
|
||||
DBINIT();
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
/* main.c
|
||||
/* benchmark_main.c
|
||||
*
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
@@ -18,12 +18,20 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#define PIC32_STARTER_KIT
|
||||
|
||||
#include <p32xxxx.h>
|
||||
#include <plib.h>
|
||||
#include <sys/appio.h>
|
||||
#if defined(CYASSL_MICROCHIP_PIC32MZ)
|
||||
#define MICROCHIP_PIC32
|
||||
#include <xc.h>
|
||||
#pragma config ICESEL = ICS_PGx2
|
||||
/* ICE/ICD Comm Channel Select (Communicate on PGEC2/PGED2) */
|
||||
#include "PIC32MZ-serial.h"
|
||||
#define SYSTEMConfigPerformance /* void out SYSTEMConfigPerformance(); */
|
||||
#else
|
||||
#define PIC32_STARTER_KIT
|
||||
#include <p32xxxx.h>
|
||||
#include <plib.h>
|
||||
#include <sys/appio.h>
|
||||
#define init_serial() /* void out init_serial() ; */
|
||||
#endif
|
||||
|
||||
void bench_des(void);
|
||||
void bench_arc4(void);
|
||||
@@ -50,11 +58,14 @@ void bench_eccKeyAgree(void);
|
||||
* Main driver for CTaoCrypt benchmarks.
|
||||
*/
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
SYSTEMConfigPerformance(80000000);
|
||||
|
||||
volatile int i ;
|
||||
int j ;
|
||||
|
||||
init_serial() ; /* initialize PIC32MZ serial I/O */
|
||||
SYSTEMConfigPerformance(80000000);
|
||||
DBINIT();
|
||||
printf("CTaoCrypt Benchmark:\n");
|
||||
|
||||
printf("wolfCrypt Benchmark:\n");
|
||||
|
||||
#ifndef NO_AES
|
||||
bench_aes(0);
|
||||
@@ -110,7 +121,7 @@ int main(int argc, char** argv) {
|
||||
bench_eccKeyGen();
|
||||
bench_eccKeyAgree();
|
||||
#endif
|
||||
|
||||
printf("End of wolfCrypt Benchmark:\n");
|
||||
return 0;
|
||||
}
|
||||
|
@@ -12,8 +12,8 @@
|
||||
<logicalFolder name="SourceFiles"
|
||||
displayName="Source Files"
|
||||
projectFiles="true">
|
||||
<itemPath>main.c</itemPath>
|
||||
<itemPath>../../ctaocrypt/benchmark/benchmark.c</itemPath>
|
||||
<itemPath>../benchmark_main.c</itemPath>
|
||||
</logicalFolder>
|
||||
<logicalFolder name="ExternalFiles"
|
||||
displayName="Important Files"
|
||||
@@ -21,6 +21,9 @@
|
||||
<itemPath>Makefile</itemPath>
|
||||
</logicalFolder>
|
||||
</logicalFolder>
|
||||
<sourceRootList>
|
||||
<Elem>..</Elem>
|
||||
</sourceRootList>
|
||||
<projectmakefile>Makefile</projectmakefile>
|
||||
<confs>
|
||||
<conf name="default" type="2">
|
||||
@@ -31,8 +34,8 @@
|
||||
<targetPluginBoard></targetPluginBoard>
|
||||
<platformTool>SKDEPIC32PlatformTool</platformTool>
|
||||
<languageToolchain>XC32</languageToolchain>
|
||||
<languageToolchainVersion>1.10</languageToolchainVersion>
|
||||
<platform>4</platform>
|
||||
<languageToolchainVersion>1.30</languageToolchainVersion>
|
||||
<platform>3</platform>
|
||||
</toolsSet>
|
||||
<compileType>
|
||||
<linkerTool>
|
||||
@@ -44,8 +47,8 @@
|
||||
AC="true"
|
||||
BL="true"
|
||||
WD="../cyassl.X"
|
||||
BC="${MAKE} -f Makefile CONF=default"
|
||||
DBC="${MAKE} -f Makefile CONF=default TYPE_IMAGE=DEBUG_RUN"
|
||||
BC="${MAKE} MAKE_OPTIONS="" -f Makefile CONF=default"
|
||||
DBC="${MAKE} MAKE_OPTIONS="" -f Makefile CONF=default TYPE_IMAGE=DEBUG_RUN"
|
||||
CC="rm -rf "build/default" "dist/default""
|
||||
OP="dist/default/production/cyassl.X.a"
|
||||
DOP="dist/default/debug/cyassl.X.a"
|
||||
@@ -81,7 +84,7 @@
|
||||
<property key="generate-16-bit-code" value="false"/>
|
||||
<property key="isolate-each-function" value="false"/>
|
||||
<property key="make-warnings-into-errors" value="false"/>
|
||||
<property key="optimization-level" value="-O3"/>
|
||||
<property key="optimization-level" value="-O1"/>
|
||||
<property key="place-data-into-section" value="false"/>
|
||||
<property key="post-instruction-scheduling" value="default"/>
|
||||
<property key="pre-instruction-scheduling" value="default"/>
|
||||
@@ -90,6 +93,7 @@
|
||||
<property key="strict-ansi" value="false"/>
|
||||
<property key="support-ansi" value="false"/>
|
||||
<property key="use-cci" value="false"/>
|
||||
<property key="use-iar" value="false"/>
|
||||
<property key="use-indirect-calls" value="false"/>
|
||||
</C32>
|
||||
<C32-AS>
|
||||
@@ -123,6 +127,7 @@
|
||||
<property key="linker-symbols" value=""/>
|
||||
<property key="map-file" value=""/>
|
||||
<property key="no-startup-files" value="false"/>
|
||||
<property key="oXC32ld-extra-opts" value=""/>
|
||||
<property key="optimization-level" value="-O3"/>
|
||||
<property key="preprocessor-macros" value=""/>
|
||||
<property key="remove-unused-sections" value="false"/>
|
||||
@@ -158,9 +163,10 @@
|
||||
</C32CPP>
|
||||
<C32Global>
|
||||
<property key="legacy-libc" value="false"/>
|
||||
<property key="save-temps" value="false"/>
|
||||
<property key="wpo-lto" value="false"/>
|
||||
</C32Global>
|
||||
<SKDEPIC32PlatformTool>
|
||||
<property key="whatToProgram" value="all"/>
|
||||
</SKDEPIC32PlatformTool>
|
||||
</conf>
|
||||
</confs>
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>com.microchip.mplab.nbide.embedded.makeproject</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/make-project/1">
|
||||
|
@@ -13,8 +13,8 @@
|
||||
<logicalFolder name="SourceFiles"
|
||||
displayName="Source Files"
|
||||
projectFiles="true">
|
||||
<itemPath>main.c</itemPath>
|
||||
<itemPath>../../ctaocrypt/test/test.c</itemPath>
|
||||
<itemPath>../test_main.c</itemPath>
|
||||
</logicalFolder>
|
||||
<logicalFolder name="ExternalFiles"
|
||||
displayName="Important Files"
|
||||
@@ -22,6 +22,9 @@
|
||||
<itemPath>Makefile</itemPath>
|
||||
</logicalFolder>
|
||||
</logicalFolder>
|
||||
<sourceRootList>
|
||||
<Elem>..</Elem>
|
||||
</sourceRootList>
|
||||
<projectmakefile>Makefile</projectmakefile>
|
||||
<confs>
|
||||
<conf name="default" type="2">
|
||||
@@ -32,8 +35,8 @@
|
||||
<targetPluginBoard></targetPluginBoard>
|
||||
<platformTool>SKDEPIC32PlatformTool</platformTool>
|
||||
<languageToolchain>XC32</languageToolchain>
|
||||
<languageToolchainVersion>1.10</languageToolchainVersion>
|
||||
<platform>4</platform>
|
||||
<languageToolchainVersion>1.30</languageToolchainVersion>
|
||||
<platform>3</platform>
|
||||
</toolsSet>
|
||||
<compileType>
|
||||
<linkerTool>
|
||||
@@ -45,8 +48,8 @@
|
||||
AC="true"
|
||||
BL="true"
|
||||
WD="../cyassl.X"
|
||||
BC="${MAKE} -f Makefile CONF=default"
|
||||
DBC="${MAKE} -f Makefile CONF=default TYPE_IMAGE=DEBUG_RUN"
|
||||
BC="${MAKE} MAKE_OPTIONS="" -f Makefile CONF=default"
|
||||
DBC="${MAKE} MAKE_OPTIONS="" -f Makefile CONF=default TYPE_IMAGE=DEBUG_RUN"
|
||||
CC="rm -rf "build/default" "dist/default""
|
||||
OP="dist/default/production/cyassl.X.a"
|
||||
DOP="dist/default/debug/cyassl.X.a"
|
||||
@@ -82,7 +85,7 @@
|
||||
<property key="generate-16-bit-code" value="false"/>
|
||||
<property key="isolate-each-function" value="false"/>
|
||||
<property key="make-warnings-into-errors" value="false"/>
|
||||
<property key="optimization-level" value="-Os"/>
|
||||
<property key="optimization-level" value="-O3"/>
|
||||
<property key="place-data-into-section" value="false"/>
|
||||
<property key="post-instruction-scheduling" value="default"/>
|
||||
<property key="pre-instruction-scheduling" value="default"/>
|
||||
@@ -91,6 +94,7 @@
|
||||
<property key="strict-ansi" value="false"/>
|
||||
<property key="support-ansi" value="false"/>
|
||||
<property key="use-cci" value="false"/>
|
||||
<property key="use-iar" value="false"/>
|
||||
<property key="use-indirect-calls" value="false"/>
|
||||
</C32>
|
||||
<C32-AS>
|
||||
@@ -124,6 +128,7 @@
|
||||
<property key="linker-symbols" value=""/>
|
||||
<property key="map-file" value=""/>
|
||||
<property key="no-startup-files" value="false"/>
|
||||
<property key="oXC32ld-extra-opts" value=""/>
|
||||
<property key="optimization-level" value="-Os"/>
|
||||
<property key="preprocessor-macros" value=""/>
|
||||
<property key="remove-unused-sections" value="true"/>
|
||||
@@ -159,9 +164,10 @@
|
||||
</C32CPP>
|
||||
<C32Global>
|
||||
<property key="legacy-libc" value="false"/>
|
||||
<property key="save-temps" value="false"/>
|
||||
<property key="wpo-lto" value="false"/>
|
||||
</C32Global>
|
||||
<SKDEPIC32PlatformTool>
|
||||
<property key="whatToProgram" value="all"/>
|
||||
</SKDEPIC32PlatformTool>
|
||||
</conf>
|
||||
</confs>
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>com.microchip.mplab.nbide.embedded.makeproject</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/make-project/1">
|
||||
|
@@ -49,6 +49,7 @@
|
||||
<itemPath>../../ctaocrypt/src/sha256.c</itemPath>
|
||||
<itemPath>../../ctaocrypt/src/sha512.c</itemPath>
|
||||
<itemPath>../../ctaocrypt/src/tfm.c</itemPath>
|
||||
<itemPath>../../ctaocrypt/src/port.c</itemPath>
|
||||
</logicalFolder>
|
||||
<logicalFolder name="ExternalFiles"
|
||||
displayName="Important Files"
|
||||
@@ -58,6 +59,8 @@
|
||||
</logicalFolder>
|
||||
<sourceRootList>
|
||||
<Elem>..</Elem>
|
||||
<Elem>../../cyassl/ctaocrypt</Elem>
|
||||
<Elem>../../ctaocrypt/src</Elem>
|
||||
</sourceRootList>
|
||||
<projectmakefile>Makefile</projectmakefile>
|
||||
<confs>
|
||||
@@ -69,8 +72,8 @@
|
||||
<targetPluginBoard></targetPluginBoard>
|
||||
<platformTool>SKDEPIC32PlatformTool</platformTool>
|
||||
<languageToolchain>XC32</languageToolchain>
|
||||
<languageToolchainVersion>1.10</languageToolchainVersion>
|
||||
<platform>4</platform>
|
||||
<languageToolchainVersion>1.30</languageToolchainVersion>
|
||||
<platform>3</platform>
|
||||
</toolsSet>
|
||||
<compileType>
|
||||
<archiverTool>
|
||||
@@ -92,11 +95,11 @@
|
||||
<property key="enable-symbols" value="false"/>
|
||||
<property key="enable-unroll-loops" value="false"/>
|
||||
<property key="exclude-floating-point" value="false"/>
|
||||
<property key="extra-include-directories" value="../../"/>
|
||||
<property key="extra-include-directories" value="../../;..\"/>
|
||||
<property key="generate-16-bit-code" value="false"/>
|
||||
<property key="isolate-each-function" value="false"/>
|
||||
<property key="make-warnings-into-errors" value="false"/>
|
||||
<property key="optimization-level" value="-Os"/>
|
||||
<property key="optimization-level" value="-O3"/>
|
||||
<property key="place-data-into-section" value="false"/>
|
||||
<property key="post-instruction-scheduling" value="default"/>
|
||||
<property key="pre-instruction-scheduling" value="default"/>
|
||||
@@ -105,6 +108,7 @@
|
||||
<property key="strict-ansi" value="false"/>
|
||||
<property key="support-ansi" value="false"/>
|
||||
<property key="use-cci" value="false"/>
|
||||
<property key="use-iar" value="false"/>
|
||||
<property key="use-indirect-calls" value="false"/>
|
||||
</C32>
|
||||
<C32-AS>
|
||||
@@ -138,6 +142,7 @@
|
||||
<property key="linker-symbols" value=""/>
|
||||
<property key="map-file" value=""/>
|
||||
<property key="no-startup-files" value="false"/>
|
||||
<property key="oXC32ld-extra-opts" value=""/>
|
||||
<property key="optimization-level" value="-Os"/>
|
||||
<property key="preprocessor-macros" value=""/>
|
||||
<property key="remove-unused-sections" value="true"/>
|
||||
@@ -173,6 +178,8 @@
|
||||
</C32CPP>
|
||||
<C32Global>
|
||||
<property key="legacy-libc" value="false"/>
|
||||
<property key="save-temps" value="false"/>
|
||||
<property key="wpo-lto" value="false"/>
|
||||
</C32Global>
|
||||
<SKDEPIC32PlatformTool>
|
||||
<property key="whatToProgram" value="all"/>
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>com.microchip.mplab.nbide.embedded.makeproject</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/make-project/1">
|
||||
|
@@ -19,13 +19,24 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#define PIC32_STARTER_KIT
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <p32xxxx.h>
|
||||
#include <plib.h>
|
||||
#include <sys/appio.h>
|
||||
#if defined(CYASSL_MICROCHIP_PIC32MZ)
|
||||
#define MICROCHIP_PIC32
|
||||
#include <xc.h>
|
||||
#pragma config ICESEL = ICS_PGx2
|
||||
/* ICE/ICD Comm Channel Select (Communicate on PGEC2/PGED2) */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PIC32MZ-serial.h"
|
||||
#define SYSTEMConfigPerformance /* void out SYSTEMConfigPerformance(); */
|
||||
#else
|
||||
#define PIC32_STARTER_KIT
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <p32xxxx.h>
|
||||
#include <plib.h>
|
||||
#include <sys/appio.h>
|
||||
#define init_serial() /* void out init_serial() */
|
||||
#endif
|
||||
|
||||
/* func_args from test.h, so don't have to pull in other junk */
|
||||
typedef struct func_args {
|
||||
@@ -38,12 +49,12 @@ typedef struct func_args {
|
||||
* Main driver for CTaoCrypt tests.
|
||||
*/
|
||||
int main(int argc, char** argv) {
|
||||
int i ;
|
||||
|
||||
init_serial() ; /* initialize PIC32MZ serial I/O */
|
||||
SYSTEMConfigPerformance(80000000);
|
||||
|
||||
DBINIT();
|
||||
printf("CTaoCrypt Test:\n");
|
||||
|
||||
func_args args;
|
||||
|
||||
args.argc = argc;
|
Reference in New Issue
Block a user