update Readme, added file header etc

This commit is contained in:
Hideki Miyazaki
2019-08-28 18:48:25 +09:00
parent a292e69d3f
commit cb0184fe98
13 changed files with 155 additions and 76 deletions

View File

@ -73,14 +73,13 @@
#define OPENSSL_EXTRA
#define WOLFSSL_GENSEED_FORTEST /* Wardning: define your own seed gen */
#else
#define NO_DES3
#if defined(WOLFSSL_RENESAS_RX65N)
/* In the case of Static RSA and AES-CBC use */
#define HAVE_AES_CBC
#define WOLFSSL_STATIC_RSA
/* for disabling TSIP CRYPT */
/* #define NO_RENESAS_TSIP_CRYPT */
/* for disabling TSIP TLS COMMON CRYPT */
/* for disabling TSIP CRYPT and TSIP TLS */
/* #define NO_RENESAS_TSIP_CRYPT */
/* for disabling only TSIP TLS-linked Common key encryption method */
/* #define NO_WOLFSSL_RENESAS_TSIP_TLS_SESSION */
#endif
#endif

View File

@ -21,7 +21,7 @@
typedef unsigned long time_t;
#define YEAR 2018
#define YEAR 2019
#define MON 5
static int tick = 0;
@ -36,6 +36,6 @@ int strncasecmp(const char *s1, const char * s2, unsigned int sz)
{
for( ; sz>0; sz--)
if(toupper(s1++) != toupper(s2++))
return 1;
return 1;
return 0;
}

View File

@ -8,6 +8,11 @@ EXTRA_DIST+= IDE/Renesas/e2studio/Projects/wolfssl/.project
EXTRA_DIST+= IDE/Renesas/e2studio/Projects/test/.cproject
EXTRA_DIST+= IDE/Renesas/e2studio/Projects/test/.project
EXTRA_DIST+= IDE/Renesas/e2studio/Projects/test/src/test_main.c
EXTRA_DIST+= IDE/Renesas/e2studio/Projects/test/src/key_data.c
EXTRA_DIST+= IDE/Renesas/e2studio/Projects/test/src/key_data.h
EXTRA_DIST+= IDE/Renesas/e2studio/Projects/test/src/wolf_client.c
EXTRA_DIST+= IDE/Renesas/e2studio/Projects/test/src/wolf_server.c
EXTRA_DIST+= IDE/Renesas/e2studio/Projects/test/src/wolfssl_demo.h
EXTRA_DIST+= IDE/Renesas/e2studio/Projects/common/wolfssl_dummy.c
EXTRA_DIST+= IDE/Renesas/e2studio/Projects/common/strings.h
EXTRA_DIST+= IDE/Renesas/e2studio/Projects/common/unistd.h

View File

@ -32,17 +32,22 @@
<link>
<name>src/benchmark.c</name>
<type>1</type>
<locationURI>copy_PARENT1/wolfcrypt/benchmark/benchmark.c</locationURI>
<locationURI>$%7BPARENT-5-PROJECT_LOC%7D/wolfcrypt/benchmark/benchmark.c</locationURI>
</link>
<link>
<name>src/benchmark.h</name>
<type>1</type>
<locationURI>copy_PARENT1/wolfcrypt/benchmark/benchmark.h</locationURI>
<locationURI>$%7BPARENT-5-PROJECT_LOC%7D/wolfcrypt/benchmark/benchmark.h</locationURI>
</link>
<link>
<name>src/test.c</name>
<type>1</type>
<locationURI>copy_PARENT1/wolfcrypt/test/test.c</locationURI>
<locationURI>PARENT-5-PROJECT_LOC/wolfcrypt/test/test.c</locationURI>
</link>
<link>
<name>src/wolfssl_dummy.c</name>
<type>1</type>
<locationURI>$%7BPARENT-1-PROJECT_LOC%7D/common/wolfssl_dummy.c</locationURI>
</link>
</linkedResources>
<variableList>
@ -50,9 +55,5 @@
<name>copy_PARENT</name>
<value>$%7BPARENT-3-ECLIPSE_HOME%7D/workspace/wolfssl</value>
</variable>
<variable>
<name>copy_PARENT1</name>
<value>$%7BPARENT-1-copy_PARENT%7D/wolfssl_tsip</value>
</variable>
</variableList>
</projectDescription>

View File

@ -1,3 +1,23 @@
/* key_data.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL 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.
*
* wolfSSL 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include "key_data.h"
#ifdef WOLFSSL_RENESAS_TSIP

View File

@ -1,4 +1,23 @@
/* key_data.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL 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.
*
* wolfSSL 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifndef KEY_DATA_H_
#define KEY_DATA_H_
#include <wolfssl/wolfcrypt/settings.h>

0
IDE/Renesas/e2studio/Projects/test/src/wolf_server.c Executable file → Normal file
View File

View File

@ -1,8 +1,22 @@
/*
* wolfssl_demo.h
/* wolfssl_demo.h
*
* Created on: 2019/07/28
* Author: darkb
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL 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.
*
* wolfSSL 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifndef WOLFSSL_DEMO_H_
@ -10,11 +24,21 @@
#define FREQ 10000 /* Hz */
//#define CRYPT_TEST
//#define BENCHMARK
//#define TLS_CLIENT
#define USE_TSIP_TLS
#define TLS_SERVER
/* Enable wolfcrypt test */
/* can be enabled with benchmark test */
/* #define CRYPT_TEST */
/* Enable benchmark */
/* can be enabled with cyrpt test */
/* #define BENCHMARK */
/* Enable TLS client */
/* cannot enable with other definition */
/* #define TLS_CLIENT */
/* Enable TLS server */
/* cannot enable with other definition */
/* #define TLS_SERVER */
void wolfSSL_TLS_client_init();
void wolfSSL_TLS_client();

View File

@ -1,41 +0,0 @@
/* wolfssl_dummy.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL 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.
*
* wolfSSL 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
typedef unsigned long time_t;
#define YEAR 2019
#define MON 5
static int tick = 0;
time_t time(time_t *t)
{
return ((YEAR-1970)*365+30*MON)*24*60*60 + tick++;
}
#include <ctype.h>
int strncasecmp(const char *s1, const char * s2, unsigned int sz)
{
for( ; sz>0; sz--)
if(toupper(s1++) != toupper(s2++))
return 1;
return 0;
}

View File

@ -79,7 +79,11 @@ EXTRA_DIST += wolfcrypt/src/port/ti/ti-aes.c \
wolfcrypt/src/port/Espressif/esp32_mp.c \
wolfcrypt/src/port/Espressif/README.md \
wolfcrypt/src/port/arm/cryptoCell.c \
wolfcrypt/src/port/arm/cryptoCellHash.c
wolfcrypt/src/port/arm/cryptoCellHash.c \
wolfcrypt/src/port/Renesas/renesas_tsip_aes.c \
wolfcrypt/src/port/Renesas/renesas_tsip_sha.c \
wolfcrypt/src/port/Renesas/renesas_tsip_util.c \
wolfcrypt/src/port/Renesas/README_TSIP.md
if BUILD_CRYPTOCB

View File

@ -14,7 +14,7 @@ Including the following examples:
## Requirements
### 1. [Renesas TSIP FIT module](https://www.renesas.com/us/en/products/software-tools/software-os-middleware-driver/security-crypto/trusted-secure-ip-driver.html)
- [FIT module](https://www.renesas.com/us/en/products/software-tools/software-os-middleware-driver/software-package/fit.html)
[FIT module](https://www.renesas.com/us/en/products/software-tools/software-os-middleware-driver/software-package/fit.html)
Note : The included example program is tested with <u>TSIP FIT version **1.06**</u>.
### 2. [e2studio](https://www.renesas.com/us/en/products/software-tools/tools/ide/e2studio.html)
@ -36,9 +36,48 @@ To disable portions of the hardware acceleration you can optionally define:
#define NO_WOLFSSL_RENESAS_TSIP_TLS_SESSION
```
### Benchmarks
Software only implementation:
**Software only implementation:**
*block cipher*
```
RNG 200 KB took 1.099 seconds, 182.000 KB/s
SHA 1 MB took 1.005 seconds, 1.166 MB/s
SHA-256 425 KB took 1.038 seconds, 409.520 KB/s
```
*TLS establishment time*
```
TLS_RSA_WITH_AES_128_CBC_SHA : 0.651 (s)
TLS_RSA_WITH_AES_128_CBC_SHA256 : 0.651 (s)
TLS_RSA_WITH_AES_256_CBC_SHA : 0.642 (s)
TLS_RSA_WITH_AES_256_CBAC_SHA256 : 0.662 (s)
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 : 2.050 (s)
```
**Hardware acceleration:**
*block cipher*
```
RNG 1 MB took 1.011 seconds, 1.038 MB/s
SHA 12 MB took 1.001 seconds, 11.515 MB/s
SHA-256 13 MB took 1.001 seconds, 12.900 MB/s
```
*TLS establishment time with TLS-linked capability*
*Performe full TlS-linked capability*
```
TLS_RSA_WITH_AES_128_CBC_SHA : 0.141 (s)
TLS_RSA_WITH_AES_128_CBC_SHA256 : 0.141 (s)
TLS_RSA_WITH_AES_256_CBC_SHA : 0.141 (s)
TLS_RSA_WITH_AES_256_CBAC_SHA256 : 0.144 (s)
```
*Performe certificate verification by TSIP TLS-linked API*
```
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 : 1.721 (s)
```
Condition:
Renesas : e2Studio v7.4.0
ToolChain : Renesas CCRX version 3.00.00
TSIP FIT : version 1.0.6
Board : [GR-ROSE](http://gadget.renesas.com/en/product/rose.html)
wolfSSL : 4.1.0
Hardware Acceleration:
## Setup and Build an example program
An example program expects the following FIT modules:
@ -71,10 +110,21 @@ Now, it is able to copy these FIT modules into an example project.
`#define BENCHMARK // enable benchmark application`
`#define TLS_CLIENT // enable simple tls client application`
`#define TLS_SERVER // enable simple tls server application`
`#define USE_TSIP_TLS // inform user key and flash keying`
`#define USE_TSIP_TLS // to inform user key and flash keying, when using TSIP`
Note: CRYPT_TEST and BENCHMARK can be enabled at the same time. TLS_CLIENT and TLS_SERVER cannot be enabled together other definitions.
7. Setup debug configuration based on your debug hardware
## Run client/server program on the device
When testing the embedded client or server on the device, it is recommended to test against one of the standard wolfSSL example application running on a desktop machine.
For the embedded client, an example server commands for running on a desktop machine, IP address 192.168.1.45, is as follows:
`$./example/server/server -b -d -i`
For the embedded server, an example client commands for running on a desktop machine is as follows:
`$./example/client/client -h 192.168.1.33 -p 11111`
## Modify an example program
To use own TSIP keys for TSIP TLS-linked API use, it needs own flash keyring, PSS signed signature and RSA key.
@ -97,7 +147,7 @@ To use own TSIP keys for TSIP TLS-linked API use, it needs own flash keyring, PS
Generated byte array of signed signature by genhexbuf.pl can be replaced signature data in key_data.c of an example program.
Encrypted RSA key and generated byte array of signed signature need to be informed wolfSSL library before loading CA certification. Please refer SetTsipTlskey() function an example program.
Encrypted RSA key and generated byte array of signed signature need to be informed wolfSSL library before loading CA certification. Please see SetTsipTlskey() function an example program about how to inform them.
### Coding
@ -106,7 +156,4 @@ In your application you must include <wolfssl/wolfcrypt/settings.h> before any o
## Support
For question please email [support@wolfssl.com]
* Renesas : e2Studio v7.4.0
* ToolChain : Renesas CCRX version 3.00.00
* Board : [GR-ROSE](http://gadget.renesas.com/en/product/rose.html)
* wolfSSL : 4.1.0

View File

@ -1,4 +1,4 @@
/* esp32_aes.c
/* renesas_tsip_aes.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*

View File

@ -77,7 +77,8 @@ noinst_HEADERS+= \
wolfssl/wolfcrypt/port/st/stm32.h \
wolfssl/wolfcrypt/port/st/stsafe.h \
wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h \
wolfssl/wolfcrypt/port/arm/cryptoCell.h
wolfssl/wolfcrypt/port/arm/cryptoCell.h \
wolfssl/wolfcrypt/port/Renesas/renesas-tsip-crypt.h
if BUILD_CRYPTOAUTHLIB
nobase_include_HEADERS+= wolfssl/wolfcrypt/port/atmel/atmel.h