Merge pull request #2436 from miyazakh/Renesas_TSIP_Port

Support renesas tsip
This commit is contained in:
Chris Conlon 2019-09-19 14:44:33 -06:00 committed by GitHub
commit 33a83cdba0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
41 changed files with 3524 additions and 193 deletions

6
.gitignore vendored
View File

@ -328,3 +328,9 @@ IDE/XCODE/Index
\.settings/
\.cproject
\.project
# Renesas e2studio
/IDE/Renesas/e2studio/Projects/test/src/smc_gen
/IDE/Renesas/e2studio/Projects/test/trash
/IDE/Renesas/e2studio/Projects/test/*.launch
/IDE/Renesas/e2studio/Projects/test/*.scfg

View File

@ -31,10 +31,11 @@
#define WOLFSSL_NO_CURRDIR
#define NO_FILESYSTEM
#define WOLFSSL_LOG_PRINTF
/* #define DEBUG_WOLFSSL */
#define OPENSSL_EXTRA
#define WOLFSSL_HAVE_MIN
#define WOLFSSL_HAVE_MAX
#if !defined(min)
#define min(data1, data2) _builtin_min(data1, data2)
#endif
#define WOLFSSL_SMALL_STACK
#define WOLFSSL_DH_CONST
@ -47,15 +48,15 @@
#define USE_WOLF_TIMEVAL_T
#define WOLFSSL_USER_CURRTIME /* for benchmark */
#define WOLFSSL_GENSEED_FORTEST /* Wardning: define your own seed gen */
#define TFM_TIMING_RESISTANT
#define ECC_TIMING_RESISTANT
#define WC_RSA_BLINDING
#define SINGLE_THREADED /* or define RTOS option */
/* #define WOLFSSL_CMSIS_RTOS */
#ifndef SINGLE_THREADED
/* expects use FRERRTOS */
#define FREERTOS
#endif
/* #define NO_DH */
#define HAVE_AESGCM
@ -66,3 +67,20 @@
#define HAVE_ED25519
/* #define NO_WOLFSSL_STUB */
/* #define DEBUG_WOLFSSL */
/* TSIP TLS specific definitions */
#if !defined(WOLFSSL_RENESAS_TSIP)
#define OPENSSL_EXTRA
#define WOLFSSL_GENSEED_FORTEST /* Warning: define your own seed gen */
#else
#if defined(WOLFSSL_RENESAS_RX65N)
/* In the case of Static RSA and AES-CBC use */
#define HAVE_AES_CBC
/* TSIP ver 1.0.6 or lower supports only static RSA as Public-key cryptography. */
#define WOLFSSL_STATIC_RSA
/* 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

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="com.renesas.cdt.managedbuild.renesas.ccrx.debug.configuration.246204984">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.renesas.cdt.managedbuild.renesas.ccrx.debug.configuration.246204984" moduleId="org.eclipse.cdt.core.settings" name="Debug">
<cconfiguration id="com.renesas.cdt.managedbuild.renesas.ccrx.hardwaredebug.configuration.1378385971">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.renesas.cdt.managedbuild.renesas.ccrx.hardwaredebug.configuration.1378385971" moduleId="org.eclipse.cdt.core.settings" name="HardwareDebug">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
@ -14,83 +14,407 @@
</storageModule>
<storageModule moduleId="com.renesas.cdt.managedbuild.core.toolchainInfo">
<option id="toolchain.id" value="Renesas_RXC"/>
<option id="toolchain.version" value="v2.08.00"/>
<option id="toolchain.version" value="v3.01.00"/>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="abs" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" description="Debug" id="com.renesas.cdt.managedbuild.renesas.ccrx.debug.configuration.246204984" name="Debug" parent="com.renesas.cdt.managedbuild.renesas.ccrx.debug.configuration">
<folderInfo id="com.renesas.cdt.managedbuild.renesas.ccrx.debug.configuration.246204984." name="/" resourcePath="">
<toolChain id="com.renesas.cdt.managedbuild.renesas.ccrx.debug.toolChain.490516599" name="Renesas CCRX Toolchain" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.debug.toolChain">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.PE" id="com.renesas.cdt.managedbuild.renesas.ccrx.base.targetPlatform.546125733" osList="win32" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.targetPlatform"/>
<builder buildPath="${workspace_loc:/test}/Debug" id="com.renesas.cdt.managedbuild.renesas.ccrx.base.builder.864420363" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CCRX Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.builder"/>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.dsp.398562691" name="DSP Assembler" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.dsp">
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.dsp.option.noDebugInfo.1671134834" name="デバッグ情報を出力する" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.dsp.option.noDebugInfo" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<configuration artifactExtension="abs" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" description="Debug on hardware" id="com.renesas.cdt.managedbuild.renesas.ccrx.hardwaredebug.configuration.1378385971" name="HardwareDebug" parent="com.renesas.cdt.managedbuild.renesas.ccrx.hardwaredebug.configuration">
<folderInfo id="com.renesas.cdt.managedbuild.renesas.ccrx.hardwaredebug.configuration.1378385971." name="/" resourcePath="">
<toolChain id="com.renesas.cdt.managedbuild.renesas.ccrx.hardwaredebug.toolChain.1637393351" name="Renesas CCRX Toolchain" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.hardwaredebug.toolChain">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.PE" id="com.renesas.cdt.managedbuild.renesas.ccrx.base.targetPlatform.808325012" osList="win32" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.targetPlatform"/>
<builder buildPath="${workspace_loc:/test}/HardwareDebug" id="com.renesas.cdt.managedbuild.renesas.ccrx.base.builder.65531188" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CCRX Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.builder"/>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.dsp.1710373085" name="DSP Assembler" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.dsp">
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.dsp.option.noDebugInfo.390598726" name="デバッグ情報を出力する" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.dsp.option.noDebugInfo" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.dsp.option.endian.2145260692" name="出力するデータ値のエンディアン" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.dsp.option.endian" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.dsp.option.endian.big" valueType="enumerated"/>
</tool>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.common.741650141" name="Common" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.common">
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.isa.1805078695" name="命令セット・アーキテクチャ" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.isa" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.isa.rxv2" valueType="enumerated"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.hasFpu.1234136355" name="Has FPU" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.hasFpu" useByScannerDiscovery="false" value="TRUE" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceName.278687847" name="Device Name" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceName" useByScannerDiscovery="false" value="R5F571MLCxFC" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceCommand.1991523533" name="Device Command" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceCommand" useByScannerDiscovery="false" value="R5F571ML" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.checkRtos.1718474165" name="Check RTOS" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.checkRtos" useByScannerDiscovery="false" value="unusedRtos" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.hasDsp.1754444988" name="Has DSP" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.hasDsp" useByScannerDiscovery="false" value="false" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceFamily.2135235189" name="Device Family" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceFamily" useByScannerDiscovery="false" value="RX71M" valueType="string"/>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.common.385785132" name="Common" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.common">
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.isa.968417281" name="命令セット・アーキテクチャ" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.isa" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.isa.rxv2" valueType="enumerated"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.rxArchitecture.1826562770" name="RX Architecture" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.rxArchitecture" useByScannerDiscovery="false" value="rxv2" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.floatIns.2015650112" name="浮動小数点演算命令を使用する" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.floatIns" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.floatIns.yes" valueType="enumerated"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.hasFpu.1065149525" name="Has FPU" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.hasFpu" useByScannerDiscovery="false" value="TRUE" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceName.1439501151" name="Device Name" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceName" useByScannerDiscovery="false" value="R5F565NEHxFP" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceHistory.141103170" name="Device history" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceHistory" useByScannerDiscovery="false" value="non_init;R5F565NEHxFP" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.isaHistory.13818145" name="ISA history" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.isaHistory" useByScannerDiscovery="false" value="non_init;com.renesas.cdt.managedbuild.renesas.ccrx.common.option.isa.rxv2" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceCommand.624156745" name="Device Command" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceCommand" useByScannerDiscovery="false" value="R5F565NE" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.checkRtos.198501700" name="Check RTOS" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.checkRtos" useByScannerDiscovery="false" value="unusedRtos" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.hasDsp.898504242" name="Has DSP" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.hasDsp" useByScannerDiscovery="false" value="false" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceFamily.2015079094" name="Device Family" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceFamily" useByScannerDiscovery="false" value="RX65N" valueType="string"/>
</tool>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.compiler.1005426126" name="Compiler" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.compiler">
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.fpu.1655116744" name="浮動小数点演算命令を使用する" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.fpu" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.fpu.yes" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.include.421912226" name="インクルード・ファイルを検索するフォルダ" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.include" useByScannerDiscovery="false" valueType="includePath">
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.compiler.220371913" name="Compiler" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.compiler">
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.fpu.1764475068" name="浮動小数点演算命令を使用する" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.fpu" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.fpu.yes" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.include.477145288" name="インクルード・ファイルを検索するフォルダ" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.include" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="${TCINSTALL}/include"/>
<listOptionValue builtIn="false" value="${ProjDirPath}/../common"/>
<listOptionValue builtIn="false" value="${ProjDirPath}/../../../../../"/>
<listOptionValue builtIn="false" value="${ProjDirPath}/generate"/>
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/../common&quot;"/>
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/../../../../../&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_bsp}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_config}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_tsip_rx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_tsip_rx/src/targets/rx231}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_tsip_rx/src/targets/rx66t}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_tsip_rx/src/targets/rx65n}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_cmt_rx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_cmt_rx/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_t4_driver_rx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_t4_driver_rx/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_t4_rx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_t4_rx/lib}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_ether_rx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_sys_time_rx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_sys_time_rx/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/general}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_pincfg}&quot;"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.define.1250794291" name="プリプロセッサ・マクロの定義" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.define" useByScannerDiscovery="false" valueType="definedSymbols">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.define.511269805" name="プリプロセッサ・マクロの定義" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.define" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="DEBUG_CONSOLE"/>
<listOptionValue builtIn="false" value="WOLFSSL_USER_SETTINGS"/>
</option>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.langFileC.286984585" name="Cソース" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.langFileC" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.langFileC.c99" valueType="enumerated"/>
<inputType id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gcc.inputType.1125458755" name="Compiler Input C" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gcc.inputType"/>
<inputType id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gpp.inputType.1044037817" name="Compiler Input CPP" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gpp.inputType"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.userBefore.165256012" name="追加するオプション(すべての指定オプションの前に追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.userBefore" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value=""/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.userAfter.850666858" name="追加するオプション(すべての指定オプションの後ろに追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.userAfter" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value=""/>
</option>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.langFileC.897672730" name="Cソース" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.langFileC" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.langFileC.c99" valueType="enumerated"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.inputCharCode.862144636" name="プログラムの文字コード" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.inputCharCode" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.inputCharCode.utf8" valueType="enumerated"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.outcode.48690443" name="出力する文字コード" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.outcode" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.outcode.utf8" valueType="enumerated"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.optimize.1557621233" name="最適化レベル" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.optimize" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.optimize.level2" valueType="enumerated"/>
<inputType id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gcc.inputType.1722484558" name="Compiler Input C" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gcc.inputType"/>
<inputType id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gpp.inputType.709788007" name="Compiler Input CPP" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gpp.inputType"/>
</tool>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.assembler.616605202" name="Assembler" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.assembler">
<inputType id="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.inputType.889934690" name="Assembler InputType" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.inputType"/>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.assembler.1564576801" name="Assembler" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.assembler">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.userBefore.1555827005" name="追加するオプション(すべての指定オプションの前に追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.userBefore" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value=""/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.userAfter.912893655" name="追加するオプション(すべての指定オプションの後ろに追加)&#10;" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.userAfter" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value=""/>
</option>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.characterCode.864537553" name="プログラムの文字コード" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.characterCode" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.characterCode.utf8" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.include.1616986135" name="インクルード・ファイルを検索するフォルダ" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.include" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/general}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_pincfg}&quot;"/>
</option>
<inputType id="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.inputType.502444415" name="Assembler InputType" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.inputType"/>
</tool>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.linker.1854484070" name="Linker" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.linker">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.rom.1587151897" name="ROMからRAMへマップするセクション" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.rom" useByScannerDiscovery="false" valueType="stringList">
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.linker.1333901009" name="Linker" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.linker">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.rom.2020069967" name="ROMからRAMへマップするセクション" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.rom" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value="D=R"/>
<listOptionValue builtIn="false" value="D_1=R_1"/>
<listOptionValue builtIn="false" value="D_2=R_2"/>
</option>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.linkerSection.1728337952" name="セクション" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.linkerSection" useByScannerDiscovery="false" value="SU,SI,B_1,R_1,B_2,R_2,B,R/04,PResetPRG,C_1,C_2,C,C$*,D*,W*,L,PIntPRG,P/0FFC00000,EXCEPTVECT/0FFFFFF80,RESETVECT/0FFFFFFFC" valueType="string"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.noneLinkageOrderList.1657015231" name="(リンク順序のリスト)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.noneLinkageOrderList" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value="&quot;.\generate\lowlvl.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\generate\dbsct.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\generate\hwsetup.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\generate\intprg.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\generate\lowsrc.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\generate\resetprg.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\generate\sbrk.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\generate\vecttbl.obj&quot;"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.linkerSection.2043161263" name="セクション" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.linkerSection" useByScannerDiscovery="false" value="SU,SI,B_1,R_1,B_2,R_2,B,R/04,B_ETHERNET_BUFFERS_1,B_RX_DESC_1,B_TX_DESC_1/020000,C_1,C_2,C,C$*,D*,W*,L,P*/0FFE00000,EXCEPTVECT/0FFFFFF80,RESETVECT/0FFFFFFFC" valueType="string"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.userBefore.1452234640" name="追加するオプション(すべての指定オプションの前に追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.userBefore" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value=""/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.userAfter.1724535779" name="追加するオプション(すべての指定オプションの後ろに追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.userAfter" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value=""/>
</option>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.vect.47410515" name="可変ベクタテーブルのアドレス未設定ベクタ番号に指定するアドレス" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.vect" useByScannerDiscovery="false" value="_undefined_interrupt_source_isr" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.checkSection.239094904" name="セクションの割り付けアドレスをチェックする" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.checkSection" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.memoryType.1942768497" name="アドレス範囲指定方法" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.memoryType" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.memoryType.autoSpecify" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.noneLinkageOrderList.1237940973" name="(リンク順序のリスト)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.noneLinkageOrderList" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/general\r_cg_hardware_setup.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/general\r_smc_cgc.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/general\r_smc_cgc_user.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/general\r_smc_interrupt.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_bsp/board/generic_rx65n\dbsct.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_bsp/board/generic_rx65n\hwsetup.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_bsp/board/generic_rx65n\lowlvl.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_bsp/board/generic_rx65n\lowsrc.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_bsp/board/generic_rx65n\resetprg.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_bsp/board/generic_rx65n\sbrk.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_bsp/board/generic_rx65n\vecttbl.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_bsp/mcu/all\r_bsp_common.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_bsp/mcu/rx65n\cpu.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_bsp/mcu/rx65n\locking.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_bsp/mcu/rx65n\mcu_clocks.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_bsp/mcu/rx65n\mcu_init.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_bsp/mcu/rx65n\mcu_interrupts.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_bsp/mcu/rx65n\mcu_locks.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_bsp/mcu/rx65n\mcu_mapped_interrupts.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_bsp/mcu/rx65n\mcu_startup.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_pincfg\Pin.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_function000.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_function001.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_function002.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_function100.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_function101.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_function102.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_function103.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_function200.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_function202.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_function205.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_function206.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_function207.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p00.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p01.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p02.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p03.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p04.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p05.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p06.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p07.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p08.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p0a.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p0b.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p0c.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p0d.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p0e.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p0f.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p10.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p14.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p18.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p1f.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p20.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p21.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p22.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p23.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p26.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p29.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p2a.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p2b.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p31.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p32.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p33.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p34.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p35.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p36.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p37.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p38.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p39.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p3a.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p3b.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p3c.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p3d.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p41.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p42.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p43.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p44.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p45.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p46.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p47.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p48.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p49.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p4a.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p4b.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p4c.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p4d.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p50.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p51.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p52.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p53.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p54.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p56.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p57.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p59.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p60.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p62.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p63.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p71.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p72.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p73.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p74.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p75.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p76.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p77.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_p78.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_pd5.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_pd9.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_pda.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_pdb.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_pdf.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_pe0.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_pe1.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_pe2.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_pe3.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_pe4.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_pe5.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_pe6.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_subprc01.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_subprc02.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_subprc03.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n/ip\r_tsip_rx_subprc04.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n\r_tsip_aes_rx.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n\r_tsip_md5_rx.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n\r_tsip_rsa_rx.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n\r_tsip_rx.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n\r_tsip_rx_private.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n\r_tsip_sha_rx.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n\r_tsip_tdes_rx.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src/smc_gen/r_tsip_rx/src/targets/rx65n\r_tsip_tls_rx.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src\test.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src\test_main.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src\wolfssl_dummy.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\test.lib&quot;"/>
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/../wolfssl/Debug/wolfssl.lib&quot;"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.inputFile.2096473091" name="リンクするリロケータブル・ファイル、ライブラリ・ファイルおよびバイナリ・ファイル" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.inputFile" useByScannerDiscovery="false" valueType="stringList">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.inputFile.1438206933" name="リンクするリロケータブル・ファイル、ライブラリ・ファイルおよびバイナリ・ファイル" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.inputFile" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_t4_rx/lib/T4_Library_rxv1_ether_little.lib}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/../wolfssl/Debug/wolfssl.lib&quot;"/>
</option>
</tool>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.librarian.977317851" name="Library Generator" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.librarian">
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.fpu.1234557916" name="浮動小数点演算命令を使用する" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.fpu" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.fpu.yes" valueType="enumerated"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.headCtype.42661342" name="ctype.hC89/C99文字操作用ライブラリ" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.headCtype" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.headMath.29506179" name="math.hC89/C99数値計算用ライブラリ" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.headMath" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.headCppString.277930384" name="stringEC++):文字列操作用ライブラリ" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.headCppString" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.lang.1481899164" name="C言語標準ライブラリ関数の構成" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.lang" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.lang.c99" valueType="enumerated"/>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.librarian.1723543812" name="Library Generator" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.librarian">
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.fpu.1397073307" name="浮動小数点演算命令を使用する" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.fpu" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.fpu.yes" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.userBefore.1773409552" name="追加するオプション(すべての指定オプションの前に追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.userBefore" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value=""/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.userAfter.946493093" name="追加するオプション(すべての指定オプションの後ろに追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.userAfter" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value=""/>
</option>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.lang.338617005" name="C言語標準ライブラリ関数の構成" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.lang" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.lang.c99" valueType="enumerated"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.headCtype.1293885198" name="ctype.hC89/C99文字操作用ライブラリ" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.headCtype" useByScannerDiscovery="false" value="true" valueType="boolean"/>
</tool>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.converter.1278951147" name="Converter" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.converter"/>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.rtosConfig.1737524887" name="RTOS Configurator" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.rtosConfig"/>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.converter.1917108303" name="Converter" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.converter">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.converter.option.userBefore.109845398" name="追加するオプション(すべての指定オプションの前に追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.converter.option.userBefore" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value=""/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.converter.option.userAfter.289006348" name="追加するオプション(すべての指定オプションの後ろに追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.converter.option.userAfter" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value=""/>
</option>
</tool>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.rtosConfig.318974000" name="RTOS Configurator" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.rtosConfig"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src"/>
<entry excluding="ether" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.renesas.cdt.managedbuild.renesas.ccrx.debug.configuration.992474000">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.renesas.cdt.managedbuild.renesas.ccrx.debug.configuration.992474000" moduleId="org.eclipse.cdt.core.settings" name="Debug">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="com.renesas.cdt.managedbuild.renesas.core.RenesasCompilerAssemblerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="com.renesas.cdt.managedbuild.core.buildRunnerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="com.renesas.cdt.managedbuild.core.toolchainInfo">
<option id="toolchain.id" value="Renesas_RXC"/>
<option id="toolchain.version" value="v3.01.00"/>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="abs" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" description="Debug" id="com.renesas.cdt.managedbuild.renesas.ccrx.debug.configuration.992474000" name="Debug" parent="com.renesas.cdt.managedbuild.renesas.ccrx.debug.configuration">
<folderInfo id="com.renesas.cdt.managedbuild.renesas.ccrx.debug.configuration.992474000." name="/" resourcePath="">
<toolChain id="com.renesas.cdt.managedbuild.renesas.ccrx.debug.toolChain.1794956243" name="Renesas CCRX Toolchain" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.debug.toolChain">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.PE" id="com.renesas.cdt.managedbuild.renesas.ccrx.base.targetPlatform.617132481" osList="win32" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.targetPlatform"/>
<builder buildPath="${workspace_loc:/test}/Debug" id="com.renesas.cdt.managedbuild.renesas.ccrx.base.builder.117543810" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CCRX Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.builder"/>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.dsp.1744140894" name="DSP Assembler" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.dsp">
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.dsp.option.noDebugInfo.1464228342" name="デバッグ情報を出力する" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.dsp.option.noDebugInfo" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.dsp.option.endian.733005442" name="出力するデータ値のエンディアン" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.dsp.option.endian" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.dsp.option.endian.big" valueType="enumerated"/>
</tool>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.common.1294844059" name="Common" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.common">
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.isa.644795578" name="命令セット・アーキテクチャ" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.isa" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.isa.rxv2" valueType="enumerated"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.rxArchitecture.1771586719" name="RX Architecture" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.rxArchitecture" useByScannerDiscovery="false" value="rxv2" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.floatIns.1045346284" name="浮動小数点演算命令を使用する" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.floatIns" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.floatIns.yes" valueType="enumerated"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.hasFpu.229476184" name="Has FPU" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.hasFpu" useByScannerDiscovery="false" value="TRUE" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceName.748972653" name="Device Name" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceName" useByScannerDiscovery="false" value="R5F565NEHxFP" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceHistory.780008434" name="Device history" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceHistory" useByScannerDiscovery="false" value="non_init;R5F565NEHxFP" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.isaHistory.783836823" name="ISA history" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.isaHistory" useByScannerDiscovery="false" value="non_init;com.renesas.cdt.managedbuild.renesas.ccrx.common.option.isa.rxv2" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceCommand.1221884092" name="Device Command" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceCommand" useByScannerDiscovery="false" value="R5F565NE" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.checkRtos.1001057208" name="Check RTOS" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.checkRtos" useByScannerDiscovery="false" value="unusedRtos" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.hasDsp.963664750" name="Has DSP" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.hasDsp" useByScannerDiscovery="false" value="false" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceFamily.1280023203" name="Device Family" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceFamily" useByScannerDiscovery="false" value="RX65N" valueType="string"/>
</tool>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.compiler.278830907" name="Compiler" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.compiler">
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.fpu.2144484247" name="浮動小数点演算命令を使用する" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.fpu" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.fpu.yes" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.include.545347560" name="インクルード・ファイルを検索するフォルダ" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.include" valueType="includePath">
<listOptionValue builtIn="false" value="${TCINSTALL}/include"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_bsp}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_config}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_tsip_rx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_tsip_rx/src/targets/rx231}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_tsip_rx/src/targets/rx66t}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_tsip_rx/src/targets/rx65n}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_cmt_rx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_cmt_rx/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_t4_driver_rx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_t4_driver_rx/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_t4_rx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_t4_rx/lib}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_ether_rx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_sys_time_rx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_sys_time_rx/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/general}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_pincfg}&quot;"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.define.935611572" name="プリプロセッサ・マクロの定義" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.define" valueType="definedSymbols">
<listOptionValue builtIn="false" value="DEBUG_CONSOLE"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.userBefore.878126292" name="追加するオプション(すべての指定オプションの前に追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.userBefore" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value=""/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.userAfter.443993930" name="追加するオプション(すべての指定オプションの後ろに追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.userAfter" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value=""/>
</option>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.langFileC.47850385" name="Cソース" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.langFileC" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.langFileC.c99" valueType="enumerated"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.inputCharCode.24533273" name="プログラムの文字コード" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.inputCharCode" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.inputCharCode.utf8" valueType="enumerated"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.outcode.542364588" name="出力する文字コード" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.outcode" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.outcode.utf8" valueType="enumerated"/>
<inputType id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gcc.inputType.1919404628" name="Compiler Input C" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gcc.inputType"/>
<inputType id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gpp.inputType.293530100" name="Compiler Input CPP" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gpp.inputType"/>
</tool>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.assembler.607581328" name="Assembler" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.assembler">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.userBefore.622904140" name="追加するオプション(すべての指定オプションの前に追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.userBefore" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value=""/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.userAfter.67379527" name="追加するオプション(すべての指定オプションの後ろに追加)&#10;" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.userAfter" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value=""/>
</option>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.characterCode.1186358257" name="プログラムの文字コード" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.characterCode" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.characterCode.utf8" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.include.1360045103" name="インクルード・ファイルを検索するフォルダ" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.include" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/general}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_pincfg}&quot;"/>
</option>
<inputType id="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.inputType.1482916460" name="Assembler InputType" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.inputType"/>
</tool>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.linker.1516159151" name="Linker" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.linker">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.rom.1765662172" name="ROMからRAMへマップするセクション" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.rom" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value="D=R"/>
<listOptionValue builtIn="false" value="D_1=R_1"/>
<listOptionValue builtIn="false" value="D_2=R_2"/>
</option>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.linkerSection.1046231838" name="セクション" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.linkerSection" useByScannerDiscovery="false" value="SU,SI,B_1,R_1,B_2,R_2,B,R/04,C_1,C_2,C,C$*,D*,W*,L,P*/0FFE00000,EXCEPTVECT/0FFFFFF80,RESETVECT/0FFFFFFFC,B_ETHERNET_BUFFERS_1,B_RX_DESC_1,B_TX_DESC_1/00010000" valueType="string"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.userBefore.1651005552" name="追加するオプション(すべての指定オプションの前に追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.userBefore" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value=""/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.userAfter.40118921" name="追加するオプション(すべての指定オプションの後ろに追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.userAfter" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value=""/>
</option>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.vect.1524833684" name="可変ベクタテーブルのアドレス未設定ベクタ番号に指定するアドレス" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.vect" useByScannerDiscovery="false" value="_undefined_interrupt_source_isr" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.checkSection.1914971075" name="セクションの割り付けアドレスをチェックする" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.checkSection" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.memoryType.1670384649" name="アドレス範囲指定方法" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.memoryType" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.memoryType.autoSpecify" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.noneLinkageOrderList.1556433699" name="(リンク順序のリスト)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.noneLinkageOrderList" valueType="stringList">
<listOptionValue builtIn="false" value="&quot;.\test.lib&quot;"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.inputFile.856176867" name="リンクするリロケータブル・ファイル、ライブラリ・ファイルおよびバイナリ・ファイル" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.inputFile" valueType="stringList">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/smc_gen/r_t4_rx/lib/T4_Library_rxv1_ether_little.lib}&quot;"/>
</option>
</tool>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.librarian.1598250045" name="Library Generator" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.librarian">
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.fpu.665362864" name="浮動小数点演算命令を使用する" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.fpu" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.fpu.yes" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.userBefore.413642487" name="追加するオプション(すべての指定オプションの前に追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.userBefore" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value=""/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.userAfter.322853429" name="追加するオプション(すべての指定オプションの後ろに追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.userAfter" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value=""/>
</option>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.lang.1591825359" name="C言語標準ライブラリ関数の構成" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.lang" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.lang.c99" valueType="enumerated"/>
</tool>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.converter.175269062" name="Converter" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.converter">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.converter.option.userBefore.1586351233" name="追加するオプション(すべての指定オプションの前に追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.converter.option.userBefore" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value=""/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.converter.option.userAfter.900284814" name="追加するオプション(すべての指定オプションの後ろに追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.converter.option.userAfter" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value=""/>
</option>
</tool>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.rtosConfig.1118615463" name="RTOS Configurator" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.rtosConfig"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="ether" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src"/>
</sourceEntries>
</configuration>
</storageModule>
@ -98,13 +422,16 @@
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="test.com.renesas.cdt.managedbuild.renesas.ccrx.projectType.1174322677" name="実行可能" projectType="com.renesas.cdt.managedbuild.renesas.ccrx.projectType"/>
<project id="test.com.renesas.cdt.managedbuild.renesas.ccrx.projectType.1611298680" name="実行可能" projectType="com.renesas.cdt.managedbuild.renesas.ccrx.projectType"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="HardwareDebug">
<resource resourceType="PROJECT" workspacePath="/test"/>
</configuration>
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/test"/>
</configuration>

View File

@ -17,6 +17,11 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.renesas.cdt.managedbuild.renesas.misrachecker.builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
@ -24,6 +29,16 @@
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
<linkedResources>
<link>
<name>src/benchmark.c</name>
<type>1</type>
<locationURI>$%7BPARENT-5-PROJECT_LOC%7D/wolfcrypt/benchmark/benchmark.c</locationURI>
</link>
<link>
<name>src/benchmark.h</name>
<type>1</type>
<locationURI>$%7BPARENT-5-PROJECT_LOC%7D/wolfcrypt/benchmark/benchmark.h</locationURI>
</link>
<link>
<name>src/test.c</name>
<type>1</type>
@ -32,7 +47,13 @@
<link>
<name>src/wolfssl_dummy.c</name>
<type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/common/wolfssl_dummy.c</locationURI>
<locationURI>$%7BPARENT-1-PROJECT_LOC%7D/common/wolfssl_dummy.c</locationURI>
</link>
</linkedResources>
<variableList>
<variable>
<name>copy_PARENT</name>
<value>$%7BPARENT-3-ECLIPSE_HOME%7D/workspace/wolfssl</value>
</variable>
</variableList>
</projectDescription>

View File

@ -0,0 +1,164 @@
/* 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
/* The following key data is an dummy data. */
/* Please replace them by your own data */
const st_key_block_data_t g_key_block_data =
{
/* uint8_t encrypted_session_key[R_TSIP_AES_CBC_IV_BYTE_SIZE * 2]; */
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
},
/* uint8_t iv[R_TSIP_AES_CBC_IV_BYTE_SIZE]; */
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
},
/* uint8_t encrypted_user_rsa2048_ne_key[R_TSIP_RSA2048_NE_KEY_BYTE_SIZE + 16]; */
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
},
};
const uint32_t s_flash[] =
{
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
};
/* ./ca-cert.der.sign, */
const unsigned char ca_cert_sig[] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const int sizeof_ca_cert_sig = sizeof(ca_cert_sig);
/* ./client-cert.der.sign, */
const unsigned char client_cert_der_sign[] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const int sizeof_client_cert_der_sign = sizeof(client_cert_der_sign);
uint32_t s_inst1[R_TSIP_SINST_WORD_SIZE] = { 0 };
uint32_t s_inst2[R_TSIP_SINST2_WORD_SIZE]= { 0 };
#endif

View File

@ -0,0 +1,45 @@
/* 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>
#ifdef WOLFSSL_RENESAS_TSIP
#include "r_tsip_rx_if.h"
/** user key datas */
typedef struct key_block_data
{
uint8_t encrypted_session_key[R_TSIP_AES_CBC_IV_BYTE_SIZE * 2];
uint8_t iv[R_TSIP_AES_CBC_IV_BYTE_SIZE];
uint8_t encrypted_user_rsa2048_ne_key[R_TSIP_RSA2048_NE_KEY_BYTE_SIZE + 16];
} st_key_block_data_t;
extern const st_key_block_data_t g_key_block_data;
extern const uint32_t s_flash[];
extern const unsigned char ca_cert_der[];
extern const int sizeof_ca_cert_der;
extern const unsigned char ca_cert_sig[];
extern const unsigned char client_cert_der_sign[];
#endif /* WOLFSSL_RENESAS_TSIP */
#endif /* KEY_DATA_H_ */

View File

@ -26,6 +26,10 @@
#endif
#include "stdio.h"
#include "stdint.h"
#include <wolfssl/wolfcrypt/settings.h>
#include "wolfssl/wolfcrypt/types.h"
#include "wolfssl_demo.h"
void main(void);
#ifdef __cplusplus
@ -34,6 +38,29 @@ void abort(void);
}
#endif
#if defined(TLS_CLIENT) || defined(TLS_SERVER)
#include "r_t4_itcpip.h"
#include "r_sys_time_rx_if.h"
#include "Pin.h"
#define T4_WORK_SIZE (14800)
static UW tcpudp_work[(T4_WORK_SIZE / 4) + 1];
#if defined(WOLFSSL_RENESAS_TSIP)
#include "key_data.h"
#include <wolfssl/wolfcrypt/port/Renesas/renesas-tsip-crypt.h>
extern const st_key_block_data_t g_key_block_data;
#endif
#endif
static long tick;
static void timeTick(void *pdata)
{
tick++;
}
typedef struct func_args {
int argc;
char** argv;
@ -42,13 +69,148 @@ typedef struct func_args {
void wolfcrypt_test(func_args args);
int benchmark_test(void *args);
double current_time(int reset)
{
if(reset) tick = 0 ;
return ((double)tick/FREQ) ;
}
#if defined(TLS_CLIENT) || defined(TLS_SERVER)
int SetTsiptlsKey()
{
#if defined(WOLFSSL_RENESAS_TSIP) && defined(TLS_CLIENT)
tsip_inform_cert_sign((const byte *)ca_cert_sig);
tsip_inform_user_keys((byte*)&g_key_block_data.encrypted_session_key,
(byte*)&g_key_block_data.iv,
(byte*)&g_key_block_data.encrypted_user_rsa2048_ne_key);
#elif defined(WOLFSSL_RENESAS_TSIP) && defined(TLS_SERVER)
tsip_inform_cert_sign((const byte *)client_cert_der_sign);
tsip_inform_user_keys((byte*)&g_key_block_data.encrypted_session_key,
(byte*)&g_key_block_data.iv,
(byte*)&g_key_block_data.encrypted_user_rsa2048_ne_key);
#endif
return 0;
}
int Open_tcp( )
{
ER ercd;
W size;
sys_time_err_t sys_ercd;
char ver[128];
/* cast from uint8_t to char* */
strcpy(ver, (char*)R_t4_version.library);
sys_ercd = R_SYS_TIME_Open();
if (sys_ercd != SYS_TIME_SUCCESS) {
printf("ERROR : R_SYS_TIME_Open() failed\n");
return -1;
}
R_Pins_Create();
/* start LAN controller */
ercd = lan_open();
/* initialize TCP/IP */
size = tcpudp_get_ramsize();
if (size > (sizeof(tcpudp_work))) {
printf("size > (sizeof(tcpudp_work))!\n");
return -1;
}
ercd = tcpudp_open(tcpudp_work);
if (ercd != E_OK) {
printf("ERROR : tcpudp_open failed\n");
return -1;
}
return 0;
}
void Close_tcp()
{
/* end TCP/IP */
tcpudp_close();
lan_close();
R_SYS_TIME_Close();
}
#endif
void main(void)
{
func_args args = {1};
(void)timeTick;
printf("Start wolfCrypt Test\n");
wolfcrypt_test(args);
printf("End wolfCrypt Test\n");
#if defined(CRYPT_TEST) || defined(BENCHMARK)
#if defined(CRYPT_TEST)
int ret;
func_args args = { 0 };
if ((ret = wolfCrypt_Init()) != 0) {
printf("wolfCrypt_Init failed %d\n", ret);
}
printf("Start wolfCrypt Test\n");
wolfcrypt_test(args);
printf("End wolfCrypt Test\n");
if ((ret = wolfCrypt_Cleanup()) != 0) {
printf("wolfCrypt_Cleanup failed %d\n", ret);
}
#endif
#if defined(BENCHMARK)
#include "r_cmt_rx_if.h"
uint32_t channel;
R_CMT_CreatePeriodic(FREQ, &timeTick, &channel);
printf("Start wolfCrypt Benchmark\n");
benchmark_test(NULL);
printf("End wolfCrypt Benchmark\n");
#endif
#elif defined(TLS_CLIENT)
#if defined(WOLFSSL_RENESAS_TSIP)
const char* cipherlist[] = {
/* NULL */
"AES128-SHA",
"AES128-SHA256",
"AES256-SHA",
"AES256-SHA256"
};
const int cipherlist_sz = 4;
#else
const char* cipherlist[] = { NULL };
const int cipherlist_sz = 0;
#endif
int i = 0;
Open_tcp();
#if defined(WOLFSSL_RENESAS_TSIP)
SetTsiptlsKey();
#endif
do {
if(cipherlist_sz > 0 ) printf("cipher : %s\n", cipherlist[i]);
wolfSSL_TLS_client_init(cipherlist[i]);
wolfSSL_TLS_client();
i++;
} while (i < cipherlist_sz);
Close_tcp();
#elif defined(TLS_SERVER)
Open_tcp();
#if defined(WOLFSSL_RENESAS_TSIP)
SetTsiptlsKey();
#endif
wolfSSL_TLS_server_init();
wolfSSL_TLS_server();
Close_tcp();
#endif
}
#ifdef __cplusplus

View File

@ -0,0 +1,205 @@
/* wolf_client.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 <stdio.h>
#include <string.h>
#include "r_t4_itcpip.h"
#include "wolfssl/wolfcrypt/settings.h"
#include "wolfssl/ssl.h"
#include "wolfssl/certs_test.h"
#include "key_data.h"
#define SIMPLE_TLSSEVER_IP "192.168.1.45"
#define SIMPLE_TLSSERVER_PORT "11111"
ER t4_tcp_callback(ID cepid, FN fncd , VP p_parblk);
uint32_t g_encrypted_root_public_key[140];
static WOLFSSL_CTX *client_ctx;
static int my_IORecv(WOLFSSL* ssl, char* buff, int sz, void* ctx)
{
int ret;
ID cepid;
if(ctx != NULL)
cepid = *(ID *)ctx;
else
return WOLFSSL_CBIO_ERR_GENERAL;
ret = tcp_rcv_dat(cepid, buff, sz, TMO_FEVR);
if(ret > 0)
return ret;
else
return WOLFSSL_CBIO_ERR_GENERAL;
}
static int my_IOSend(WOLFSSL* ssl, char* buff, int sz, void* ctx)
{
int ret;
ID cepid;
if(ctx != NULL)
cepid = *(ID *)ctx;
else
return WOLFSSL_CBIO_ERR_GENERAL;
ret = tcp_snd_dat(cepid, buff, sz, TMO_FEVR);
if(ret == sz)
return ret;
else
return WOLFSSL_CBIO_ERR_GENERAL;
}
static int getIPaddr(char *arg)
{
int a1, a2, a3, a4;
if(sscanf(arg, "%d.%d.%d.%d", &a1, &a2, &a3, &a4) == 4)
return (a1 << 24) | (a2 << 16) | (a3 << 8) | a4;
else return 0;
}
static int getPort(char *arg)
{
int port;
if(sscanf(arg, "%d", &port) == 1)
return port;
else return 0;
}
void wolfSSL_TLS_client_init(const char* cipherlist)
{
#ifndef NO_FILESYSTEM
#ifdef USE_ECC_CERT
char *cert = "./certs/ca-ecc-cert.pem";
#else
char *cert = "./certs/ca-cert.pem";
#endif
#else
#ifdef USE_ECC_CERT
const unsigned char *cert = ca_ecc_der_256;
#define SIZEOF_CERT sizeof_ca_ecc_der_256
#else
const unsigned char *cert = ca_cert_der_2048;
#define SIZEOF_CERT sizeof_ca_cert_der_2048
#endif
#endif
wolfSSL_Init();
#ifdef DEBUG_WOLFSSL
wolfSSL_Debugging_ON();
#endif
/* Create and initialize WOLFSSL_CTX */
if ((client_ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method_ex((void *)NULL))) == NULL) {
printf("ERROR: failed to create WOLFSSL_CTX\n");
return;
}
#if !defined(NO_FILESYSTEM)
if (wolfSSL_CTX_load_verify_locations(client_ctx, cert, 0) != SSL_SUCCESS) {
printf("ERROR: can't load \"%s\"\n", cert);
return NULL;
}
#else
if (wolfSSL_CTX_load_verify_buffer(client_ctx, cert, SIZEOF_CERT, SSL_FILETYPE_ASN1) != SSL_SUCCESS){
printf("ERROR: can't load certificate data\n");
return;
}
#endif
/* Register callbacks */
wolfSSL_SetIORecv(client_ctx, my_IORecv);
wolfSSL_SetIOSend(client_ctx, my_IOSend);
/* use specific cipher */
if (cipherlist != NULL && wolfSSL_CTX_set_cipher_list(client_ctx, cipherlist) != WOLFSSL_SUCCESS) {
wolfSSL_CTX_free(client_ctx); client_ctx = NULL;
printf("client can't set cipher list 1");
}
}
void wolfSSL_TLS_client( )
{
ID cepid = 1;
ER ercd;
int ret;
WOLFSSL_CTX *ctx = (WOLFSSL_CTX *)client_ctx;
WOLFSSL *ssl;
#define BUFF_SIZE 256
static const char sendBuff[]= "Hello Server\n" ;
char rcvBuff[BUFF_SIZE] = {0};
static T_IPV4EP my_addr = { 0, 0 };
T_IPV4EP dst_addr;
if((dst_addr.ipaddr = getIPaddr(SIMPLE_TLSSEVER_IP)) == 0){
printf("ERROR: IP address\n");
return;
}
if((dst_addr.portno = getPort(SIMPLE_TLSSERVER_PORT)) == 0){
printf("ERROR: IP address\n");
return;
}
if((ercd = tcp_con_cep(cepid, &my_addr, &dst_addr, TMO_FEVR)) != E_OK) {
printf("ERROR TCP Connect: %d\n", ercd);
return;
}
if((ssl = wolfSSL_new(ctx)) == NULL) {
printf("ERROR wolfSSL_new: %d\n", wolfSSL_get_error(ssl, 0));
return;
}
/* set callback context */
wolfSSL_SetIOReadCtx(ssl, (void *)&cepid);
wolfSSL_SetIOWriteCtx(ssl, (void *)&cepid);
if(wolfSSL_connect(ssl) != SSL_SUCCESS) {
printf("ERROR SSL connect: %d\n", wolfSSL_get_error(ssl, 0));
return;
}
if (wolfSSL_write(ssl, sendBuff, strlen(sendBuff)) != strlen(sendBuff)) {
printf("ERROR SSL write: %d\n", wolfSSL_get_error(ssl, 0));
return;
}
if ((ret=wolfSSL_read(ssl, rcvBuff, BUFF_SIZE)) < 0) {
printf("ERROR SSL read: %d\n", wolfSSL_get_error(ssl, 0));
return;
}
rcvBuff[ret] = '\0' ;
printf("Received: %s\n", rcvBuff);
/* frees all data before client termination */
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
wolfSSL_Cleanup();
tcp_sht_cep(cepid);
tcp_cls_cep(cepid, TMO_FEVR);
return;
}

View File

@ -0,0 +1,203 @@
/* wolf_server.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 <stdio.h>
#include <string.h>
#include "r_t4_itcpip.h"
#include "wolfssl/wolfcrypt/settings.h"
#include "wolfssl/ssl.h"
#include "wolfssl/certs_test.h"
#include "wolfssl_demo.h"
static WOLFSSL_CTX *server_ctx;
static byte doCliCertCheck;
static int my_IORecv(WOLFSSL* ssl, char* buff, int sz, void* ctx)
{
int ret;
ID cepid;
if(ctx != NULL)
cepid = *(ID *)ctx;
else
return WOLFSSL_CBIO_ERR_GENERAL;
ret = tcp_rcv_dat(cepid, buff, sz, TMO_FEVR);
if(ret == sz)
return ret;
else
return WOLFSSL_CBIO_ERR_GENERAL;
}
static int my_IOSend(WOLFSSL* ssl, char* buff, int sz, void* ctx)
{
int ret;
ID cepid;
if(ctx != NULL)
cepid = *(ID *)ctx;
else
return WOLFSSL_CBIO_ERR_GENERAL;
ret = tcp_snd_dat(cepid, buff, sz, TMO_FEVR);
if(ret == sz)
return ret;
else
return WOLFSSL_CBIO_ERR_GENERAL;
}
void wolfSSL_TLS_server_init(byte doClientCheck)
{
int ret;
#ifndef NO_FILESYSTEM
#ifdef USE_ECC_CERT
char *cert = "./certs/server-ecc-cert.pem";
char *key = "./certs/server-ecc-key.pem";
#else
char *cert = "./certs/server-cert.pem";
char *key = "./certs/server-key.pem";
#endif
char *clientCert = "./certs/client-cert.pem";
#else
#ifdef USE_ECC_CERT
char *cert = serv_ecc_der_256;
int sizeof_cert = sizeof_serv_ecc_der_256;
char *cert = serv_ecc_key_der_256;
int sizeof_key = sizeof_serv_ecc_key_der_256;
#else
const unsigned char *cert = server_cert_der_2048;
#define sizeof_cert sizeof_server_cert_der_2048
const unsigned char *key = server_key_der_2048;
#define sizeof_key sizeof_server_key_der_2048
const unsigned char *clientCert = client_cert_der_2048;
#define sizeof_clicert sizeof_client_cert_der_2048
#endif
#endif
wolfSSL_Init();
#ifdef DEBUG_WOLFSSL
wolfSSL_Debugging_ON();
#endif
/* Create and initialize WOLFSSL_CTX */
if ((server_ctx = wolfSSL_CTX_new(wolfSSLv23_server_method_ex((void *)NULL)))
== NULL) {
printf("ERROR: failed to create WOLFSSL_CTX\n");
return;
}
#if !defined(NO_FILESYSTEM)
ret = wolfSSL_CTX_use_certificate_file(server_ctx, cert, 0);
#else
ret = wolfSSL_CTX_use_certificate_buffer(server_ctx, cert,
sizeof_cert, SSL_FILETYPE_ASN1);
#endif
if (ret != SSL_SUCCESS) {
printf("Error %d loading server-cert!\n", ret);
return;
}
/* Load server key into WOLFSSL_CTX */
#if !defined(NO_FILESYSTEM)
ret = wolfSSL_CTX_use_PrivateKey_file(server_ctx, key, 0);
#else
ret = wolfSSL_CTX_use_PrivateKey_buffer(server_ctx, key, sizeof_key,
SSL_FILETYPE_ASN1);
#endif
if (ret != SSL_SUCCESS) {
printf("Error %d loading server-key!\n", ret);
return;
}
#if defined(WOLFSSL_RENESAS_TSIP)
doCliCertCheck = 1;
#endif
if (doCliCertCheck) {
wolfSSL_CTX_set_verify(server_ctx, WOLFSSL_VERIFY_PEER |
WOLFSSL_VERIFY_FAIL_IF_NO_PEER_CERT, 0);
#if !defined(NO_FILESYSTEM)
if (wolfSSL_CTX_load_verify_locations(server_ctx, clientCert, 0)
!= WOLFSSL_SUCCESS)
#else
if (wolfSSL_CTX_load_verify_buffer(server_ctx, clientCert,
sizeof_clicert,
SSL_FILETYPE_ASN1) != SSL_SUCCESS)
#endif
printf("can't load ca file, Please run from wolfSSL home dir\n");
}
/* Register callbacks */
wolfSSL_SetIORecv(server_ctx, my_IORecv);
wolfSSL_SetIOSend(server_ctx, my_IOSend);
}
void wolfSSL_TLS_server( )
{
ID cepid = 1;
ID repid = 1;
ER ercd;
WOLFSSL_CTX *ctx = (WOLFSSL_CTX *)server_ctx;
WOLFSSL *ssl;
int len;
#define BUFF_SIZE 256
char buff[BUFF_SIZE];
T_IPV4EP dst_addr = {0, 0};
if((ercd = tcp_acp_cep(cepid, repid, &dst_addr, TMO_FEVR)) != E_OK) {
printf("ERROR TCP Accept: %d\n", ercd);
return;
}
if((ssl = wolfSSL_new(ctx)) == NULL) {
printf("ERROR: failed wolfSSL_new\n");
return;
}
wolfSSL_SetIOReadCtx(ssl, (void *)&cepid);
wolfSSL_SetIOWriteCtx(ssl, (void *)&cepid);
if (wolfSSL_accept(ssl) < 0) {
printf("ERROR: SSL Accept(%d)\n", wolfSSL_get_error(ssl, 0));
return;
}
if ((len = wolfSSL_read(ssl, buff, sizeof(buff) - 1)) < 0) {
printf("ERROR: SSL Read(%d)\n", wolfSSL_get_error(ssl, 0));
return;
}
buff[len] = '\0';
printf("Received: %s\n", buff);
if (wolfSSL_write(ssl, buff, len) != len) {
printf("ERROR: SSL Write(%d)\n", wolfSSL_get_error(ssl, 0));
return;
}
wolfSSL_free(ssl);
tcp_sht_cep(cepid);
}

View File

@ -0,0 +1,48 @@
/* wolfssl_demo.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 WOLFSSL_DEMO_H_
#define WOLFSSL_DEMO_H_
#define FREQ 10000 /* Hz */
/* 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();
void wolfSSL_TLS_server_init();
void wolfSSL_TLS_server();
#endif /* WOLFSSL_DEMO_H_ */

View File

@ -0,0 +1,52 @@
#!/bin/bash
function usage(){
cat << _EOT_
Usage :
$0 [-g] [-]
Description:
Generate 2048 bit Rsa key pair and Display modulus and public exponent
Options:
-g generate rsa key pair, default on
-s only show modulus and public exponent
_EOT_
exit 1
}
FLAG_G="on"
FLAG_S="off"
while getopts gsh OPT
do
case $OPT in
g)
FLAG_G="on"
;;
s)
FLAG_S="on"
FLAG_G="off"
;;
h)
usage
;;
\?)
usage
;;
esac
done
if [ $FLAG_G = "on" ]; then
# generate 2048bit Rsa private key
openssl genrsa 2048 2> /dev/null > private-key.pem
# expose public key
openssl rsa -in private-key.pem -pubout -out public-key.pem 2> /dev/null
fi
if [ $FLAG_S = "on" ]; then
# display modulus and exponent
openssl rsa -modulus < private-key.pem 2>/dev/null | grep Modulus=
openssl rsa -text < private-key.pem 2> /dev/null | grep publicExponent
fi

View File

@ -0,0 +1,89 @@
#!/usr/bin/perl
# genhexbuf.pl
# Copyright (C) 2019 wolfSSL Inc.
#
use strict;
use warnings;
# ---- SCRIPT SETTINGS -------------------------------------------------------
# output C header file to write cert/key buffers to
my $outputFile = "certs_sig_data.h";
# rsa keys and certs to be converted
my @fileList = (
# please add your der file and name of the data for C language
# der file name name of the data
#[ "./yourder.der", "your_der_name_in_C" ],
[ "./ca-cert.der", "ca_cert_der" ],
[ "./ca-cert.der.sign", "ca_cert_der_sign" ],
);
# ----------------------------------------------------------------------------
my $num = @fileList;
# open our output file, "+>" creates and/or truncates
open OUT_FILE, "+>", $outputFile or die $!;
print OUT_FILE "/* certs_sig_data.h */\n\n";
print OUT_FILE "#ifndef WOLFSSL_CERTS_SIG_DATA_H\n";
print OUT_FILE "#define WOLFSSL_CERTS_SIG_DATA_H\n\n";
# convert and print 1024-bit cert/keys
for (my $i = 0; $i < $num; $i++) {
my $fname = $fileList[$i][0];
my $sname = $fileList[$i][1];
print OUT_FILE "/* $fname, */\n";
print OUT_FILE "static const unsigned char $sname\[] =\n";
print OUT_FILE "{\n";
file_to_hex($fname);
print OUT_FILE "};\n";
print OUT_FILE "static const int sizeof_$sname = sizeof($sname);\n\n";
}
print OUT_FILE "#endif /* WOLFSSL_CERTS_SIG_DATA_H */\n\n";
# print file as hex, comma-separated, as needed by C buffer
sub file_to_hex {
my $fileName = $_[0];
open my $fp, "<", $fileName or die $!;
binmode($fp);
my $fileLen = -s $fileName;
my $byte;
for (my $i = 0, my $j = 1; $i < $fileLen; $i++, $j++)
{
if ($j == 1) {
print OUT_FILE " ";
}
if ($j != 1) {
print OUT_FILE " ";
}
read($fp, $byte, 1) or die "Error reading $fileName";
my $output = sprintf("0x%02X", ord($byte));
print OUT_FILE $output;
if ($i != ($fileLen - 1)) {
print OUT_FILE ",";
}
if ($j == 10) {
$j = 0;
print OUT_FILE "\n";
}
}
print OUT_FILE "\n";
close($fp);
}

View File

@ -0,0 +1,34 @@
#!/bin/bash
SIGOPT=rsa_padding_mode:pss
SIGOPT2=rsa_pss_saltlen:-1
function usage() {
cat <<_EOT_
Usage:
$0 <pri key> <pub key> <file name>
pri key : private key for sign/verify
pub key : public key for sign/verify
file name : file name to be signed
_EOT_
exit 1
}
if [ $# -ne 3 ]; then
usage
fi
# $1 private key for sign/verify
# $2 public key for verify
# $3 file for sign/verify
openssl dgst -sha256 -sign $1 -sigopt $SIGOPT -sigopt $SIGOPT2 -out $3.sign $3
echo verify by private key
openssl dgst -sha256 -prverify $1 -sigopt $SIGOPT -sigopt $SIGOPT2 -signature $3.sign $3
echo verifiy by public key
openssl dgst -sha256 -verify $2 -sigopt $SIGOPT -sigopt $SIGOPT2 -signature $3.sign $3

View File

@ -14,7 +14,7 @@
</storageModule>
<storageModule moduleId="com.renesas.cdt.managedbuild.core.toolchainInfo">
<option id="toolchain.id" value="Renesas_RXC"/>
<option id="toolchain.version" value="v2.08.00"/>
<option id="toolchain.version" value="v3.00.00"/>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="lib" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" description="Debug" id="com.renesas.cdt.managedbuild.renesas.ccrx.debug.configuration.13311124" name="Debug" parent="com.renesas.cdt.managedbuild.renesas.ccrx.debug.configuration">
@ -33,6 +33,7 @@
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.checkRtos.313687436" name="Check RTOS" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.checkRtos" useByScannerDiscovery="false" value="unusedRtos" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.hasDsp.963524125" name="Has DSP" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.hasDsp" useByScannerDiscovery="false" value="false" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceFamily.664031971" name="Device Family" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceFamily" useByScannerDiscovery="false" value="RX71M" valueType="string"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceHistory.1128940076" name="Device history" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceHistory" useByScannerDiscovery="false" value="non_init;R5F571MLCxFC" valueType="string"/>
</tool>
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.compiler.958103973" name="Compiler" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.compiler">
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.fpu.1276851320" name="浮動小数点演算命令を使用する" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.fpu" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.fpu.yes" valueType="enumerated"/>
@ -40,11 +41,16 @@
<listOptionValue builtIn="false" value="${ProjDirPath}/../common"/>
<listOptionValue builtIn="false" value="${ProjDirPath}//../../../../../"/>
<listOptionValue builtIn="false" value="${TCINSTALL}/include"/>
<listOptionValue builtIn="false" value="${ProjDirPath}/../test/src/smc_gen/"/>
<listOptionValue builtIn="false" value="${ProjDirPath}/../test/src/smc_gen/r_bsp"/>
<listOptionValue builtIn="false" value="${ProjDirPath}/../test/src/smc_gen/r_config"/>
<listOptionValue builtIn="false" value="${ProjDirPath}/../test/src/smc_gen/r_tsip_rx"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.define.687020263" name="プリプロセッサ・マクロの定義" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.define" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="WOLFSSL_USER_SETTINGS"/>
</option>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.langFileC.1494793389" name="Cソース" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.langFileC" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.langFileC.c99" valueType="enumerated"/>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.optimize.573554071" name="最適化レベル" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.optimize" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.optimize.level2" valueType="enumerated"/>
<inputType id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gcc.inputType.971510512" name="Compiler Input C" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gcc.inputType"/>
<inputType id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gpp.inputType.948214383" name="Compiler Input CPP" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gpp.inputType"/>
</tool>
@ -59,7 +65,7 @@
<listOptionValue builtIn="false" value="D_2=R_2"/>
</option>
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.linkerSection.1739258398" name="セクション" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.linkerSection" useByScannerDiscovery="false" value="SU,SI,B_1,R_1,B_2,R_2,B,R/04,PResetPRG,C_1,C_2,C,C$*,D*,W*,L,PIntPRG,P/0FFC00000,EXCEPTVECT/0FFFFFF80,RESETVECT/0FFFFFFFC" valueType="string"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.noneLinkageOrderList.1344120748" name="(リンク順序のリスト)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.noneLinkageOrderList" valueType="stringList">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.noneLinkageOrderList.1344120748" name="(リンク順序のリスト)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.noneLinkageOrderList" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value="&quot;.\src\sample3.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src\sample1.obj&quot;"/>
<listOptionValue builtIn="false" value="&quot;.\src\sample2.obj&quot;"/>

View File

@ -69,6 +69,21 @@
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/src/wolfio.c</locationURI>
</link>
<link>
<name>wolfcrypt/port/renesas_tsip_aes.c</name>
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/wolfcrypt/src/port/Renesas/renesas_tsip_aes.c</locationURI>
</link>
<link>
<name>wolfcrypt/port/renesas_tsip_sha.c</name>
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/wolfcrypt/src/port/Renesas/renesas_tsip_sha.c</locationURI>
</link>
<link>
<name>wolfcrypt/port/renesas_tsip_util.c</name>
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/wolfcrypt/src/port/Renesas/renesas_tsip_util.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/aes.c</name>
<type>1</type>

View File

@ -171,7 +171,11 @@ static int SSL_hmac(WOLFSSL* ssl, byte* digest, const byte* in, word32 sz,
int QSH_Init(WOLFSSL* ssl);
#endif
#ifdef WOLFSSL_RENESAS_TSIP_TLS
int tsip_useable(const WOLFSSL *ssl);
int tsip_generatePremasterSecret();
int tsip_generateEncryptPreMasterSecret(WOLFSSL *ssl, byte *out, word32 *outSz);
#endif
int IsTLS(const WOLFSSL* ssl)
{
if (ssl->version.major == SSLv3_MAJOR && ssl->version.minor >=TLSv1_MINOR)
@ -1828,7 +1832,7 @@ void SSL_CtxResourceFree(WOLFSSL_CTX* ctx)
wolfSSL_CertManagerFree(ctx->cm);
ctx->cm = NULL;
#ifdef OPENSSL_EXTRA
/* ctx->cm was free'd so cm of x509 store should now be NULL */
/* ctx->cm was free'd so cm of x509 store should now be NULL */
if (ctx->x509_store_pt != NULL) {
ctx->x509_store_pt->cm = NULL;
}
@ -5780,6 +5784,9 @@ void SSL_ResourceFree(WOLFSSL* ssl)
#ifndef NO_RSA
FreeKey(ssl, DYNAMIC_TYPE_RSA, (void**)&ssl->peerRsaKey);
ssl->peerRsaKeyPresent = 0;
#endif
#ifdef WOLFSSL_RENESAS_TSIP_TLS
XFREE(ssl->peerTsipEncRsaKeyIndex, ssl->heap, DYNAMIC_TYPE_RSA);
#endif
if (ssl->buffers.inputBuffer.dynamicFlag)
ShrinkInputBuffer(ssl, FORCED_FREE);
@ -10456,6 +10463,24 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
}
else {
ssl->peerRsaKeyPresent = 1;
#ifdef WOLFSSL_RENESAS_TSIP_TLS
/* copy encrypted tsip key index into ssl object */
if (args->dCert->tsip_encRsaKeyIdx) {
if (!ssl->peerTsipEncRsaKeyIndex) {
ssl->peerTsipEncRsaKeyIndex = (byte*)XMALLOC(
TSIP_TLS_ENCPUBKEY_SZ_BY_CERTVRFY,
ssl->heap, DYNAMIC_TYPE_RSA);
}
if (!ssl->peerTsipEncRsaKeyIndex) {
args->lastErr = MEMORY_E;
goto exit_ppc;
}
XMEMCPY(ssl->peerTsipEncRsaKeyIndex,
args->dCert->tsip_encRsaKeyIdx,
TSIP_TLS_ENCPUBKEY_SZ_BY_CERTVRFY);
}
#endif
#ifdef HAVE_PK_CALLBACKS
#ifndef NO_RSA
#ifdef HAVE_SECURE_RENEGOTIATION
@ -11026,18 +11051,18 @@ int DoFinished(WOLFSSL* ssl, const byte* input, word32* inOutIdx, word32 size,
if (ssl->options.side == WOLFSSL_CLIENT_END) {
ssl->options.serverState = SERVER_FINISHED_COMPLETE;
#ifdef OPENSSL_EXTRA
ssl->cbmode = SSL_CB_MODE_WRITE;
ssl->options.clientState = CLIENT_FINISHED_COMPLETE;
ssl->cbmode = SSL_CB_MODE_WRITE;
ssl->options.clientState = CLIENT_FINISHED_COMPLETE;
#endif
if (!ssl->options.resuming) {
#ifdef OPENSSL_EXTRA
if (ssl->CBIS != NULL) {
ssl->CBIS(ssl, SSL_CB_CONNECT_LOOP, SSL_SUCCESS);
}
if (ssl->CBIS != NULL) {
ssl->CBIS(ssl, SSL_CB_CONNECT_LOOP, SSL_SUCCESS);
}
#endif
ssl->options.handShakeState = HANDSHAKE_DONE;
ssl->options.handShakeDone = 1;
}
ssl->options.handShakeState = HANDSHAKE_DONE;
ssl->options.handShakeDone = 1;
}
}
else {
ssl->options.clientState = CLIENT_FINISHED_COMPLETE;
@ -11047,12 +11072,12 @@ int DoFinished(WOLFSSL* ssl, const byte* input, word32* inOutIdx, word32 size,
#endif
if (ssl->options.resuming) {
#ifdef OPENSSL_EXTRA
if (ssl->CBIS != NULL) {
ssl->CBIS(ssl, SSL_CB_ACCEPT_LOOP, SSL_SUCCESS);
}
if (ssl->CBIS != NULL) {
ssl->CBIS(ssl, SSL_CB_ACCEPT_LOOP, SSL_SUCCESS);
}
#endif
ssl->options.handShakeState = HANDSHAKE_DONE;
ssl->options.handShakeDone = 1;
ssl->options.handShakeState = HANDSHAKE_DONE;
ssl->options.handShakeDone = 1;
}
}
@ -11504,9 +11529,9 @@ static int DoHandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx,
#ifdef OPENSSL_EXTRA
if (ssl->CBIS != NULL){
ssl->cbmode = SSL_CB_MODE_READ;
ssl->cbtype = type;
ssl->CBIS(ssl, SSL_CB_ACCEPT_LOOP, SSL_SUCCESS);
ssl->cbmode = SSL_CB_MODE_READ;
ssl->cbtype = type;
ssl->CBIS(ssl, SSL_CB_ACCEPT_LOOP, SSL_SUCCESS);
}
#endif
@ -12647,7 +12672,12 @@ static WC_INLINE int EncryptDo(WOLFSSL* ssl, byte* out, const byte* input,
if (ret != 0)
break;
#endif
#if defined(WOLFSSL_RENESAS_TSIP_TLS) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_TLS_SESSION)
if (tsip_useable(ssl)) {
ret = wc_tsip_AesCbcEncrypt(ssl->encrypt.aes, out, input, sz);
} else
#endif
ret = wc_AesCbcEncrypt(ssl->encrypt.aes, out, input, sz);
#ifdef WOLFSSL_ASYNC_CRYPT
if (ret == WC_PENDING_E && asyncOkay) {
@ -12925,7 +12955,12 @@ static WC_INLINE int DecryptDo(WOLFSSL* ssl, byte* plain, const byte* input,
if (ret != 0)
break;
#endif
#if defined(WOLFSSL_RENESAS_TSIP_TLS) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_TLS_SESSION)
if (tsip_useable(ssl)) {
ret = wc_tsip_AesCbcDecrypt(ssl->decrypt.aes, plain, input, sz);
} else
#endif
ret = wc_AesCbcDecrypt(ssl->decrypt.aes, plain, input, sz);
#ifdef WOLFSSL_ASYNC_CRYPT
if (ret == WC_PENDING_E) {
@ -14504,18 +14539,18 @@ int SendChangeCipher(WOLFSSL* ssl)
int ret;
#ifdef OPENSSL_EXTRA
ssl->cbmode = SSL_CB_MODE_WRITE;
if (ssl->options.side == WOLFSSL_SERVER_END){
ssl->options.serverState = SERVER_CHANGECIPHERSPEC_COMPLETE;
if (ssl->CBIS != NULL)
ssl->CBIS(ssl, SSL_CB_ACCEPT_LOOP, SSL_SUCCESS);
}
else{
ssl->options.clientState =
CLIENT_CHANGECIPHERSPEC_COMPLETE;
if (ssl->CBIS != NULL)
ssl->CBIS(ssl, SSL_CB_CONNECT_LOOP, SSL_SUCCESS);
}
ssl->cbmode = SSL_CB_MODE_WRITE;
if (ssl->options.side == WOLFSSL_SERVER_END){
ssl->options.serverState = SERVER_CHANGECIPHERSPEC_COMPLETE;
if (ssl->CBIS != NULL)
ssl->CBIS(ssl, SSL_CB_ACCEPT_LOOP, SSL_SUCCESS);
}
else{
ssl->options.clientState =
CLIENT_CHANGECIPHERSPEC_COMPLETE;
if (ssl->CBIS != NULL)
ssl->CBIS(ssl, SSL_CB_CONNECT_LOOP, SSL_SUCCESS);
}
#endif
#ifdef WOLFSSL_DTLS
@ -17015,6 +17050,10 @@ const char* wolfSSL_ERR_reason_error_string(unsigned long e)
case TCA_ABSENT_ERROR:
return "TLS Extension Trusted CA ID response absent";
case TSIP_MAC_DIGSZ_E:
return "Invalid MAC size is specified. \
TSIP can only handle SHA1 and SHA256 digest size";
default :
return "unknown error number";
}
@ -17239,7 +17278,7 @@ static const CipherSuiteInfo cipher_names[] =
#endif
#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CCM
SUITE_INFO("ECDHE-ECDSA-AES128-CCM","TLS_ECDHE_ECDSA_WITH_AES_128_CCM",ECC_BYTE,TLS_ECDHE_ECDSA_WITH_AES_128_CCM),
SUITE_INFO("ECDHE-ECDSA-AES128-CCM","TLS_ECDHE_ECDSA_WITH_AES_128_CCM",ECC_BYTE,TLS_ECDHE_ECDSA_WITH_AES_128_CCM),
#endif
#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8
@ -18503,8 +18542,8 @@ exit_dpk:
ssl->options.clientState = CLIENT_HELLO_COMPLETE;
#ifdef OPENSSL_EXTRA
ssl->cbmode = SSL_CB_MODE_WRITE;
if (ssl->CBIS != NULL)
ssl->CBIS(ssl, SSL_CB_CONNECT_LOOP, SSL_SUCCESS);
if (ssl->CBIS != NULL)
ssl->CBIS(ssl, SSL_CB_CONNECT_LOOP, SSL_SUCCESS);
#endif
#if defined(WOLFSSL_CALLBACKS) || defined(OPENSSL_EXTRA)
@ -19164,11 +19203,11 @@ exit_dpk:
ssl->options.sendVerify = SEND_CERT;
}
}
#ifdef OPENSSL_EXTRA
else
#else
#ifdef OPENSSL_EXTRA
else
#else
else if (IsTLS(ssl))
#endif
#endif
{
ssl->options.sendVerify = SEND_BLANK_CERT;
}
@ -20732,10 +20771,10 @@ int SendClientKeyExchange(WOLFSSL* ssl)
WOLFSSL_ENTER("SendClientKeyExchange");
#ifdef OPENSSL_EXTRA
ssl->options.clientState = CLIENT_KEYEXCHANGE_COMPLETE;
ssl->cbmode = SSL_CB_MODE_WRITE;
if (ssl->CBIS != NULL)
ssl->CBIS(ssl, SSL_CB_CONNECT_LOOP, SSL_SUCCESS);
ssl->options.clientState = CLIENT_KEYEXCHANGE_COMPLETE;
ssl->cbmode = SSL_CB_MODE_WRITE;
if (ssl->CBIS != NULL)
ssl->CBIS(ssl, SSL_CB_CONNECT_LOOP, SSL_SUCCESS);
#endif
#ifdef WOLFSSL_ASYNC_CRYPT
@ -20980,16 +21019,30 @@ int SendClientKeyExchange(WOLFSSL* ssl)
case rsa_kea:
{
/* build PreMasterSecret with RNG data */
ret = wc_RNG_GenerateBlock(ssl->rng,
&ssl->arrays->preMasterSecret[VERSION_SZ],
SECRET_LEN - VERSION_SZ);
if (ret != 0) {
goto exit_scke;
#if defined(WOLFSSL_RENESAS_TSIP_TLS) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_TLS_SESSION)
if (tsip_useable(ssl)) {
ret = tsip_generatePremasterSecret(
&ssl->arrays->preMasterSecret[VERSION_SZ],
ENCRYPT_LEN - VERSION_SZ);
} else {
#endif
ret = wc_RNG_GenerateBlock(ssl->rng,
&ssl->arrays->preMasterSecret[VERSION_SZ],
SECRET_LEN - VERSION_SZ);
#if defined(WOLFSSL_RENESAS_TSIP_TLS) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_TLS_SESSION)
}
#endif
if (ret != 0) {
goto exit_scke;
}
ssl->arrays->preMasterSecret[0] = ssl->chVersion.major;
ssl->arrays->preMasterSecret[1] = ssl->chVersion.minor;
ssl->arrays->preMasterSecret[0] = ssl->chVersion.major;
ssl->arrays->preMasterSecret[1] = ssl->chVersion.minor;
ssl->arrays->preMasterSz = SECRET_LEN;
break;
}
#endif /* !NO_RSA */
@ -21311,16 +21364,26 @@ int SendClientKeyExchange(WOLFSSL* ssl)
#ifndef NO_RSA
case rsa_kea:
{
ret = RsaEnc(ssl,
ssl->arrays->preMasterSecret, SECRET_LEN,
args->encSecret, &args->encSz,
ssl->peerRsaKey,
#if defined(HAVE_PK_CALLBACKS)
&ssl->buffers.peerRsaKey
#else
NULL
#if defined(WOLFSSL_RENESAS_TSIP_TLS) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_TLS_SESSION)
if (tsip_useable(ssl) &&
wc_RsaEncryptSize(ssl->peerRsaKey) == 256) {
ret = tsip_generateEncryptPreMasterSecret(ssl,
args->encSecret,
&args->encSz);
} else
#endif
);
ret = RsaEnc(ssl,
ssl->arrays->preMasterSecret, SECRET_LEN,
args->encSecret, &args->encSz,
ssl->peerRsaKey,
#if defined(HAVE_PK_CALLBACKS)
&ssl->buffers.peerRsaKey
#else
NULL
#endif
);
break;
}

View File

@ -44,7 +44,10 @@
#endif
#endif
#if defined(WOLFSSL_RENESAS_TSIP_TLS) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_TLS_SESSION)
int tsip_useable(const WOLFSSL *ssl);
#endif
int SetCipherSpecs(WOLFSSL* ssl)
{
#ifndef NO_WOLFSSL_CLIENT
@ -3173,6 +3176,13 @@ int SetKeysSide(WOLFSSL* ssl, enum encrypt_side side)
}
#endif
#if defined(WOLFSSL_RENESAS_TSIP_TLS) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_TLS_SESSION)
/* check if keys for TSIP has been created */
if (tsip_useable(ssl) == 1)
ret = 0;
else
#endif
ret = SetKeys(wc_encrypt, wc_decrypt, keys, &ssl->specs, ssl->options.side,
ssl->heap, ssl->devId, ssl->rng, ssl->options.tls1_3);

View File

@ -107,6 +107,14 @@
#include <wolfssl/wolfcrypt/dh.h>
#endif
#if defined(WOLFSSL_RENESAS_TSIP_TLS)
/* for root ca verification */
int tsip_tls_RootCertVerify(const byte *cert, word32 cert_len,
word32 key_n_start, word32 key_n_len,
word32 key_e_start, word32 key_e_len,
word32 cm_row);
byte tsip_rootCAverified( );
#endif
#ifdef WOLFSSL_SESSION_EXPORT
#ifdef WOLFSSL_DTLS
@ -4540,7 +4548,26 @@ int AddCA(WOLFSSL_CERT_MANAGER* cm, DerBuffer** pDer, int type, int verify)
FreeSigner(signer, cm->heap);
}
}
#if defined(WOLFSSL_RENESAS_TSIP_TLS)
/* Verify CA by TSIP so that generated tsip key is going to be able to */
/* be used for peer's cert verification */
/* TSIP is only able to handle USER CA, and only one CA. */
/* Therefore, it doesn't need to call TSIP again if there is already */
/* verified CA. */
if ( ret == 0 && signer != NULL ) {
signer->cm_idx = row;
if (type == WOLFSSL_USER_CA && tsip_rootCAverified() == 0 ) {
if (ret = tsip_tls_RootCertVerify(cert->source, cert->maxIdx,
cert->sigCtx.pubkey_n_start, cert->sigCtx.pubkey_n_len - 1,
cert->sigCtx.pubkey_e_start, cert->sigCtx.pubkey_e_len - 1,
row/* cm index */)
!= 0)
WOLFSSL_MSG("tsip_tls_RootCertVerify() failed");
else
WOLFSSL_MSG("tsip_tls_RootCertVerify() succeed");
}
}
#endif
WOLFSSL_MSG("\tFreeing Parsed CA");
FreeDecodedCert(cert);
#ifdef WOLFSSL_SMALL_STACK

View File

@ -131,6 +131,16 @@ static int TLSX_PopulateSupportedGroups(WOLFSSL* ssl, TLSX** extensions);
#define HSHASH_SZ FINISHED_SZ
#endif
#ifdef WOLFSSL_RENESAS_TSIP_TLS
int tsip_useable(const WOLFSSL *ssl);
int tsip_generateMasterSecret(const byte *pre,
const byte *cr,const byte *sr,
byte *ms/* out */);
int tsip_generateSeesionKey(WOLFSSL *ssl);
int tsip_generateVerifyData(const byte *ms, const byte *side,
const byte *handshake_hash,
byte *hashes /* out */);
#endif
int BuildTlsHandshakeHash(WOLFSSL* ssl, byte* hash, word32* hashLen)
{
@ -192,6 +202,13 @@ int BuildTlsFinished(WOLFSSL* ssl, Hashes* hashes, const byte* sender)
side = tls_server;
#ifdef WOLFSSL_HAVE_PRF
#if defined(WOLFSSL_RENESAS_TSIP_TLS) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_TLS_SESSION)
if (tsip_useable(ssl)) {
ret = tsip_generateVerifyData(ssl->arrays->tsip_masterSecret,
side, handshake_hash, (byte*)hashes /* out */);
} else
#endif
ret = wc_PRF_TLS((byte*)hashes, TLS_FINISHED_SZ, ssl->arrays->masterSecret,
SECRET_LEN, side, FINISHED_LABEL_SZ, handshake_hash, hashSz,
IsAtLeastTLSv1_2(ssl), ssl->specs.mac_algorithm,
@ -355,7 +372,12 @@ int DeriveTlsKeys(WOLFSSL* ssl)
return MEMORY_E;
}
#endif
#if defined(WOLFSSL_RENESAS_TSIP_TLS) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_TLS_SESSION)
if (tsip_useable(ssl))
ret = tsip_generateSeesionKey(ssl);
else {
#endif
ret = _DeriveTlsKeys(key_dig, key_dig_len,
ssl->arrays->masterSecret, SECRET_LEN,
ssl->arrays->serverRandom, ssl->arrays->clientRandom,
@ -363,6 +385,10 @@ int DeriveTlsKeys(WOLFSSL* ssl)
ssl->heap, ssl->devId);
if (ret == 0)
ret = StoreKeys(ssl, key_dig, PROVISION_CLIENT_SERVER);
#if defined(WOLFSSL_RENESAS_TSIP_TLS) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_TLS_SESSION)
}
#endif
#ifdef WOLFSSL_SMALL_STACK
XFREE(key_dig, ssl->heap, DYNAMIC_TYPE_DIGEST);
@ -503,6 +529,16 @@ int MakeTlsMasterSecret(WOLFSSL* ssl)
else
#endif /* HAVE_EXTENDED_MASTER */
{
#if defined(WOLFSSL_RENESAS_TSIP_TLS) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_TLS_SESSION)
if (tsip_useable(ssl)) {
ret = tsip_generateMasterSecret(
&ssl->arrays->preMasterSecret[VERSION_SZ],
ssl->arrays->clientRandom,
ssl->arrays->serverRandom,
ssl->arrays->tsip_masterSecret);
} else
#endif
ret = _MakeTlsMasterSecret(ssl->arrays->masterSecret, SECRET_LEN,
ssl->arrays->preMasterSecret, ssl->arrays->preMasterSz,
ssl->arrays->clientRandom, ssl->arrays->serverRandom,
@ -1154,7 +1190,21 @@ int TLS_hmac(WOLFSSL* ssl, byte* digest, const byte* in, word32 sz, int padSz,
#endif
wolfSSL_SetTlsHmacInner(ssl, myInner, sz, content, verify);
#if defined(WOLFSSL_RENESAS_TSIP_TLS) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_TLS_SESSION)
if (tsip_useable(ssl)) {
if (ssl->specs.hash_size == WC_SHA_DIGEST_SIZE)
ret = tsip_Sha1Hmac(ssl, myInner, WOLFSSL_TLS_HMAC_INNER_SZ,
in, sz, digest, verify);
else if (ssl->specs.hash_size == WC_SHA256_DIGEST_SIZE)
ret = tsip_Sha256Hmac(ssl, myInner, WOLFSSL_TLS_HMAC_INNER_SZ,
in, sz, digest, verify);
else
ret = TSIP_MAC_DIGSZ_E;
return ret;
}
#endif
ret = wc_HmacInit(&hmac, ssl->heap, ssl->devId);
if (ret != 0)
return ret;
@ -3797,7 +3847,7 @@ static void TLSX_PointFormat_ValidateRequest(WOLFSSL* ssl, byte* semaphore)
static void TLSX_PointFormat_ValidateResponse(WOLFSSL* ssl, byte* semaphore)
{
#if defined(HAVE_FFDHE) || defined(HAVE_ECC) || defined(HAVE_CURVE25519)
(void)semaphore;
(void)semaphore;
#endif
if (ssl->options.cipherSuite0 == TLS13_BYTE)

View File

@ -146,7 +146,16 @@ extern int wc_InitRsaHw(RsaKey* key);
};
#endif
#endif
#ifdef WOLFSSL_RENESAS_TSIP_TLS
WOLFSSL_LOCAL void tsip_inform_key_position(const word32 key_n_start,
const word32 key_n_len, const word32 key_e_start,
const word32 key_e_len);
WOLFSSL_LOCAL int tsip_tls_CertVerify(const byte *cert, word32 certSz,
const byte *signature, word32 sigSz,
word32 key_n_start, word32 key_n_len,
word32 key_e_start, word32 key_e_len,
byte *tsip_encRsaKeyIdx);
#endif
WOLFSSL_LOCAL int GetLength(const byte* input, word32* inOutIdx, int* len,
word32 maxIdx)
{
@ -3959,6 +3968,84 @@ exit_dc:
#ifndef NO_RSA
#ifndef HAVE_USER_RSA
#ifdef WOLFSSL_RENESAS_TSIP
/* This function is to retrieve key position information in a cert.*
* The information will be used to call TSIP TLS-linked API for *
* certificate verification. */
static int RsaPublicKeyDecodeRawIndex(const byte* input, word32* inOutIdx,
word32 inSz, word32* key_n,
word32* key_n_len, word32* key_e,
word32* key_e_len)
{
int ret = 0;
int length = 0;
#if defined(OPENSSL_EXTRA) || defined(RSA_DECODE_EXTRA)
byte b;
#endif
if (input == NULL || inOutIdx == NULL)
return BAD_FUNC_ARG;
if (GetSequence(input, inOutIdx, &length, inSz) < 0)
return ASN_PARSE_E;
#if defined(OPENSSL_EXTRA) || defined(RSA_DECODE_EXTRA)
if ((*inOutIdx + 1) > inSz)
return BUFFER_E;
b = input[*inOutIdx];
if (b != ASN_INTEGER) {
/* not from decoded cert, will have algo id, skip past */
if (GetSequence(input, inOutIdx, &length, inSz) < 0)
return ASN_PARSE_E;
if (SkipObjectId(input, inOutIdx, inSz) < 0)
return ASN_PARSE_E;
/* Option NULL ASN.1 tag */
if (*inOutIdx >= inSz) {
return BUFFER_E;
}
if (input[*inOutIdx] == ASN_TAG_NULL) {
ret = GetASNNull(input, inOutIdx, inSz);
if (ret != 0)
return ret;
}
/* should have bit tag length and seq next */
ret = CheckBitString(input, inOutIdx, NULL, inSz, 1, NULL);
if (ret != 0)
return ret;
if (GetSequence(input, inOutIdx, &length, inSz) < 0)
return ASN_PARSE_E;
}
#endif /* OPENSSL_EXTRA */
/* Get modulus */
ret = GetASNInt(input, inOutIdx, &length, inSz);
*key_n += *inOutIdx;
if (ret < 0) {
return ASN_RSA_KEY_E;
}
if (key_n_len)
*key_n_len = length;
*inOutIdx += length;
/* Get exponent */
ret = GetASNInt(input, inOutIdx, &length, inSz);
*key_e += *inOutIdx;
if (ret < 0) {
return ASN_RSA_KEY_E;
}
if (key_e_len)
*key_e_len = length;
return ret;
}
#endif /* WOLFSSL_RENESAS_TSIP */
int wc_RsaPublicKeyDecode_ex(const byte* input, word32* inOutIdx, word32 inSz,
const byte** n, word32* nSz, const byte** e, word32* eSz)
{
@ -4405,6 +4492,10 @@ void FreeDecodedCert(DecodedCert* cert)
if (cert->subjectName.fullName != NULL)
XFREE(cert->subjectName.fullName, cert->heap, DYNAMIC_TYPE_X509);
#endif /* OPENSSL_EXTRA */
#ifdef WOLFSSL_RENESAS_TSIP_TLS
if (cert->tsip_encRsaKeyIdx != NULL)
XFREE(cert->tsip_encRsaKeyIdx, cert->heap, DYNAMIC_TYPE_RSA);
#endif
#ifndef NO_CERTS
FreeSignatureCtx(&cert->sigCtx);
#endif
@ -4449,7 +4540,9 @@ static int StoreRsaKey(DecodedCert* cert, word32 bitStringEnd)
while (recvd--)
cert->srcIdx--;
#if defined(WOLFSSL_RENESAS_TSIP)
cert->sigCtx.pubkey_n_start = cert->sigCtx.pubkey_e_start = cert->srcIdx;
#endif
cert->pubKeySize = length;
cert->publicKey = cert->source + cert->srcIdx;
cert->srcIdx += length;
@ -6264,10 +6357,12 @@ static int HashForSignature(const byte* buf, word32 bufSz, word32 sigOID,
static int ConfirmSignature(SignatureCtx* sigCtx,
const byte* buf, word32 bufSz,
const byte* key, word32 keySz, word32 keyOID,
const byte* sig, word32 sigSz, word32 sigOID)
const byte* sig, word32 sigSz, word32 sigOID, byte* rsaKeyIdx)
{
int ret = 0;
#ifndef WOLFSSL_RENESAS_TSIP_TLS
(void)rsaKeyIdx;
#endif
if (sigCtx == NULL || buf == NULL || bufSz == 0 || key == NULL ||
keySz == 0 || sig == NULL || sigSz == 0) {
return BAD_FUNC_ARG;
@ -6435,6 +6530,26 @@ static int ConfirmSignature(SignatureCtx* sigCtx,
else
#endif /* HAVE_PK_CALLBACKS */
{
#ifdef WOLFSSL_RENESAS_TSIP_TLS
if (rsaKeyIdx != NULL)
{
ret = tsip_tls_CertVerify(buf, bufSz, sigCtx->plain,
sigSz,
sigCtx->pubkey_n_start - sigCtx->certBegin,
sigCtx->pubkey_n_len - 1,
sigCtx->pubkey_e_start - sigCtx->certBegin,
sigCtx->pubkey_e_len - 1,
rsaKeyIdx);
if (ret == 0){
sigCtx->verifyByTSIP = 1;
ret = 0;
} else {
WOLFSSL_MSG("RSA Verify by tsip didn't match");
ret = ASN_SIG_CONFIRM_E;
}
} else
#endif
ret = wc_RsaSSL_VerifyInline(sigCtx->plain, sigSz,
&sigCtx->out, sigCtx->key.rsa);
}
@ -6497,6 +6612,9 @@ static int ConfirmSignature(SignatureCtx* sigCtx,
case RSAk:
{
int encodedSigSz, verifySz;
#ifdef WOLFSSL_RENESAS_TSIP
if (sigCtx->verifyByTSIP == 1) break;
#endif
#ifdef WOLFSSL_SMALL_STACK
byte* encodedSig = (byte*)XMALLOC(MAX_ENCODED_SIG_SZ,
sigCtx->heap, DYNAMIC_TYPE_TMP_BUFFER);
@ -8277,13 +8395,13 @@ static int CheckCertSignature_ex(const byte* cert, word32 certSz, void* heap,
ret = ConfirmSignature(sigCtx, cert + tbsCertIdx,
sigIndex - tbsCertIdx,
pubKey, pubKeySz, pubKeyOID,
cert + idx, len, signatureOID);
cert + idx, len, signatureOID, NULL);
}
else {
ret = ConfirmSignature(sigCtx, cert + tbsCertIdx,
sigIndex - tbsCertIdx,
ca->publicKey, ca->pubKeySize, ca->keyOID,
cert + idx, len, signatureOID);
cert + idx, len, signatureOID, NULL);
}
if (ret != 0) {
WOLFSSL_MSG("Confirm signature failed");
@ -8324,7 +8442,9 @@ int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm)
int badDate = 0;
int criticalExt = 0;
word32 confirmOID;
#if defined(WOLFSSL_RENESAS_TSIP)
int idx = 0;
#endif
if (cert == NULL) {
return BAD_FUNC_ARG;
}
@ -8458,6 +8578,49 @@ int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm)
}
}
}
#if defined(WOLFSSL_RENESAS_TSIP)
/* prepare for TSIP TLS cert verification API use */
if (cert->keyOID == RSAk) {
/* to call TSIP API, it needs keys position info in bytes */
if (ret = RsaPublicKeyDecodeRawIndex(cert->publicKey, (word32*)&idx,
cert->pubKeySize,
&cert->sigCtx.pubkey_n_start,
&cert->sigCtx.pubkey_n_len,
&cert->sigCtx.pubkey_e_start,
&cert->sigCtx.pubkey_e_len) != 0) {
WOLFSSL_MSG("Decoding index from cert failed.");
return ret;
}
cert->sigCtx.certBegin = cert->certBegin;
}
/* check if we can use TSIP for cert verification */
/* if the ca is verified as tsip root ca. */
/* TSIP can only handle 2048 bits(256 byte) key. */
if (cert->ca && tsip_checkCA(cert->ca->cm_idx) != 0 &&
cert->sigCtx.pubkey_n_len == 256) {
/* assign memory to encrypted tsip Rsa key index */
if (!cert->tsip_encRsaKeyIdx)
cert->tsip_encRsaKeyIdx =
(byte*)XMALLOC(TSIP_TLS_ENCPUBKEY_SZ_BY_CERTVRFY,
cert->heap, DYNAMIC_TYPE_RSA);
if (cert->tsip_encRsaKeyIdx == NULL)
return MEMORY_E;
} else {
if (cert->ca) {
/* TSIP isn't usable */
if (tsip_checkCA(cert->ca->cm_idx) == 0)
WOLFSSL_MSG("TSIP isn't usable because the ca isn't verified by TSIP.");
else if (cert->sigCtx.pubkey_n_len != 256)
WOLFSSL_MSG("TSIP isn't usable because the ca isn't signed by RSA 2048.");
else
WOLFSSL_MSG("TSIP isn't usable");
}
#endif
cert->tsip_encRsaKeyIdx = NULL;
#if defined(WOLFSSL_RENESAS_TSIP)
}
#endif
if (verify != NO_VERIFY && type != CA_TYPE && type != TRUSTED_PEER_TYPE) {
if (cert->ca) {
@ -8469,7 +8632,8 @@ int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm)
cert->sigIndex - cert->certBegin,
cert->ca->publicKey, cert->ca->pubKeySize,
cert->ca->keyOID, cert->signature,
cert->sigLength, cert->signatureOID)) != 0) {
cert->sigLength, cert->signatureOID,
cert->tsip_encRsaKeyIdx)) != 0) {
if (ret != 0 && ret != WC_PENDING_E) {
WOLFSSL_MSG("Confirm signature failed");
}
@ -14876,7 +15040,8 @@ static int DecodeBasicOcspResponse(byte* source, word32* ioIndex,
ret = ConfirmSignature(&cert.sigCtx,
resp->response, resp->responseSz,
cert.publicKey, cert.pubKeySize, cert.keyOID,
resp->sig, resp->sigSz, resp->sigOID);
resp->sig, resp->sigSz, resp->sigOID, NULL);
FreeDecodedCert(&cert);
if (ret != 0) {
@ -14903,7 +15068,7 @@ static int DecodeBasicOcspResponse(byte* source, word32* ioIndex,
/* ConfirmSignature is blocking here */
sigValid = ConfirmSignature(&sigCtx, resp->response,
resp->responseSz, ca->publicKey, ca->pubKeySize, ca->keyOID,
resp->sig, resp->sigSz, resp->sigOID);
resp->sig, resp->sigSz, resp->sigOID, NULL);
}
if (ca == NULL || sigValid != 0) {
WOLFSSL_MSG("\tOCSP Confirm signature failed");
@ -15419,7 +15584,7 @@ int VerifyCRL_Signature(SignatureCtx* sigCtx, const byte* toBeSigned,
InitSignatureCtx(sigCtx, heap, INVALID_DEVID);
if (ConfirmSignature(sigCtx, toBeSigned, tbsSz, ca->publicKey,
ca->pubKeySize, ca->keyOID, signature, sigSz,
signatureOID) != 0) {
signatureOID, NULL) != 0) {
WOLFSSL_MSG("CRL Confirm signature failed");
return ASN_CRL_CONFIRM_E;
}

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

@ -0,0 +1,159 @@
# TSIP FIT Module port
Support for TSIP FIT driver for symmetric AES, SHA1/SHA256 hardware acceleration and TLS-linked capability including Root CA, the server certificate or intermediate certificate verification.
## Overview
Renesas TSIP FIT module with wolfSSL by setting *WOLFSSL_RENESAS_TSIP* definition.
Including the following examples:
* simple tls_client/tls_server
* crypt test
* crypt benchmark
The *user_settings.h* file enables some of the hardened settings.
## 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)
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)
### 3. Evaluation Board that supports TSIP
Note : The included example program is tested with [GR-ROSE](http://gadget.renesas.com/en/product/rose.html), which is classified to RX65N.
## Setup and Build wolfSSL library
1. Uncomment out #define WOLFSSL_RENESAS_TSIP in /path/to/wolfssl/wolfssl/wolfcrypt/settings.h
Uncomment out #define WOLFSSL_RENESAS_RX65N in /path/to/wolfssl/wolfssl/wolfcrypt/settings.h
2. Open a project file at /path/to/wolfssl/IDE/Renesas/e2studio/Projects/wolfssl/ by e2studio and build to create wolfssl library
To disable portions of the hardware acceleration you can optionally define:
```
/* Disabled SHA acceleration */
#define NO_WOLFSSL_RENESAS_TSIP_CRYPT_HASH
/* Disabled TLS-linked acceleration */
#define NO_WOLFSSL_RENESAS_TSIP_TLS_SESSION
```
### Benchmarks
**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
## Setup and Build an example program
An example program expects the following FIT modules:
* r_bsp
* r_cmt_rx
* r_config
* r_ether_rx
* r_sys_time_rx
* r_t4_driver_rx
* r_t4_rx
* r_tsip_rx
These needed source files can be generated by creating a dummy project including Renesas Smart Configurator as steps below:
1. Create a dummy project including Renesas Smart Configurator for your evaluation board type
2. Open Smart Configurator and add FIT modules above
It would need to expand *User Stack Size* property and *Heap Size* of r_bsp.
Change IP ADDRESS and PORT NUMBER in r_t4_rx_config.h
`#define T4_CFG_FIXED_IP_ADDRESS_CH0 192,168,1,33`
`#define T4_CFG_TCP_REPID1_PORT_NUMBER 11111`
Note: It would need to modify other configuration base on evaluation board.
3. Generate source code
Now, it is able to copy these FIT modules into an example project.
4. Make "smc_gen" folder under /path/to/wolfssl/IDE/Renesas/e2studio/Projects/test/src/
5. Copy the FIT modules into the folder that is created at step 4.
6. Open an example project file at /path/to/wolfssl/IDE/Renesas/e2studio/Projects/test/ by e2studio
7. Enable a macro definition in /path/to/wolfssl/IDE/Renesas/e2studio/Projects/test/src/wolfssl_demo.h for application type
`#define CRYPT_TEST // enable crypt test`
`#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 // 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.
### Create flash keyring and use it in an example program
1. Please follow the instruction at TSIP manual, chapter 7. Key Data Operations.
2. Copy and paste s_flash[] data to s_flash[] data in example-program/key_data.c
`const uint32_t s_flash[] =`
### Create RSA key pair for signing Root CA verification and use them in an example program
To use TSIP TLS-linked APIs, it needs RSA key pair and Root CA certificate bundle signature by RSA 2048 PSS with SHA256.
Shell and Perl script program in /path/to/wolfssl/IDE/Renesas/e2studio/Projects/tools/ can be used for the purpose.
* generate_rsa_keypair.sh : generate RSA 2048 bit key pair. Show modulus and public exponent when specifying "-s" option
* rsa_pss_sign.sh : sign the file by the specified private key
* genhexbuf.pl : generate C header file including a byte array generated from the specified file in the script
Modulus and public exponent showed by `generate_rsa_keypair.sh` can be used for input date to Renesas Secure Flash Programmer to generate encrypted RSA keys for TSIP TLS-linked API use. Please follow the instruction about how to generate RSA keys in the TSIP manual.
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 see SetTsipTlskey() function an example program about how to inform them.
### Coding
In your application you must include <wolfssl/wolfcrypt/settings.h> before any other wolfSSL headers. If building the sources directly we recommend defining `WOLFSSL_USER_SETTINGS` and adding your own `user_settings.h` file. You can find a good reference for this in `/path/to/Renesas/e2studio/Projects/common/user_settings.h`.
## Support
For question please email [support@wolfssl.com]

View File

@ -0,0 +1,156 @@
/* renesas_tsip_aes.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 <string.h>
#include <stdio.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#include <stdio.h>
#ifndef NO_AES
#if defined(WOLFSSL_RENESAS_TSIP_CRYPT) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_CRYPT_AES)
#include <wolfssl/wolfcrypt/wc_port.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
#include <wolfssl/wolfcrypt/aes.h>
#include "wolfssl/wolfcrypt/port/Renesas/renesas-tsip-crypt.h"
struct Aes;
int wc_tsip_AesCbcEncrypt(struct Aes* aes, byte* out, const byte* in, word32 sz)
{
tsip_aes_handle_t _handle;
word32 ret;
word32 blocks = (sz / AES_BLOCK_SIZE);
uint32_t dataLength;
byte *iv;
if ((in == NULL) || (out == NULL) || (aes == NULL))
return BAD_FUNC_ARG;
/* while doing TLS handshake, TSIP driver keeps true-key and iv *
* on the device. iv is dummy */
iv = (uint8_t*)aes->reg;
if((ret = tsip_hw_lock()) != 0){
WOLFSSL_MSG("Failed to lock");
return ret;
}
if (aes->ctx.keySize == 16) {
ret = R_TSIP_Aes128CbcEncryptInit(&_handle, &aes->ctx.tsip_keyIdx, iv);
} else if (aes->ctx.keySize == 32) {
ret = R_TSIP_Aes256CbcEncryptInit(&_handle, &aes->ctx.tsip_keyIdx, iv);
} else {
tsip_hw_unlock();
return -1;
}
while (ret == TSIP_SUCCESS && blocks--) {
if (aes->ctx.keySize == 16)
ret = R_TSIP_Aes128CbcEncryptUpdate(&_handle, (uint8_t*)in,
(uint8_t*)out, (uint32_t)AES_BLOCK_SIZE);
else
ret = R_TSIP_Aes256CbcEncryptUpdate(&_handle, (uint8_t*)in,
(uint8_t*)out, (uint32_t)AES_BLOCK_SIZE);
in += AES_BLOCK_SIZE;
out += AES_BLOCK_SIZE;
}
if (ret == TSIP_SUCCESS) {
if (aes->ctx.keySize == 16) {
ret = R_TSIP_Aes128CbcEncryptFinal(&_handle, out, &dataLength);
} else {
ret = R_TSIP_Aes256CbcEncryptFinal(&_handle, out, &dataLength);
}
} else {
WOLFSSL_MSG("TSIP AES CBC encryption failed");
ret = -1;
}
tsip_hw_unlock();
return ret;
}
int wc_tsip_AesCbcDecrypt(struct Aes* aes, byte* out, const byte* in, word32 sz)
{
tsip_aes_handle_t _handle;
word32 ret;
word32 blocks = (sz / AES_BLOCK_SIZE);
uint32_t dataLength;
byte *iv;
if ((in == NULL) || (out == NULL) || (aes == NULL))
return BAD_FUNC_ARG;
iv = (uint8_t*)aes->reg;
if((ret = tsip_hw_lock()) != 0){
WOLFSSL_MSG("Failed to lock");
return ret;
}
if (aes->ctx.keySize == 16) {
ret = R_TSIP_Aes128CbcDecryptInit(&_handle, &aes->ctx.tsip_keyIdx, iv);
} else if (aes->ctx.keySize == 32) {
ret = R_TSIP_Aes256CbcDecryptInit(&_handle, &aes->ctx.tsip_keyIdx, iv);
} else {
tsip_hw_unlock();
return -1;
}
while (ret == TSIP_SUCCESS && blocks--) {
if (aes->ctx.keySize == 16)
ret = R_TSIP_Aes128CbcDecryptUpdate(&_handle, (uint8_t*)in,
(uint8_t*)out, (uint32_t)AES_BLOCK_SIZE);
else
ret = R_TSIP_Aes256CbcDecryptUpdate(&_handle, (uint8_t*)in,
(uint8_t*)out, (uint32_t)AES_BLOCK_SIZE);
in += AES_BLOCK_SIZE;
out += AES_BLOCK_SIZE;
}
if (ret == TSIP_SUCCESS) {
if (aes->ctx.keySize == 16)
ret = R_TSIP_Aes128CbcDecryptFinal(&_handle, out, &dataLength);
else
ret = R_TSIP_Aes256CbcDecryptFinal(&_handle, out, &dataLength);
} else {
WOLFSSL_MSG("TSIP AES CBC decryption failed");
ret = -1;
}
tsip_hw_unlock();
return ret;
}
#endif /* WOLFSSL_RENESAS_TSIP_CRYPT */
#endif /* NO_AES */

View File

@ -0,0 +1,274 @@
/* renesas_tsip_sha.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 <string.h>
#include <stdio.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#if !defined(NO_SHA) || !defined(NO_SHA256)
#include <wolfssl/wolfcrypt/logging.h>
#if defined(WOLFSSL_RENESAS_TSIP_CRYPT)
#include <wolfssl/wolfcrypt/error-crypt.h>
#include <wolfssl/wolfcrypt/port/Renesas/renesas-tsip-crypt.h>
#if !defined(NO_SHA)
#include <wolfssl/wolfcrypt/sha.h>
static void TSIPHashFree(wolfssl_TSIP_Hash* hash)
{
if (hash == NULL)
return;
if (hash->msg != NULL) {
XFREE(hash->msg, hash->heap, DYNAMIC_TYPE_TMP_BUFFER);
hash->msg = NULL;
}
}
static int TSIPHashInit(wolfssl_TSIP_Hash* hash, void* heap, int devId,
word32 sha_type)
{
if (hash == NULL) {
return BAD_FUNC_ARG;
}
(void)devId;
XMEMSET(hash, 0, sizeof(wolfssl_TSIP_Hash));
hash->heap = heap;
hash->len = 0;
hash->used = 0;
hash->msg = NULL;
hash->sha_type = sha_type;
return 0;
}
static int TSIPHashUpdate(wolfssl_TSIP_Hash* hash, const byte* data, word32 sz)
{
if (hash == NULL || (sz > 0 && data == NULL)) {
return BAD_FUNC_ARG;
}
if (hash->len < hash->used + sz) {
if (hash->msg == NULL) {
hash->msg = (byte*)XMALLOC(hash->used + sz, hash->heap,
DYNAMIC_TYPE_TMP_BUFFER);
} else {
#ifdef FREERTOS
byte* pt = (byte*)XMALLOC(hash->used + sz, hash->heap,
DYNAMIC_TYPE_TMP_BUFFER);
if (pt == NULL) {
return MEMORY_E;
}
XMEMCPY(pt, hash->msg, hash->used);
XFREE(hash->msg, hash->heap, DYNAMIC_TYPE_TMP_BUFFER);
hash->msg = NULL;
hash->msg = pt;
#else
byte* pt = (byte*)XREALLOC(hash->msg, hash->used + sz, hash->heap,
DYNAMIC_TYPE_TMP_BUFFER);
if (pt == NULL) {
return MEMORY_E;
}
hash->msg = pt;
#endif
}
if (hash->msg == NULL) {
return MEMORY_E;
}
hash->len = hash->used + sz;
}
XMEMCPY(hash->msg + hash->used, data , sz);
hash->used += sz;
return 0;
}
static int TSIPHashFinal(wolfssl_TSIP_Hash* hash, byte* out, word32 outSz)
{
int ret;
void* heap;
tsip_sha_md5_handle_t handle;
uint32_t sz;
e_tsip_err_t (*Init)(tsip_sha_md5_handle_t*);
e_tsip_err_t (*Update)(tsip_sha_md5_handle_t*, uint8_t*, uint32_t);
e_tsip_err_t (*Final )(tsip_sha_md5_handle_t*, uint8_t*, uint32_t*);
if (hash == NULL || out == NULL) {
return BAD_FUNC_ARG;
}
if (hash->sha_type == TSIP_SHA1) {
Init = R_TSIP_Sha1Init;
Update = R_TSIP_Sha1Update;
Final = R_TSIP_Sha1Final;
} else if (hash->sha_type == TSIP_SHA256) {
Init = R_TSIP_Sha256Init;
Update = R_TSIP_Sha256Update;
Final = R_TSIP_Sha256Final;
} else
return BAD_FUNC_ARG;
heap = hash->heap;
tsip_hw_lock();
if (Init(&handle) == TSIP_SUCCESS) {
ret = Update(&handle, (uint8_t*)hash->msg, hash->used);
if (ret == TSIP_SUCCESS) {
ret = Final(&handle, out, (uint32_t*)&sz);
if (ret != TSIP_SUCCESS || sz != outSz) {
return ret;
}
}
}
tsip_hw_unlock();
TSIPHashFree(hash);
return TSIPHashInit(hash, heap, 0, hash->sha_type);
}
static int TSIPHashGet(wolfssl_TSIP_Hash* hash, byte* out, word32 outSz)
{
int ret;
tsip_sha_md5_handle_t handle;
uint32_t sz;
e_tsip_err_t (*Init)(tsip_sha_md5_handle_t*);
e_tsip_err_t (*Update)(tsip_sha_md5_handle_t*, uint8_t*, uint32_t);
e_tsip_err_t (*Final )(tsip_sha_md5_handle_t*, uint8_t*, uint32_t*);
if (hash == NULL || out == NULL) {
return BAD_FUNC_ARG;
}
if (hash->sha_type == TSIP_SHA1) {
Init = R_TSIP_Sha1Init;
Update = R_TSIP_Sha1Update;
Final = R_TSIP_Sha1Final;
} else if (hash->sha_type == TSIP_SHA256) {
Init = R_TSIP_Sha256Init;
Update = R_TSIP_Sha256Update;
Final = R_TSIP_Sha256Final;
} else
return BAD_FUNC_ARG;
tsip_hw_lock();
if (Init(&handle) == TSIP_SUCCESS) {
ret = Update(&handle, (uint8_t*)hash->msg, hash->used);
if (ret == TSIP_SUCCESS) {
ret = Final(&handle, out, &sz);
if (ret != TSIP_SUCCESS || sz != outSz) {
return ret;
}
}
}
tsip_hw_unlock();
return 0;
}
static int TSIPHashCopy(wolfssl_TSIP_Hash* src, wolfssl_TSIP_Hash* dst)
{
if (src == NULL || dst == NULL) {
return BAD_FUNC_ARG;
}
XMEMCPY(dst, src, sizeof(wolfssl_TSIP_Hash));
if (src->len > 0 && src->msg != NULL) {
dst->msg = (byte*)XMALLOC(src->len, dst->heap, DYNAMIC_TYPE_TMP_BUFFER);
if (dst->msg == NULL) {
return MEMORY_E;
}
XMEMCPY(dst->msg, src->msg, src->len);
}
return 0;
}
/* */
int wc_InitSha_ex(wc_Sha* sha, void* heap, int devId)
{
return TSIPHashInit(sha, heap, devId, TSIP_SHA1);
}
int wc_ShaUpdate(wc_Sha* sha, const byte* in, word32 sz)
{
return TSIPHashUpdate(sha, in, sz);
}
int wc_ShaFinal(wc_Sha* sha, byte* hash)
{
return TSIPHashFinal(sha, hash, WC_SHA_DIGEST_SIZE);
}
int wc_ShaGetHash(wc_Sha* sha, byte* hash)
{
return TSIPHashGet(sha, hash, WC_SHA_DIGEST_SIZE);
}
int wc_ShaCopy(wc_Sha256* src, wc_Sha256* dst)
{
return TSIPHashCopy(src, dst);
}
#endif /* !NO_SHA */
#if !defined(NO_SHA256)
#include <wolfssl/wolfcrypt/sha256.h>
/* */
int wc_InitSha256_ex(wc_Sha256* sha, void* heap, int devId)
{
return TSIPHashInit(sha, heap, devId, TSIP_SHA256);
}
int wc_Sha256Update(wc_Sha256* sha, const byte* in, word32 sz)
{
return TSIPHashUpdate(sha, in, sz);
}
int wc_Sha256Final(wc_Sha256* sha, byte* hash)
{
return TSIPHashFinal(sha, hash, WC_SHA256_DIGEST_SIZE);
}
int wc_Sha256GetHash(wc_Sha256* sha, byte* hash)
{
return TSIPHashGet(sha, hash, WC_SHA256_DIGEST_SIZE);
}
int wc_Sha256Copy(wc_Sha256* src, wc_Sha256* dst)
{
return TSIPHashCopy(src, dst);
}
#endif /* !NO_SHA256 */
#endif /* WOLFSSL_RENESAS_TSIP_CRYPT */
#endif /* #if !defined(NO_SHA) || !defined(NO_SHA256) */

View File

@ -0,0 +1,717 @@
/* renesas_tsip_util.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 <wolfssl/wolfcrypt/settings.h>
#if defined(WOLFSSL_RENESAS_TSIP)
#include <wolfssl/wolfcrypt/wc_port.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
#include <wolfssl/wolfcrypt/port/Renesas/renesas-tsip-crypt.h>
#include <wolfssl/wolfcrypt/memory.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
#include <wolfssl/wolfcrypt/aes.h>
#include <wolfssl/ssl.h>
#include <wolfssl/internal.h>
#include <stdio.h>
/* mutex */
wolfSSL_Mutex tsip_mutex;
static int tsip_CryptHwMutexInit_ = 0;
/* ./ca-cert.der.sign, */
/* expect to have these variables defined at user application */
extern uint32_t s_flash[];
extern uint32_t s_inst1[R_TSIP_SINST_WORD_SIZE];
extern uint32_t s_inst2[R_TSIP_SINST2_WORD_SIZE];
static const byte *ca_cert_sig;
/* user key */
static tsip_key_data g_user_key_info;
/* tsip only keep one encrypted ca public key */
#if defined(WOLFSSL_RENESAS_TSIP_TLS)
static uint32_t g_encrypted_publicCA_key[R_TSIP_SINST_WORD_SIZE];
static uint32_t g_CAscm_Idx; /* index of CM table */
#endif
static int tsip_CryptHwMutexInit(wolfSSL_Mutex* mutex) {
return wc_InitMutex(mutex);
}
static int tsip_CryptHwMutexLock(wolfSSL_Mutex* mutex) {
return wc_LockMutex(mutex);
}
static int tsip_CryptHwMutexUnLock(wolfSSL_Mutex* mutex) {
return wc_UnLockMutex(mutex);
}
/*
* lock hw engine.
* this should be called before using engine.
*/
int tsip_hw_lock()
{
int ret = 0;
WOLFSSL_MSG("enter esp_sha_hw_lock");
if(tsip_CryptHwMutexInit_ == 0){
ret = tsip_CryptHwMutexInit(&tsip_mutex);
if(ret == 0) {
tsip_CryptHwMutexInit_ = 1;
} else {
WOLFSSL_MSG(" mutex initialization failed.");
return -1;
}
}
if(tsip_CryptHwMutexLock(&tsip_mutex) != 0) {
/* this should not happens */
return -1;
}
WOLFSSL_MSG("leave tsip_sha_try_hw_lock");
return ret;
}
/*
* release hw engine
*/
void tsip_hw_unlock( void )
{
WOLFSSL_MSG("enter tsip_hw_unlock");
/* unlock hw engine for next use */
tsip_CryptHwMutexUnLock(&tsip_mutex);
WOLFSSL_MSG("leave tsip_hw_unlock");
}
/* check if tsip tls functions can be used for the cipher */
/* cipher0 : in the some cipher suite, */
/* first byte becomes greater than 0, otherwise 0x00 */
/* side : CLIENT END or SEVER END */
int tsip_useable(const struct WOLFSSL *ssl)
{
byte cipher0;
byte cipher;
byte side;
/* sanity check */
if (ssl == NULL)
return BAD_FUNC_ARG;
/* when rsa key index == NULL, tsip isn't used for cert verification. */
/* in the case, we cannot use TSIP. */
if (!ssl->peerTsipEncRsaKeyIndex)
return 0;
/* when enabled Extended Master Secret, we cannot use TSIP. */
if (ssl->options.haveEMS)
return 0;
cipher0 = ssl->options.cipherSuite0;
cipher = ssl->options.cipherSuite;
side = ssl->options.side;
if (cipher0 > 0x00)
return 0;
if ((cipher == l_TLS_RSA_WITH_AES_128_CBC_SHA ||
cipher == l_TLS_RSA_WITH_AES_128_CBC_SHA256 ||
cipher == l_TLS_RSA_WITH_AES_256_CBC_SHA ||
cipher == l_TLS_RSA_WITH_AES_256_CBC_SHA256) &&
side == WOLFSSL_CLIENT_END)
return 1;
else
return 0;
}
/* check if the g_alreadyVerified CA's key can be used for *
* peer's certification */
byte tsip_checkCA(word32 cmIdx)
{
return (cmIdx == g_CAscm_Idx? 1:0);
}
/* check if tht root CA has been verified by TSIP, *
* and it exists in the CM table. */
byte tsip_rootCAverified( )
{
return (g_CAscm_Idx != (uint32_t)-1 ? 1:0);
}
/* open TSIP driver for use */
int tsip_Open( ) {
int ret;
if ((ret = tsip_hw_lock()) == 0) {
/* open the TSIP */
ret = R_TSIP_Open((uint32_t*)s_flash, s_inst1, s_inst2);
if( ret != TSIP_SUCCESS ) {
WOLFSSL_MSG("RENESAS TSIP Open failed");
}
#if defined(WOLFSSL_RENESAS_TSIP_TLS)
/* generate TLS Rsa public key for Certificate verification */
if (ret == TSIP_SUCCESS && g_user_key_info.encrypted_user_tls_key) {
ret = R_TSIP_GenerateTlsRsaPublicKeyIndex(
g_user_key_info.encrypted_session_key,
g_user_key_info.iv,
g_user_key_info.encrypted_user_tls_key,
&g_user_key_info.user_rsa2048_tls_pubindex);
if (ret != TSIP_SUCCESS) {
WOLFSSL_MSG("R_TSIP_GenerateTlsRsaPublicKeyIndex failed");
} else {
/* close once */
tsip_Close( );
/* open again with s_inst[] */
XMEMCPY(s_inst1,
g_user_key_info.user_rsa2048_tls_pubindex.value,
sizeof(s_inst1));
ret = R_TSIP_Open((uint32_t*)s_flash, s_inst1, s_inst2);
if (ret != TSIP_SUCCESS) {
WOLFSSL_MSG("R_TSIP_(Re)Open failed");
}
/* init vars */
g_CAscm_Idx = (uint32_t)-1;
}
}
#endif
/* unlock hw */
tsip_hw_unlock();
} else
WOLFSSL_MSG("Failed to lock tsip hw \n");
return ret;
}
/* close TSIP driver */
void tsip_Close( ) {
int ret;
if ((ret = tsip_hw_lock()) == 0) {
/* close TSIP */
ret = R_TSIP_Close();
#if defined(WOLFSSL_RENESAS_TSIP_TLS)
g_CAscm_Idx = (uint32_t)-1;
#endif
/* unlock hw */
tsip_hw_unlock();
if( ret != TSIP_SUCCESS ) {
WOLFSSL_MSG("RENESAS TSIP Close failed");
}
} else
WOLFSSL_MSG("Failed to unlock tsip hw \n");
}
/* Support functions for TSIP TLS Capability */
#if defined(WOLFSSL_RENESAS_TSIP_TLS)
/* to inform ca certificate sign */
/* signature format expects RSA 2048 PSS with SHA256 */
void tsip_inform_cert_sign(const byte *sign)
{
if(sign)
ca_cert_sig = sign;
}
/* inform user key */
/* the function expects to be called from user application */
/* user has to create these key information by Renesas tool in advance.*/
void tsip_inform_user_keys(
byte *encrypted_session_key,
byte *iv,
byte *encrypted_user_tls_key
)
{
g_user_key_info.encrypted_session_key = NULL;
g_user_key_info.iv = NULL;
g_user_key_info.encrypted_user_tls_key = NULL;
if ( encrypted_session_key ) {
g_user_key_info.encrypted_session_key = encrypted_session_key;
}
if ( iv ) {
g_user_key_info.iv = iv;
}
if ( encrypted_user_tls_key ) {
g_user_key_info.encrypted_user_tls_key = encrypted_user_tls_key;
}
}
#ifndef NO_WOLFSSL_RENESAS_TSIP_TLS_SESSION
/* convert def to tsip define */
static byte _tls2tsipdef(byte cipher)
{
byte def = R_TSIP_TLS_RSA_WITH_AES_128_CBC_SHA;
switch(cipher){
case l_TLS_RSA_WITH_AES_128_CBC_SHA:
break;
case l_TLS_RSA_WITH_AES_128_CBC_SHA256:
def = R_TSIP_TLS_RSA_WITH_AES_128_CBC_SHA256;
break;
case l_TLS_RSA_WITH_AES_256_CBC_SHA:
def = R_TSIP_TLS_RSA_WITH_AES_256_CBC_SHA;
break;
case l_TLS_RSA_WITH_AES_256_CBC_SHA256:
def = R_TSIP_TLS_RSA_WITH_AES_256_CBC_SHA256;
break;
default:break;
}
return def;
}
/* Sha1Hmac */
int tsip_Sha1Hmac(const struct WOLFSSL *ssl, const byte *myInner,
word32 innerSz, const byte *in, word32 sz, byte *digest,
word32 verify)
{
tsip_hmac_sha_handle_t _handle;
tsip_hmac_sha_key_index_t key_index;
int ret;
if ((ssl == NULL) || (myInner == NULL) || (in == NULL) ||
(digest == NULL))
return BAD_FUNC_ARG;
if ((ret = tsip_hw_lock()) != 0) {
WOLFSSL_MSG("hw lock failed\n");
return ret;
}
if ( (ssl->options.side == WOLFSSL_CLIENT_END && !verify) ||
(ssl->options.side == WOLFSSL_SERVER_END && verify) )
XMEMCPY(key_index.value, ssl->keys.tsip_client_write_MAC_secret,
sizeof(key_index.value));
else
XMEMCPY(key_index.value, ssl->keys.tsip_server_write_MAC_secret,
sizeof(key_index.value));
ret = R_TSIP_Sha1HmacGenerateInit(&_handle, &key_index);
if (ret == TSIP_SUCCESS)
ret = R_TSIP_Sha1HmacGenerateUpdate(&_handle, (uint8_t*)myInner,
(uint32_t)innerSz);
if (ret == TSIP_SUCCESS)
ret = R_TSIP_Sha1HmacGenerateUpdate(&_handle, (uint8_t*)in, sz);
if (ret == TSIP_SUCCESS)
ret = R_TSIP_Sha1HmacGenerateFinal(&_handle, digest);
/* unlock hw */
tsip_hw_unlock();
return ret;
}
/* Sha256Hmac */
int tsip_Sha256Hmac(const struct WOLFSSL *ssl, const byte *myInner,
word32 innerSz, const byte *in, word32 sz, byte *digest,
word32 verify)
{
tsip_hmac_sha_handle_t _handle;
tsip_hmac_sha_key_index_t key_index;
int ret;
if ((ssl == NULL) || (myInner == NULL) || (in == NULL) ||
(digest == NULL))
return BAD_FUNC_ARG;
if ( (ssl->options.side == WOLFSSL_CLIENT_END && !verify) ||
(ssl->options.side == WOLFSSL_SERVER_END && verify) )
XMEMCPY(key_index.value, ssl->keys.tsip_client_write_MAC_secret,
sizeof(key_index.value));
else
XMEMCPY(key_index.value, ssl->keys.tsip_server_write_MAC_secret,
sizeof(key_index.value));
if ((ret = tsip_hw_lock()) != 0) {
WOLFSSL_MSG("hw lock failed\n");
return ret;
}
ret = R_TSIP_Sha256HmacGenerateInit(&_handle, &key_index);
if (ret == TSIP_SUCCESS)
ret = R_TSIP_Sha256HmacGenerateUpdate(&_handle, (uint8_t*)myInner,
innerSz);
if (ret == TSIP_SUCCESS)
ret = R_TSIP_Sha256HmacGenerateUpdate(&_handle, (uint8_t*)in, sz);
if (ret == TSIP_SUCCESS)
ret = R_TSIP_Sha256HmacGenerateFinal(&_handle, digest);
/* unlock hw */
tsip_hw_unlock();
return ret;
}
/* generate Verify Data based on master secret */
int tsip_generateVerifyData(const byte *ms, /* master secret */
const byte *side, const byte *handshake_hash,
byte *hashes /* out */)
{
int ret ;
uint32_t l_side = R_TSIP_TLS_GENERATE_CLIENT_VERIFY;
if ((ms == NULL) || (side == NULL) || (handshake_hash == NULL) ||
(hashes == NULL))
return BAD_FUNC_ARG;
if (XSTRNCMP((const char*)side, (const char*)tls_server, FINISHED_LABEL_SZ)
== 0)
{
l_side = R_TSIP_TLS_GENERATE_SERVER_VERIFY;
}
if ((ret = tsip_hw_lock()) == 0) {
ret = R_TSIP_TlsGenerateVerifyData(l_side, (uint32_t*)ms,
(uint8_t*)handshake_hash, hashes/* out */);
if (ret != TSIP_SUCCESS) {
WOLFSSL_MSG("R_TSIP_TlsGenerateSessionKey failed\n");
}
}
/* unlock hw */
tsip_hw_unlock();
return ret;
}
/* generate keys for TLS communication */
int tsip_generateSeesionKey(struct WOLFSSL *ssl)
{
int ret;
Ciphers *enc;
Ciphers *dec;
tsip_hmac_sha_key_index_t key_client_mac;
tsip_hmac_sha_key_index_t key_server_mac;
tsip_aes_key_index_t key_client_aes;
tsip_aes_key_index_t key_server_aes;
if (ssl== NULL)
return BAD_FUNC_ARG;
if ((ret = tsip_hw_lock()) == 0) {
ret = R_TSIP_TlsGenerateSessionKey(
_tls2tsipdef(ssl->options.cipherSuite),
(uint32_t*)ssl->arrays->tsip_masterSecret,
(uint8_t*)ssl->arrays->clientRandom,
(uint8_t*)ssl->arrays->serverRandom, &key_client_mac,
&key_server_mac, &key_client_aes, &key_server_aes,
NULL, NULL);
if (ret != TSIP_SUCCESS) {
WOLFSSL_MSG("R_TSIP_TlsGenerateSessionKey failed\n");
} else {
/* successed creating session keys */
/* alloc aes instance for both enc and dec */
enc = &ssl->encrypt;
dec = &ssl->decrypt;
if (enc) {
if (enc->aes == NULL)
enc->aes = (Aes*)XMALLOC(sizeof(Aes), ssl->heap,
DYNAMIC_TYPE_CIPHER);
if (enc->aes == NULL)
return MEMORY_E;
XMEMSET(enc->aes, 0, sizeof(Aes));
}
if (dec) {
if (dec->aes == NULL)
dec->aes = (Aes*)XMALLOC(sizeof(Aes), ssl->heap,
DYNAMIC_TYPE_CIPHER);
if (dec->aes == NULL) {
if (enc) {
XFREE(enc->aes, NULL, DYNAMIC_TYPE_CIPHER);
}
return MEMORY_E;
}
XMEMSET(dec->aes, 0, sizeof(Aes));
}
/* copy key index into aes */
if (ssl->options.side == PROVISION_CLIENT) {
XMEMCPY(&enc->aes->ctx.tsip_keyIdx, &key_client_aes,
sizeof(key_client_aes));
XMEMCPY(&dec->aes->ctx.tsip_keyIdx, &key_server_aes,
sizeof(key_server_aes));
} else {
XMEMCPY(&enc->aes->ctx.tsip_keyIdx, &key_server_aes,
sizeof(key_server_aes));
XMEMCPY(&dec->aes->ctx.tsip_keyIdx, &key_client_aes,
sizeof(key_client_aes));
}
/* copy hac key index into keys */
XMEMCPY(ssl->keys.tsip_client_write_MAC_secret, key_client_mac.value,
sizeof(key_client_mac.value));
XMEMCPY(ssl->keys.tsip_server_write_MAC_secret, key_server_mac.value,
sizeof(key_client_mac.value));
/* set up key size and marked readly */
if (enc){
enc->aes->ctx.keySize = ssl->specs.key_size;
/* ready for use */
enc->setup = 1;
}
/* set up key size and marked readly */
if (dec) {
dec->aes->ctx.keySize = ssl->specs.key_size;
/* ready for use */
dec->setup = 1;
}
}
/* unlock hw */
tsip_hw_unlock();
} else
WOLFSSL_MSG("hw lock failed\n");
return ret;
}
/* generate Master secrete by TSIP */
int tsip_generateMasterSecret(const byte *pr, /* pre-master */
const byte *cr, /* client random */
const byte *sr, /* server random */
byte *ms)
{
int ret;
if ((pr == NULL) || (cr == NULL) || (sr == NULL) ||
(ms == NULL))
return BAD_FUNC_ARG;
if ((ret = tsip_hw_lock()) == 0) {
ret = R_TSIP_TlsGenerateMasterSecret( (uint32_t*)pr,
(uint8_t*)cr, (uint8_t*)sr, (uint32_t*)ms);
if (ret != TSIP_SUCCESS) {
WOLFSSL_MSG("R_TSIP_TlsGenerateMasterSecret failed\n");
}
/* unlock hw */
tsip_hw_unlock();
} else {
WOLFSSL_MSG(" hw lock failed ");
}
return ret;
}
/* generate pre-Master secrete by TSIP */
int tsip_generatePremasterSecret(byte *premaster, word32 preSz )
{
int ret;
if (premaster == NULL)
return BAD_FUNC_ARG;
if ((ret = tsip_hw_lock()) == 0 && preSz >=
(R_TSIP_TLS_MASTER_SECRET_WORD_SIZE*4)) {
/* generate pre-master, 80 bytes */
ret = R_TSIP_TlsGeneratePreMasterSecret( (uint32_t*)premaster );
if (ret != TSIP_SUCCESS) {
WOLFSSL_MSG(" R_TSIP_TlsGeneratePreMasterSecret failed\n");
}
/* unlock hw */
tsip_hw_unlock();
} else {
WOLFSSL_MSG(" hw lock failed or preSz is smaller than 80");
}
return ret;
}
/* generate encrpted pre-Master secrete by TSIP */
int tsip_generateEncryptPreMasterSecret(WOLFSSL *ssl, byte *out, word32 *outSz)
{
int ret;
if ((ssl == NULL) || (out == NULL) || (outSz == NULL))
return BAD_FUNC_ARG;
if ((ret = tsip_hw_lock()) == 0) {
if (*outSz >= 256)
ret = R_TSIP_TlsEncryptPreMasterSecret(
(uint32_t*)ssl->peerTsipEncRsaKeyIndex,
(uint32_t*)&ssl->arrays->preMasterSecret[VERSION_SZ],
(uint8_t*)out);
else
ret = -1;
if (ret != TSIP_SUCCESS) {
WOLFSSL_MSG(" R_TSIP_TlsEncryptPreMasterSecret failed\n");
} else {
*outSz = 256; /* TSIP can only handles 2048 RSA */
}
/* unlock hw */
tsip_hw_unlock();
} else {
WOLFSSL_MSG(" hw lock failed ");
}
return ret;
}
#endif /* NO_WOLFSSL_RENESAS_TSIP_TLS_SESSION */
/* Certificate verification by TSIP */
int tsip_tls_CertVerify(const byte *cert, word32 certSz,
const byte *signature, word32 sigSz,
word32 key_n_start, word32 key_n_len,
word32 key_e_start, word32 key_e_len,
byte *tsip_encRsaKeyIndex)
{
int ret;
if (cert == NULL)
return BAD_FUNC_ARG;
if (!signature) {
WOLFSSL_MSG(" signature for ca verification is not set\n");
return -1;
}
if (!tsip_encRsaKeyIndex) {
WOLFSSL_MSG(" tsip_encRsaKeyIndex is NULL.\n");
return -1;
}
if ((ret = tsip_hw_lock()) == 0) {
ret = R_TSIP_TlsCertificateVerification(
(uint32_t*)g_encrypted_publicCA_key,/* encrypted public key */
(uint8_t*)cert, /* certificate der */
certSz, /* length of der */
(uint8_t*)signature, /* sign data by RSA PSS */
key_n_start, /* start position of public key n in bytes */
(key_n_start + key_n_len), /* length of the public key n */
key_e_start, /* start pos, key e in bytes */
(key_e_start + key_e_len), /* length of the public key e */
(uint32_t*)tsip_encRsaKeyIndex /* returned encrypted key */
);
if (ret != TSIP_SUCCESS) {
WOLFSSL_MSG(" R_TSIP_TlsCertificateVerification() failed");
}
tsip_hw_unlock();
} else {
WOLFSSL_MSG(" hw lock failed ");
}
return ret;
}
/* Root Certificate verification */
int tsip_tls_RootCertVerify(const byte *cert, word32 cert_len,
word32 key_n_start, word32 key_n_len,
word32 key_e_start, word32 key_e_len,
word32 cm_row)
{
int ret;
/* call to generate encrypted public key for certificate verification */
uint8_t *signature = (uint8_t*)ca_cert_sig;
if (cert == NULL)
return BAD_FUNC_ARG;
if (!signature) {
WOLFSSL_MSG(" signature for ca verification is not set\n");
return -1;
}
if ((ret = tsip_hw_lock()) == 0) {
ret = R_TSIP_TlsRootCertificateVerification(
/* CA cert */
(uint8_t*)cert,
/* lenght of CA cert */
(uint32_t)cert_len,
/* Byte position of pubic key */
key_n_start,
(key_n_start + key_n_len),
key_e_start,
(key_e_start + key_e_len),
/* signature by "RSA 2048 PSS with SHA256" */
(uint8_t*)ca_cert_sig,
/* RSA-2048 public kye used by
RSA-2048 PSS with SHA256. 560 Bytes*/
g_encrypted_publicCA_key
);
if (ret != TSIP_SUCCESS) {
WOLFSSL_MSG(" R_TSIP_TlsRootCertVerify() failed");
} else {
g_CAscm_Idx = cm_row;
}
tsip_hw_unlock();
} else {
WOLFSSL_MSG(" hw lock failed ");
}
return ret;
}
#endif /* WOLFSSL_RENESAS_TSIP_TLS */
#ifdef WOLFSSL_RENESAS_TSIP_CRYPT_DEBUG
/* err
* e_tsip_err
TSIP_SUCCESS = 0,
TSIP_ERR_SELF_CHECK1, // Self-check 1 fail or TSIP function internal err.
TSIP_ERR_RESOURCE_CONFLICT, // A resource conflict occurred.
TSIP_ERR_SELF_CHECK2, // Self-check 2 fail.
TSIP_ERR_KEY_SET, // setting the invalid key.
TSIP_ERR_AUTHENTICATION, // Authentication failed.
TSIP_ERR_CALLBACK_UNREGIST, // Callback function is not registered.
TSIP_ERR_PARAMETER, // Illegal Input data.
TSIP_ERR_PROHIBIT_FUNCTION, // An invalid function call occurred.
* TSIP_RESUME_FIRMWARE_GENERATE_MAC,
// There is a continuation of R_TSIP_GenerateFirmwareMAC.
*/
static void hexdump(const uint8_t* in, uint32_t len)
{
uint32_t i;
if (in == NULL)
return;
for (i = 0; i <= len;i++, in++){
printf("%02x:", *in);
if (((i+1)%16)==0){
printf("\n");
}
}
printf("\n");
}
byte *ret2err(word32 ret)
{
switch(ret){
case TSIP_SUCCESS: return "success";
case TSIP_ERR_SELF_CHECK1: return "selfcheck1";
case TSIP_ERR_RESOURCE_CONFLICT: return "rsconflict";
case TSIP_ERR_SELF_CHECK2: return "selfcheck2";
case TSIP_ERR_KEY_SET: return "keyset";
case TSIP_ERR_AUTHENTICATION: return "authentication";
case TSIP_ERR_CALLBACK_UNREGIST: return "callback unreg";
case TSIP_ERR_PARAMETER: return "badarg";
case TSIP_ERR_PROHIBIT_FUNCTION: return "prohibitfunc";
case TSIP_RESUME_FIRMWARE_GENERATE_MAC: return "conti-generate-mac";
default:return "unknown";
}
}
#endif /* WOLFSSL_RENESAS_TSIP_CRYPT_DEBUG */
#endif /* WOLFSSL_RENESAS_TSIP */

View File

@ -33,7 +33,7 @@
*/
#if defined(HAVE_FIPS) && \
defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2)
defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2)
/* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */
#define FIPS_NO_WRAPPERS
@ -202,7 +202,7 @@ int wc_RNG_GenerateByte(WC_RNG* rng, byte* b)
* entropy you are looking for in a seed. */
#ifndef RNG_SECURITY_STRENGTH
#if defined(HAVE_FIPS) && \
defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2)
defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2)
/* SHA-256 requires a minimum of 256-bits of entropy. The goal
* of 1024 will provide 4 times that. */
#define RNG_SECURITY_STRENGTH (1024)
@ -740,7 +740,7 @@ static int _InitRng(WC_RNG* rng, byte* nonce, word32 nonceSz,
#endif
#ifdef CUSTOM_RAND_GENERATE_BLOCK
ret = 0; /* success */
ret = 0; /* success */
#else
#ifdef HAVE_HASHDRBG
if (nonceSz == 0)
@ -1489,7 +1489,7 @@ static int wc_GenerateRand_IntelRD(OS_Seed* os, byte* output, word32 sz)
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
{
int ret = !SGX_SUCCESS;
int ret = !SGX_SUCCESS;
int i, read_max = 10;
for (i = 0; i < read_max && ret != SGX_SUCCESS; i++) {
@ -1787,28 +1787,28 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
hrng.Instance = RNG;
HAL_RNG_Init(&hrng);
while (i < sz) {
/* If not aligned or there is odd/remainder */
if( (i + sizeof(word32)) > sz ||
((wolfssl_word)&output[i] % sizeof(word32)) != 0
) {
/* Single byte at a time */
uint32_t tmpRng = 0;
if (HAL_RNG_GenerateRandomNumber(&hrng, &tmpRng) != HAL_OK) {
return RAN_BLOCK_E;
}
output[i++] = (byte)tmpRng;
}
else {
/* Use native 32 instruction */
if (HAL_RNG_GenerateRandomNumber(&hrng, (uint32_t*)&output[i]) != HAL_OK) {
return RAN_BLOCK_E;
}
i += sizeof(word32);
}
}
while (i < sz) {
/* If not aligned or there is odd/remainder */
if( (i + sizeof(word32)) > sz ||
((wolfssl_word)&output[i] % sizeof(word32)) != 0
) {
/* Single byte at a time */
uint32_t tmpRng = 0;
if (HAL_RNG_GenerateRandomNumber(&hrng, &tmpRng) != HAL_OK) {
return RAN_BLOCK_E;
}
output[i++] = (byte)tmpRng;
}
else {
/* Use native 32 instruction */
if (HAL_RNG_GenerateRandomNumber(&hrng, (uint32_t*)&output[i]) != HAL_OK) {
return RAN_BLOCK_E;
}
i += sizeof(word32);
}
}
return 0;
return 0;
}
#elif defined(WOLFSSL_STM32F427_RNG) || defined(WOLFSSL_STM32_RNG_NOLIB)
@ -1865,7 +1865,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
/* verify no errors with RNG_CLK or Seed */
if (RNG_GetFlagStatus(RNG_FLAG_SECS | RNG_FLAG_CECS) != RESET)
return RNG_FAILURE_E;
return RNG_FAILURE_E;
for (i = 0; i < (int)sz; i++) {
/* wait until RNG number is ready */
@ -2044,16 +2044,16 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
{
int ret = 0;
int ret = 0;
(void)os;
if (output == NULL) {
return BUFFER_E;
}
if (output == NULL) {
return BUFFER_E;
}
ret = atmel_get_random_number(sz, output);
ret = atmel_get_random_number(sz, output);
return ret;
return ret;
}
#elif defined(INTIME_RTOS)
@ -2191,6 +2191,37 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
}
#endif /* end WOLFSSL_ESPWROOM32 */
#elif defined(WOLFSSL_RENESAS_TSIP)
#if defined(WOLFSSL_RENESA_TSIP_IAREWRX)
#include "r_bsp/mcu/all/r_rx_compiler.h"
#endif
#include "r_bsp/platform.h"
#include "r_tsip_rx_if.h"
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
{
int ret;
uint32_t buffer[4];
while (sz > 0) {
uint32_t len = sizeof(buffer);
if (sz < len) {
len = sz;
}
/* retun 4 words random number*/
ret = R_TSIP_GenerateRandomNumber(buffer);
if(ret == TSIP_SUCCESS) {
XMEMCPY(output, &buffer, len);
output += len;
sz -= len;
} else
return ret;
}
return ret;
}
#elif defined(CUSTOM_RAND_GENERATE_BLOCK)
/* #define CUSTOM_RAND_GENERATE_BLOCK myRngFunc
* extern int myRngFunc(byte* output, word32 sz);
@ -2238,7 +2269,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
#elif defined(WOLFSSL_TELIT_M2MB)
#include "stdlib.h"
#include "stdlib.h"
static long get_timestamp(void) {
long myTime = 0;
INT32 fd = m2mb_rtc_open("/dev/rtc0", 0);

View File

@ -280,7 +280,12 @@
return ret;
}
#elif defined(WOLFSSL_RENESAS_TSIP_CRYPT) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_CRYPT_HASH)
/* implemented in wolfcrypt/src/port/Renesas/renesas_tsip_sha.c */
#else
/* Software implementation */
#define USE_SHA_SOFTWARE_IMPL
@ -662,12 +667,21 @@ void wc_ShaFree(wc_Sha* sha)
#ifdef WOLFSSL_PIC32MZ_HASH
wc_ShaPic32Free(sha);
#endif
#if (defined(WOLFSSL_RENESAS_TSIP_CRYPT) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_CRYPT_HASH))
if (sha->msg != NULL) {
XFREE(sha->msg, sha->heap, DYNAMIC_TYPE_TMP_BUFFER);
sha->msg = NULL;
}
#endif
}
#endif /* !WOLFSSL_TI_HASH */
#endif /* HAVE_FIPS */
#ifndef WOLFSSL_TI_HASH
#if !defined(WOLFSSL_RENESAS_TSIP_CRYPT) || \
defined(NO_WOLFSSL_RENESAS_TSIP_CRYPT_HASH)
int wc_ShaGetHash(wc_Sha* sha, byte* hash)
{
int ret;
@ -692,6 +706,8 @@ int wc_ShaGetHash(wc_Sha* sha, byte* hash)
!defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH)
sha->ctx.mode = ESP32_SHA_SW;
#endif
}
return ret;
}
@ -720,9 +736,9 @@ int wc_ShaCopy(wc_Sha* src, wc_Sha* dst)
#if defined(WOLFSSL_HASH_FLAGS) || defined(WOLF_CRYPTO_CB)
dst->flags |= WC_HASH_FLAG_ISCOPY;
#endif
return ret;
}
#endif /* defined(WOLFSSL_RENESAS_TSIP_CRYPT) ... */
#endif /* !WOLFSSL_TI_HASH */

View File

@ -163,7 +163,9 @@
#if !defined(WOLFSSL_PIC32MZ_HASH) && !defined(STM32_HASH_SHA2) && \
(!defined(WOLFSSL_IMX6_CAAM) || defined(NO_IMX6_CAAM_HASH)) && \
!defined(WOLFSSL_AFALG_HASH) && !defined(WOLFSSL_DEVCRYPTO_HASH) && \
(!defined(WOLFSSL_ESP32WROOM32_CRYPT) || defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH))
(!defined(WOLFSSL_ESP32WROOM32_CRYPT) || defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH)) && \
(!defined(WOLFSSL_RENESAS_TSIP_CRYPT) || defined(NO_WOLFSSL_RENESAS_TSIP_HASH))
static int InitSha256(wc_Sha256* sha256)
{
int ret = 0;
@ -551,6 +553,12 @@ static int InitSha256(wc_Sha256* sha256)
return ret;
}
#elif defined(WOLFSSL_RENESAS_TSIP_CRYPT) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_CRYPT_HASH)
/* implemented in wolfcrypt/src/port/Renesas/renesas_tsip_sha.c */
#else
#define NEED_SOFT_SHA256
@ -1354,7 +1362,9 @@ void wc_Sha256Free(wc_Sha256* sha256)
wc_DevCryptoFree(&sha256->ctx);
#endif /* WOLFSSL_DEVCRYPTO */
#if (defined(WOLFSSL_AFALG_HASH) && defined(WOLFSSL_AFALG_HASH_KEEP)) || \
(defined(WOLFSSL_DEVCRYPTO_HASH) && defined(WOLFSSL_DEVCRYPTO_HASH_KEEP))
(defined(WOLFSSL_DEVCRYPTO_HASH) && defined(WOLFSSL_DEVCRYPTO_HASH_KEEP)) || \
(defined(WOLFSSL_RENESAS_TSIP_CRYPT) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_CRYPT_HASH))
if (sha256->msg != NULL) {
XFREE(sha256->msg, sha256->heap, DYNAMIC_TYPE_TMP_BUFFER);
sha256->msg = NULL;
@ -1429,7 +1439,11 @@ void wc_Sha256Free(wc_Sha256* sha256)
#elif defined(WOLFSSL_DEVCRYPTO_HASH)
/* implemented in wolfcrypt/src/port/devcrypto/devcrypt_hash.c */
#elif defined(WOLFSSL_RENESAS_TSIP_CRYPT) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_CRYPT_HASH)
/* implemented in wolfcrypt/src/port/Renesas/renesas_tsip_sha.c */
#else
int wc_Sha256GetHash(wc_Sha256* sha256, byte* hash)
@ -1457,6 +1471,7 @@ int wc_Sha256GetHash(wc_Sha256* sha256, byte* hash)
!defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH)
sha256->ctx.mode = ESP32_SHA_SW;
#endif
wc_Sha256Free(&tmpSha256);
}
return ret;

View File

@ -49,7 +49,9 @@
#if defined(WOLFSSL_ATMEL) || defined(WOLFSSL_ATECC508A)
#include <wolfssl/wolfcrypt/port/atmel/atmel.h>
#endif
#if defined(WOLFSSL_RENESAS_TSIP)
#include <wolfssl/wolfcrypt/port/Renesas/renesas-tsip-crypt.h>
#endif
#if defined(WOLFSSL_STSAFEA100)
#include <wolfssl/wolfcrypt/port/st/stsafe.h>
#endif
@ -113,6 +115,16 @@ int wolfCrypt_Init(void)
}
#endif
#if defined(WOLFSSL_RENESAS_TSIP_CRYPT)
ret = tsip_Open( );
if( ret != TSIP_SUCCESS ) {
WOLFSSL_MSG("RENESAS TSIP Open failed");
/* not return 1 since WOLFSSL_SUCCESS=1*/
ret = -1;/* FATAL ERROR */
return ret;
}
#endif
#if defined(WOLFSSL_TRACK_MEMORY) && !defined(WOLFSSL_STATIC_MEMORY)
ret = InitMemoryTracker();
if (ret != 0) {
@ -253,6 +265,9 @@ int wolfCrypt_Cleanup(void)
#if defined(WOLFSSL_CRYPTOCELL)
cc310_Free();
#endif
#if defined(WOLFSSL_RENESAS_TSIP_CRYPT)
tsip_Close();
#endif
}
return ret;

View File

@ -96,7 +96,7 @@
/* don't use file system for these tests, since ./certs dir isn't loaded */
#undef NO_FILESYSTEM
#define NO_FILESYSTEM
#elif defined(THREADX) && !defined(WOLFSSL_WICED)
#elif defined(THREADX) && !defined(WOLFSSL_WICED) && !defined(THREADX_NO_DC_PRINTF)
/* since just testing, use THREADX log printf instead */
int dc_log_printf(char*, ...);
#undef printf
@ -1890,14 +1890,23 @@ int sha_test(void)
/* BEGIN LARGE HASH TEST */ {
byte large_input[1024];
#ifdef WOLFSSL_RENESAS_TSIP
const char* large_digest =
"\x8b\x77\x02\x48\x39\xe8\xdb\xd3\x9a\xf4\x05\x24\x66\x12\x2d\x9e"
"\xc5\xd9\x0a\xac";
"\x1d\x6a\x5a\xf6\xe5\x7c\x86\xce\x7f\x7c\xaf\xd5\xdb\x08\xcd\x59"
"\x15\x8c\x6d\xb6";
#else
const char* large_digest =
"\x8b\x77\x02\x48\x39\xe8\xdb\xd3\x9a\xf4\x05\x24\x66\x12\x2d\x9e"
"\xc5\xd9\x0a\xac";
#endif
for (i = 0; i < (int)sizeof(large_input); i++) {
large_input[i] = (byte)(i & 0xFF);
}
#ifdef WOLFSSL_RENESAS_TSIP
times = 20;
#else
times = 100;
#endif
#ifdef WOLFSSL_PIC32MZ_HASH
wc_ShaSizeSet(&sha, times * sizeof(large_input));
#endif
@ -2271,14 +2280,23 @@ int sha256_test(void)
/* BEGIN LARGE HASH TEST */ {
byte large_input[1024];
#ifdef WOLFSSL_RENESAS_TSIP_CRYPT
const char* large_digest =
"\x27\x78\x3e\x87\x96\x3a\x4e\xfb\x68\x29\xb5\x31\xc9\xba\x57\xb4"
"\x4f\x45\x79\x7f\x67\x70\xbd\x63\x7f\xbf\x0d\x80\x7c\xbd\xba\xe0";
"\xa4\x75\x9e\x7a\xa2\x03\x38\x32\x88\x66\xa2\xea\x17\xea\xf8\xc7"
"\xfe\x4e\xc6\xbb\xe3\xbb\x71\xce\xe7\xdf\x7c\x04\x61\xb3\xc2\x2f";
#else
const char* large_digest =
"\x27\x78\x3e\x87\x96\x3a\x4e\xfb\x68\x29\xb5\x31\xc9\xba\x57\xb4"
"\x4f\x45\x79\x7f\x67\x70\xbd\x63\x7f\xbf\x0d\x80\x7c\xbd\xba\xe0";
#endif
for (i = 0; i < (int)sizeof(large_input); i++) {
large_input[i] = (byte)(i & 0xFF);
}
#ifdef WOLFSSL_RENESAS_TSIP
times = 20;
#else
times = 100;
#endif
#ifdef WOLFSSL_PIC32MZ_HASH
wc_Sha256SizeSet(&sha, times * sizeof(large_input));
#endif

View File

@ -163,6 +163,7 @@ enum wolfSSL_ErrorCodes {
DH_PARAMS_NOT_FFDHE_E = -432, /* DH params from server not FFDHE */
TCA_INVALID_ID_TYPE = -433, /* TLSX TCA ID type invalid */
TCA_ABSENT_ERROR = -434, /* TLSX TCA ID no response */
TSIP_MAC_DIGSZ_E = -435, /* Invalid MAC size for TSIP */
/* add strings to wolfSSL_ERR_reason_error_string in internal.c !!!!! */
/* begin negotiation parameter errors */

View File

@ -2086,6 +2086,10 @@ typedef struct Keys {
byte updateResponseReq:1; /* KeyUpdate response from peer required. */
byte keyUpdateRespond:1; /* KeyUpdate is to be responded to. */
#endif
#ifdef WOLFSSL_RENESAS_TSIP_TLS
byte tsip_client_write_MAC_secret[TSIP_TLS_HMAC_KEY_INDEX_WORDSIZE];
byte tsip_server_write_MAC_secret[TSIP_TLS_HMAC_KEY_INDEX_WORDSIZE];
#endif
} Keys;
@ -3435,6 +3439,10 @@ typedef struct Arrays {
byte secret[SECRET_LEN];
#endif
byte masterSecret[SECRET_LEN];
#if defined(WOLFSSL_RENESAS_TSIP_TLS) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_TLS_SESSION)
byte tsip_masterSecret[TSIP_TLS_MASTERSECRET_SIZE];
#endif
#ifdef WOLFSSL_DTLS
byte cookie[MAX_COOKIE_LEN];
byte cookieSz;
@ -3841,6 +3849,9 @@ struct WOLFSSL {
#endif /* OPENSSL_EXTRA */
#ifndef NO_RSA
RsaKey* peerRsaKey;
#ifdef WOLFSSL_RENESAS_TSIP_TLS
byte *peerTsipEncRsaKeyIndex;
#endif
byte peerRsaKeyPresent;
#endif
#ifdef HAVE_QSH

View File

@ -85,6 +85,11 @@
#include <wolfssl/wolfcrypt/port/arm/cryptoCell.h>
#endif
#if defined(WOLFSSL_RENESAS_TSIP_TLS) && \
defined(WOLFSSL_RENESAS_TSIP_TLS_AES_CRYPT)
#include <wolfssl/wolfcrypt/port/Renesas/renesas-tsip-crypt.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
@ -200,6 +205,10 @@ struct Aes {
#endif
#if defined(WOLFSSL_CRYPTOCELL)
aes_context_t ctx;
#endif
#if defined(WOLFSSL_RENESAS_TSIP_TLS) && \
defined(WOLFSSL_RENESAS_TSIP_TLS_AES_CRYPT)
TSIP_AES_CTX ctx;
#endif
void* heap; /* memory hint to use */
};

View File

@ -670,6 +670,16 @@ struct SignatureCtx {
void* pkCtxRsa;
#endif
#endif /* HAVE_PK_CALLBACKS */
#ifndef NO_RSA
#ifdef WOLFSSL_RENESAS_TSIP_TLS
byte verifyByTSIP;
word32 certBegin;
word32 pubkey_n_start;
word32 pubkey_n_len;
word32 pubkey_e_start;
word32 pubkey_e_len;
#endif
#endif
};
enum CertSignState {
@ -831,6 +841,7 @@ struct DecodedCert {
#ifndef NO_CERTS
SignatureCtx sigCtx;
#endif
byte* tsip_encRsaKeyIdx;
/* Option Bits */
byte subjectCNStored : 1; /* have we saved a copy we own */
@ -906,6 +917,9 @@ struct Signer {
#endif
#ifdef WOLFSSL_SIGNER_DER_CERT
DerBuffer* derCert;
#endif
#ifdef WOLFSSL_RENESAS_TSIP_TLS
word32 cm_idx;
#endif
Signer* next;
};

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

View File

@ -0,0 +1,153 @@
/* renesas-tsip-crypt.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 __RENESAS_TSIP_CRYPT_H__
#define __RENESAS_TSIP_CRYPT_H__
#if defined(WOLFSSL_RENESAS_TSIP_IAREWRX)
#include "r_bsp/mcu/all/r_rx_compiler.h"
#include "r_bsp/platform.h"
#else
#include "platform.h"
#endif
#include "r_tsip_rx_if.h"
#include <wolfssl/wolfcrypt/logging.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
tsip_Key_SESSION = 1,
tsip_Key_AES128 = 2,
tsip_Key_AES256 = 3,
tsip_Key_RSA1024 = 4,
tsip_Key_RSA2048 = 5,
tsip_Key_tls_Rsa2048 = 6,
UNKNOW = -1,
} wolfssl_TSIP_KEY_IV;
enum {
l_TLS_RSA_WITH_AES_128_CBC_SHA = 0x2F,
l_TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x3c,
l_TLS_RSA_WITH_AES_256_CBC_SHA = 0x35,
l_TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x3d,
};
typedef struct
{
uint8_t *encrypted_session_key;
uint8_t *iv;
uint8_t *encrypted_user_tls_key;
tsip_tls_ca_certification_public_key_index_t user_rsa2048_tls_pubindex;
} tsip_key_data;
int tsip_Open( );
void tsip_Close( );
int tsip_hw_lock();
void tsip_hw_unlock( void );
int tsip_usable(const struct WOLFSSL *ssl);
void tsip_inform_sflash_signedcacert(const byte *ps_flash,
const byte *psigned_ca_cert, word32 len);
void tsip_inform_cert_sign(const byte *sign);
/* set / get key */
void tsip_inform_user_keys(byte *encrypted_session_key, byte *iv,
byte *encrypted_user_tls_key);
byte tsip_rootCAverified( );
byte tsip_checkCA(word32 cmIdx);
int tsip_tls_RootCertVerify(const byte *cert , word32 cert_len,
word32 key_n_start, word32 key_n_len,
word32 key_e_start, word32 key_e_len,
word32 cm_row);
int tsip_tls_CertVerify(const byte *cert, word32 certSz,
const byte *signature, word32 sigSz,
word32 key_n_start, word32 key_n_len,
word32 key_e_start, word32 key_e_len,
byte *tsip_encRsaKeyIdx);
void tsip_inform_key_position(const word32 key_n_start, const word32 key_n_len,
const word32 key_e_start, const word32 key_e_len);
int tsip_generatePremasterSecret(byte *premaster, word32 preSz);
struct WOLFSSL;
int tsip_generateEncryptPreMasterSecret(struct WOLFSSL *ssl, byte *out,
word32 *outSz);
int tsip_generateMasterSecret(const byte *pre, const byte *cr,const byte *sr,
byte *ms);
int tsip_generateSeesionKey(struct WOLFSSL *ssl);
int tsip_Sha256Hmac(const struct WOLFSSL *ssl, const byte *myInner,
word32 innerSz, const byte *in, word32 sz, byte *digest,
word32 verify);
int tsip_Sha1Hmac(const struct WOLFSSL *ssl, const byte *myInner,
word32 innerSz, const byte *in, word32 sz, byte *digest,
word32 verify);
#if (!defined(NO_SHA) || !defined(NO_SHA256)) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_CRYPT_HASH)
typedef enum {
TSIP_SHA1 = 0,
TSIP_SHA256 = 1,
} TSIP_SHA_TYPE;
typedef struct {
byte* msg;
void* heap;
word32 used;
word32 len;
word32 sha_type;
} wolfssl_TSIP_Hash;
/* RAW hash function APIs are not implemented with TSIP */
#define WOLFSSL_NO_HASH_RAW
typedef wolfssl_TSIP_Hash wc_Sha;
#if !defined(NO_SHA256)
typedef wolfssl_TSIP_Hash wc_Sha256;
#endif
#endif /* NO_SHA */
#if defined(WOLFSSL_RENESAS_TSIP_TLS_AES_CRYPT)
typedef struct {
tsip_aes_key_index_t tsip_keyIdx;
word32 keySize;
} TSIP_AES_CTX;
struct Aes;
int wc_tsip_AesCbcEncrypt(struct Aes* aes, byte* out, const byte* in,
word32 sz);
int wc_tsip_AesCbcDecrypt(struct Aes* aes, byte* out, const byte* in,
word32 sz);
#endif /* WOLFSSL_RENESAS_TSIP_TLS_AES */
#if defined(WOLFSSL_RENESAS_TSIP_CRYPT_DEBUG)
byte *ret2err(word32 ret);
#endif
#ifdef __cplusplus
}
#endif
#endif /* __RENESAS_TSIP_CRYPT_H__ */

View File

@ -193,6 +193,12 @@
/* Uncomment next line if using ARM CRYPTOCELL*/
/* #define WOLFSSL_CRYPTOCELL */
/* Uncomment next line if using RENESAS TSIP */
/* #define WOLFSSL_RENESAS_TSIP */
/* Uncomment next line if using RENESAS RX64N */
/* #define WOLFSSL_RENESAS_RX65N */
#include <wolfssl/wolfcrypt/visibility.h>
#ifdef WOLFSSL_USER_SETTINGS
@ -265,6 +271,17 @@
#endif
#endif /* WOLFSSL_ESPIDF */
#if defined(WOLFSSL_RENESAS_TSIP)
#define TSIP_TLS_HMAC_KEY_INDEX_WORDSIZE 64
#define TSIP_TLS_MASTERSECRET_SIZE 80 /* 20 words */
#define TSIP_TLS_ENCPUBKEY_SZ_BY_CERTVRFY 560 /* in byte */
#if !defined(NO_RENESAS_TSIP_CRYPT) && defined(WOLFSSL_RENESAS_RX65N)
#define WOLFSSL_RENESAS_TSIP_CRYPT
#define WOLFSSL_RENESAS_TSIP_TLS
#define WOLFSSL_RENESAS_TSIP_TLS_AES_CRYPT
#endif
#endif
#if defined(HAVE_LWIP_NATIVE) /* using LwIP native TCP socket */
#define WOLFSSL_LWIP
#define NO_WRITEV

View File

@ -98,7 +98,9 @@ enum {
#elif defined(WOLFSSL_IMX6_CAAM)
#include "wolfssl/wolfcrypt/port/caam/wolfcaam_sha.h"
#elif defined(WOLFSSL_RENESAS_TSIP_CRYPT) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_CRYPT_HASH)
#include "wolfssl/wolfcrypt/port/Renesas/renesas-tsip-crypt.h"
#else
/* Sha digest */

View File

@ -123,6 +123,9 @@ enum {
#include "wolfssl/wolfcrypt/port/caam/wolfcaam_sha.h"
#elif defined(WOLFSSL_AFALG_HASH)
#include "wolfssl/wolfcrypt/port/af_alg/afalg_hash.h"
#elif defined(WOLFSSL_RENESAS_TSIP_CRYPT) && \
!defined(NO_WOLFSSL_RENESAS_TSIP_CRYPT_HASH)
#include "wolfssl/wolfcrypt/port/Renesas/renesas-tsip-crypt.h"
#else
/* wc_Sha256 digest */