Compare commits
5 Commits
v5.5.3-sta
...
wolfRand-R
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
894a57d24d | ||
|
|
3f8981fbd5 | ||
|
|
434fcc1012 | ||
|
|
031cd27c1d | ||
|
|
52b5843cbb |
58
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
58
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
@@ -1,58 +0,0 @@
|
||||
name: Bug Report
|
||||
description: File a bug report
|
||||
title: "[Bug]: "
|
||||
labels: ["bug", "triage"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: >
|
||||
Thanks for reporting an bug. If you would prefer a private method,
|
||||
please email support@wolfssl.com
|
||||
- type: input
|
||||
id: contact
|
||||
attributes:
|
||||
label: Contact Details
|
||||
description: How can we get in touch with you if we need more info?
|
||||
placeholder: ex. email@example.com
|
||||
validations:
|
||||
required: false
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: Version
|
||||
description: What version were you using?
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: details
|
||||
attributes:
|
||||
label: Description
|
||||
description: |
|
||||
Describe the issue in detail
|
||||
Please include:
|
||||
* Specific `./configure` options or `user_settings.h`
|
||||
* Target and build environment
|
||||
placeholder: |
|
||||
Blinded by the light!
|
||||
Code runs too fast. It's gone plaid!
|
||||
...
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: reproduce
|
||||
attributes:
|
||||
label: Reproduction steps
|
||||
description: If possible please give instructions on how to reproduce.
|
||||
placeholder: |
|
||||
1. `./configure --enable-42`
|
||||
2. `make question`
|
||||
3.
|
||||
...
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: logs
|
||||
attributes:
|
||||
label: Relevant log output
|
||||
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
|
||||
render: shell
|
||||
28
.github/ISSUE_TEMPLATE/other.yaml
vendored
28
.github/ISSUE_TEMPLATE/other.yaml
vendored
@@ -1,28 +0,0 @@
|
||||
name: General Issue
|
||||
description: Request support with an issue
|
||||
labels: ["triage"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: >
|
||||
Thanks for reporting an issue. If you would prefer a private method,
|
||||
please email support@wolfssl.com
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: Version
|
||||
description: What version were you using?
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: details
|
||||
attributes:
|
||||
label: Description
|
||||
description: |
|
||||
Describe the issue in detail.
|
||||
Please include specific configuration options or user_settings.h
|
||||
placeholder: |
|
||||
`./configure --enable-world-domination` fails
|
||||
...
|
||||
validations:
|
||||
required: true
|
||||
16
.github/PULL_REQUEST_TEMPLATE.md
vendored
16
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,16 +0,0 @@
|
||||
# Description
|
||||
|
||||
Please describe the scope of the fix or feature addition.
|
||||
|
||||
Fixes zd#
|
||||
|
||||
# Testing
|
||||
|
||||
How did you test?
|
||||
|
||||
# Checklist
|
||||
|
||||
- [ ] added tests
|
||||
- [ ] updated/added doxygen
|
||||
- [ ] updated appropriate READMEs
|
||||
- [ ] Updated manual and documentation
|
||||
12
.github/SECURITY.md
vendored
12
.github/SECURITY.md
vendored
@@ -1,12 +0,0 @@
|
||||
# Security Policy
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you discover a vulnerability, please report it to support@wolfssl.com
|
||||
|
||||
1. Include a detailed description
|
||||
2. Include method to reproduce and/or method of discovery
|
||||
3. We will evaulate the report promptly and respond to you with findings.
|
||||
4. We will credit you with the report if you would like.
|
||||
|
||||
**Please keep the vulnerability private** until a fix has been released.
|
||||
28
.github/workflows/macos-check.yml
vendored
28
.github/workflows/macos-check.yml
vendored
@@ -1,28 +0,0 @@
|
||||
name: macOS Build Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ '*' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: brew
|
||||
run: brew install automake libtool
|
||||
- name: autogen
|
||||
run: ./autogen.sh
|
||||
- name: configure
|
||||
run: ./configure
|
||||
- name: make
|
||||
run: make
|
||||
- name: make check
|
||||
run: make check
|
||||
- name: make distcheck
|
||||
run: make distcheck
|
||||
|
||||
26
.github/workflows/ubuntu-check.yml
vendored
26
.github/workflows/ubuntu-check.yml
vendored
@@ -1,26 +0,0 @@
|
||||
name: Ubuntu Build Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ '*' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: autogen
|
||||
run: ./autogen.sh
|
||||
- name: configure
|
||||
run: ./configure
|
||||
- name: make
|
||||
run: make
|
||||
- name: make check
|
||||
run: make check
|
||||
- name: make distcheck
|
||||
run: make distcheck
|
||||
|
||||
38
.github/workflows/windows-check.yml
vendored
38
.github/workflows/windows-check.yml
vendored
@@ -1,38 +0,0 @@
|
||||
name: Windows Build Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ '*' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
env:
|
||||
# Path to the solution file relative to the root of the project.
|
||||
SOLUTION_FILE_PATH: wolfssl64.sln
|
||||
|
||||
# Configuration type to build.
|
||||
# You can convert this to a build matrix if you need coverage of multiple configuration types.
|
||||
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
|
||||
BUILD_CONFIGURATION: Release
|
||||
BUILD_PLATFORM: x64
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Add MSBuild to PATH
|
||||
uses: microsoft/setup-msbuild@v1
|
||||
|
||||
- name: Restore NuGet packages
|
||||
working-directory: ${{env.GITHUB_WORKSPACE}}
|
||||
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{env.GITHUB_WORKSPACE}}
|
||||
# Add additional options to the MSBuild command line here (like platform or verbosity level).
|
||||
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
|
||||
run: msbuild /m /p:PlatformToolset=v142 /p:Platform=${{env.BUILD_PLATFORM}} /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}
|
||||
|
||||
96
.gitignore
vendored
96
.gitignore
vendored
@@ -5,21 +5,18 @@ ctaocrypt/src/src/
|
||||
*.o
|
||||
*.patch
|
||||
*.deps
|
||||
*.d
|
||||
*.libs
|
||||
*.cache
|
||||
.dirstamp
|
||||
*.user
|
||||
configure
|
||||
config.*
|
||||
!cmake/config.in
|
||||
*Debug/
|
||||
*Release/
|
||||
*.ncb
|
||||
*.suo
|
||||
*.sdf
|
||||
*.opensdf
|
||||
*.cmd
|
||||
ipch/
|
||||
build-aux/
|
||||
rpm/spec
|
||||
@@ -27,7 +24,6 @@ rpm/spec
|
||||
stamp-h
|
||||
cyassl/options.h
|
||||
wolfssl/options.h
|
||||
.build_params
|
||||
libtool.m4
|
||||
aclocal.m4
|
||||
aminclude.am
|
||||
@@ -82,8 +78,6 @@ tests/unit
|
||||
testsuite/testsuite.test
|
||||
tests/unit.test
|
||||
tests/bio_write_test.txt
|
||||
tests/test-log-dump-to-file.txt
|
||||
test-write-dhparams.pem
|
||||
testsuite/*.der
|
||||
testsuite/*.pem
|
||||
testsuite/*.raw
|
||||
@@ -208,6 +202,14 @@ TAGS
|
||||
support/cyassl.pc
|
||||
support/wolfssl.pc
|
||||
cyassl/ctaocrypt/stamp-h1
|
||||
swig/_cyassl.so
|
||||
swig/_wolfssl.so
|
||||
swig/cyassl.py
|
||||
swig/wolfssl.py
|
||||
swig/cyassl.pyc
|
||||
swig/wolfssl.pyc
|
||||
swig/cyassl_wrap.c
|
||||
swig/wolfssl_wrap.c
|
||||
stamp-h1
|
||||
clang_output_*
|
||||
internal.plist
|
||||
@@ -223,24 +225,6 @@ IDE/MDK-ARM/LPC43xx/LPC43xx/
|
||||
*.gcno
|
||||
*.gcda
|
||||
*.gcov
|
||||
*.dgcov
|
||||
!linuxkm/Makefile
|
||||
/Kbuild
|
||||
linuxkm/*.ko
|
||||
linuxkm/*.ko.signed
|
||||
linuxkm/Module.symvers
|
||||
linuxkm/built-in.a
|
||||
linuxkm/modules.order
|
||||
linuxkm/wolfcrypt
|
||||
linuxkm/libwolfssl.mod
|
||||
linuxkm/libwolfssl.mod.c
|
||||
linuxkm/libwolfssl.lds
|
||||
linuxkm/module_exports.c
|
||||
linuxkm/linuxkm/get_thread_size
|
||||
|
||||
# autotools generated
|
||||
scripts/unit.test
|
||||
wolfcrypt/test/test_paths.h
|
||||
|
||||
# MPLAB Generated Files (OS X)
|
||||
mcapi/wolfcrypt_mcapi.X/nbproject/Makefile-*
|
||||
@@ -311,7 +295,6 @@ Backup
|
||||
UpgradeLog.htm
|
||||
*.aps
|
||||
*.VC.db
|
||||
*.filters
|
||||
|
||||
IDE/INTIME-RTOS/Debug_*
|
||||
IDE/VS-ARM/.vs
|
||||
@@ -322,10 +305,6 @@ IDE/HEXIWEAR/wolfSSL_HW/Debug
|
||||
# Linux-SGX
|
||||
IDE/LINUX-SGX/*.a
|
||||
|
||||
IDE/iotsafe/*.map
|
||||
IDE/iotsafe/*.elf
|
||||
IDE/iotsafe/*.bin
|
||||
|
||||
# Binaries
|
||||
wolfcrypt/src/port/intel/qat_test
|
||||
/mplabx/wolfssl.X/dist/default/
|
||||
@@ -343,64 +322,7 @@ doc/pdf
|
||||
# XCODE Index
|
||||
IDE/XCODE/Index
|
||||
|
||||
# ARM DS-5 && Eclipse
|
||||
# ARM DS-5
|
||||
\.settings/
|
||||
\.cproject
|
||||
\.project
|
||||
\.autotools
|
||||
|
||||
# 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
|
||||
|
||||
/IDE/Renesas/e2studio/RX65N/GR-ROSE/.metadata
|
||||
/IDE/Renesas/e2studio/RX65N/GR-ROSE/smc/src
|
||||
/IDE/Renesas/e2studio/RX65N/GR-ROSE/smc/trash
|
||||
/IDE/Renesas/e2studio/RX65N/GR-ROSE/test/src/smc_gen
|
||||
/IDE/Renesas/e2studio/RX65N/GR-ROSE/test/generate
|
||||
|
||||
/IDE/Renesas/e2studio/RX65N/RSK/.metadata
|
||||
/IDE/Renesas/e2studio/RX65N/RSK/smc/src
|
||||
/IDE/Renesas/e2studio/RX65N/RSK/smc/trash
|
||||
/IDE/Renesas/e2studio/RX65N/RSK/test/src/smc_gen
|
||||
/IDE/Renesas/e2studio/RX65N/RSK/test/generate
|
||||
|
||||
/IDE/Renesas/e2studio/RX72N/EnvisionKit/.metadata
|
||||
/IDE/Renesas/e2studio/RX72N/EnvisionKit/smc/src
|
||||
/IDE/Renesas/e2studio/RX72N/EnvisionKit/smc/trash
|
||||
/IDE/Renesas/e2studio/RX72N/EnvisionKit/test/src/smc_gen
|
||||
/IDE/Renesas/e2studio/RX72N/EnvisionKit/test/generate
|
||||
|
||||
# QNX CAAM
|
||||
/IDE/QNX/example-server/server-tls
|
||||
/IDE/QNX/example-client/client-tls
|
||||
/IDE/QNX/example-cmac/cmac-test
|
||||
/IDE/QNX/CAAM-DRIVER/wolfCrypt
|
||||
|
||||
# Xilinx
|
||||
/IDE/XilinxSDK/data
|
||||
|
||||
# Emacs
|
||||
*~
|
||||
|
||||
# CMake
|
||||
CMakeFiles/
|
||||
CMakeCache.txt
|
||||
cmake_install.cmake
|
||||
|
||||
# GDB Settings
|
||||
\.gdbinit
|
||||
|
||||
# Pycharm and other IDEs
|
||||
\.idea
|
||||
|
||||
# FIPS
|
||||
XXX-fips-test
|
||||
|
||||
# ASYNC
|
||||
async
|
||||
|
||||
# Generated user_settings_asm.h.
|
||||
user_settings_asm.h
|
||||
|
||||
2262
CMakeLists.txt
2262
CMakeLists.txt
File diff suppressed because it is too large
Load Diff
2069
ChangeLog.md
2069
ChangeLog.md
File diff suppressed because it is too large
Load Diff
@@ -17,8 +17,8 @@ Step 2: Copy the directory wolfSSL that was just created to:
|
||||
|
||||
Step 3: Edit `<arduino-libraries>/wolfSSL/user_settings.h`
|
||||
If building for Intel Galileo platform add: `#define INTEL_GALILEO`.
|
||||
Add any other custom settings, for a good start see the examples in wolfssl root
|
||||
"/examples/configs/user_settings_*.h"
|
||||
Add any other custom settings, for a good start see the below in wolfssl root.
|
||||
(See wolfssl/IDE/ROWLEY-CROSSWORKS-ARM/user_settings.h)
|
||||
|
||||
Step 4: If you experience any issues with custom user_settings.h see the wolfssl
|
||||
porting guide here for more assistance: https://www.wolfssl.com/docs/porting-guide/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* wolfssl_client.ino
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -24,8 +24,8 @@
|
||||
#include <wolfssl/ssl.h>
|
||||
#include <Ethernet.h>
|
||||
|
||||
const char host[] = "192.168.1.148"; /* server to connect to */
|
||||
const int port = 11111; /* port on server to connect to */
|
||||
const char host[] = "192.168.1.148"; // server to connect to
|
||||
const int port = 11111; // port on server to connect to
|
||||
|
||||
int EthernetSend(WOLFSSL* ssl, char* msg, int sz, void* ctx);
|
||||
int EthernetReceive(WOLFSSL* ssl, char* reply, int sz, void* ctx);
|
||||
@@ -51,7 +51,7 @@ void setup() {
|
||||
Serial.println("unable to get ctx");
|
||||
return;
|
||||
}
|
||||
/* initialize wolfSSL using callback functions */
|
||||
// initialize wolfSSL using callback functions
|
||||
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
|
||||
wolfSSL_SetIOSend(ctx, EthernetSend);
|
||||
wolfSSL_SetIORecv(ctx, EthernetReceive);
|
||||
@@ -119,10 +119,7 @@ void loop() {
|
||||
if ((wolfSSL_write(ssl, msg, msgSz)) == msgSz) {
|
||||
|
||||
Serial.print("Server response: ");
|
||||
/* wait for data */
|
||||
while (!client.available()) {}
|
||||
/* read data */
|
||||
while (wolfSSL_pending(ssl)) {
|
||||
while (client.available() || wolfSSL_pending(ssl)) {
|
||||
input = wolfSSL_read(ssl, reply, sizeof(reply) - 1);
|
||||
total_input += input;
|
||||
if (input < 0) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* wolfssl_server.ino
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -31,7 +31,7 @@
|
||||
#error Please undefine NO_WOLFSSL_SERVER for this example
|
||||
#endif
|
||||
|
||||
const int port = 11111; /* port to listen on */
|
||||
const int port = 11111; // port to listen on
|
||||
|
||||
int EthernetSend(WOLFSSL* ssl, char* msg, int sz, void* ctx);
|
||||
int EthernetReceive(WOLFSSL* ssl, char* reply, int sz, void* ctx);
|
||||
@@ -59,12 +59,12 @@ void setup() {
|
||||
return;
|
||||
}
|
||||
|
||||
/* initialize wolfSSL using callback functions */
|
||||
// initialize wolfSSL using callback functions
|
||||
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
|
||||
wolfSSL_SetIOSend(ctx, EthernetSend);
|
||||
wolfSSL_SetIORecv(ctx, EthernetReceive);
|
||||
|
||||
/* setup the private key and certificate */
|
||||
// setup the private key and certificate
|
||||
err = wolfSSL_CTX_use_PrivateKey_buffer(ctx, ecc_key_der_256,
|
||||
sizeof_ecc_key_der_256, WOLFSSL_FILETYPE_ASN1);
|
||||
if (err != WOLFSSL_SUCCESS) {
|
||||
@@ -78,7 +78,7 @@ void setup() {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Start the server */
|
||||
// Start the server
|
||||
server.begin();
|
||||
|
||||
return;
|
||||
@@ -110,7 +110,7 @@ void loop() {
|
||||
int replySz = 0;
|
||||
const char* cipherName;
|
||||
|
||||
/* Listen for incoming client requests. */
|
||||
// Listen for incoming client requests.
|
||||
client = server.available();
|
||||
if (!client) {
|
||||
return;
|
||||
@@ -142,10 +142,7 @@ void loop() {
|
||||
Serial.println(cipherName);
|
||||
|
||||
Serial.print("Server Read: ");
|
||||
/* wait for data */
|
||||
while (!client.available()) {}
|
||||
/* read data */
|
||||
while (wolfSSL_pending(ssl)) {
|
||||
while (client.available() || wolfSSL_pending(ssl)) {
|
||||
input = wolfSSL_read(ssl, reply, sizeof(reply) - 1);
|
||||
if (input < 0) {
|
||||
err = wolfSSL_get_error(ssl, 0);
|
||||
@@ -162,7 +159,7 @@ void loop() {
|
||||
}
|
||||
}
|
||||
|
||||
/* echo data */
|
||||
// echo data
|
||||
if ((wolfSSL_write(ssl, reply, replySz)) != replySz) {
|
||||
err = wolfSSL_get_error(ssl, 0);
|
||||
wolfSSL_ERR_error_string(err, errBuf);
|
||||
|
||||
@@ -11,29 +11,20 @@ space(){
|
||||
}
|
||||
|
||||
if [ "$DIR" = "ARDUINO" ]; then
|
||||
if [ ! -d "wolfSSL" ]; then
|
||||
mkdir wolfSSL
|
||||
fi
|
||||
rm -rf wolfSSL
|
||||
mkdir wolfSSL
|
||||
|
||||
cp ../../src/*.c ./wolfSSL
|
||||
cp ../../wolfcrypt/src/*.c ./wolfSSL
|
||||
|
||||
if [ ! -d "wolfSSL/wolfssl" ]; then
|
||||
mkdir wolfSSL/wolfssl
|
||||
fi
|
||||
mkdir wolfSSL/wolfssl
|
||||
cp ../../wolfssl/*.h ./wolfSSL/wolfssl
|
||||
if [ ! -d "wolfSSL/wolfssl/wolfcrypt" ]; then
|
||||
mkdir wolfSSL/wolfssl/wolfcrypt
|
||||
fi
|
||||
mkdir wolfSSL/wolfssl/wolfcrypt
|
||||
cp ../../wolfssl/wolfcrypt/*.h ./wolfSSL/wolfssl/wolfcrypt
|
||||
|
||||
# support misc.c as include in wolfcrypt/src
|
||||
if [ ! -d "./wolfSSL/wolfcrypt" ]; then
|
||||
mkdir ./wolfSSL/wolfcrypt
|
||||
fi
|
||||
if [ ! -d "./wolfSSL/wolfcrypt/src" ]; then
|
||||
mkdir ./wolfSSL/wolfcrypt/src
|
||||
fi
|
||||
mkdir ./wolfSSL/wolfcrypt
|
||||
mkdir ./wolfSSL/wolfcrypt/src
|
||||
cp ../../wolfcrypt/src/misc.c ./wolfSSL/wolfcrypt/src
|
||||
cp ../../wolfcrypt/src/asm.c ./wolfSSL/wolfcrypt/src
|
||||
|
||||
@@ -41,47 +32,33 @@ if [ "$DIR" = "ARDUINO" ]; then
|
||||
mv ./wolfSSL/bio.c ./wolfSSL/wolfssl
|
||||
mv ./wolfSSL/evp.c ./wolfSSL/wolfssl
|
||||
|
||||
# make a copy of evp.c and bio.c for ssl.c to include inline
|
||||
cp ./wolfSSL/wolfssl/evp.c ./wolfSSL/wolfcrypt/src/evp.c
|
||||
cp ./wolfSSL/wolfssl/bio.c ./wolfSSL/wolfcrypt/src/bio.c
|
||||
|
||||
# copy openssl compatibility headers to their appropriate location
|
||||
if [ ! -d "./wolfSSL/wolfssl/openssl" ]; then
|
||||
mkdir ./wolfSSL/wolfssl/openssl
|
||||
fi
|
||||
cp ../../wolfssl/openssl/* ./wolfSSL/wolfssl/openssl
|
||||
|
||||
echo "/* Generated wolfSSL header file for Arduino */" > ./wolfSSL/wolfssl.h
|
||||
echo "#include <user_settings.h>" >> ./wolfSSL/wolfssl.h
|
||||
echo "#include <wolfssl/wolfcrypt/settings.h>" >> ./wolfSSL/wolfssl.h
|
||||
echo "#include <wolfssl/ssl.h>" >> ./wolfSSL/wolfssl.h
|
||||
|
||||
if [ ! -f "./wolfSSL/user_settings.h" ]; then
|
||||
echo "/* Generated wolfSSL user_settings.h file for Arduino */" > ./wolfSSL/user_settings.h
|
||||
echo "#ifndef ARDUINO_USER_SETTINGS_H" >> ./wolfSSL/user_settings.h
|
||||
echo "#define ARDUINO_USER_SETTINGS_H" >> ./wolfSSL/user_settings.h
|
||||
space ./wolfSSL/user_settings.h
|
||||
echo "/* Platform */" >> ./wolfSSL/user_settings.h
|
||||
echo "#define WOLFSSL_ARDUINO" >> ./wolfSSL/user_settings.h
|
||||
space ./wolfSSL/user_settings.h
|
||||
echo "/* Math library (remove this to use normal math)*/" >> ./wolfSSL/user_settings.h
|
||||
echo "#define USE_FAST_MATH" >> ./wolfSSL/user_settings.h
|
||||
echo "#define TFM_NO_ASM" >> ./wolfSSL/user_settings.h
|
||||
space ./wolfSSL/user_settings.h
|
||||
echo "/* RNG DEFAULT !!FOR TESTING ONLY!! */" >> ./wolfSSL/user_settings.h
|
||||
echo "/* comment out the error below to get started w/ bad entropy source" >> ./wolfSSL/user_settings.h
|
||||
echo " * This will need fixed before distribution but is OK to test with */" >> ./wolfSSL/user_settings.h
|
||||
echo "#error \"needs solved, see: https://www.wolfssl.com/docs/porting-guide/\"" >> ./wolfSSL/user_settings.h
|
||||
echo "#define WOLFSSL_GENSEED_FORTEST" >> ./wolfSSL/user_settings.h
|
||||
space ./wolfSSL/user_settings.h
|
||||
echo "#endif /* ARDUINO_USER_SETTINGS_H */" >> ./wolfSSL/user_settings.h
|
||||
fi
|
||||
echo "/* Generated wolfSSL user_settings.h file for Arduino */" > ./wolfSSL/user_settings.h
|
||||
echo "#ifndef ARDUINO_USER_SETTINGS_H" >> ./wolfSSL/user_settings.h
|
||||
echo "#define ARDUINO_USER_SETTINGS_H" >> ./wolfSSL/user_settings.h
|
||||
space wolfSSL/user_settings.h
|
||||
echo "/* Platform */" >> ./wolfSSL/user_settings.h
|
||||
echo "#define WOLFSSL_ARDUINO" >> ./wolfSSL/user_settings.h
|
||||
space wolfSSL/user_settings.h
|
||||
echo "/* Math library (remove this to use normal math)*/" >> ./wolfSSL/user_settings.h
|
||||
echo "#define USE_FAST_MATH" >> ./wolfSSL/user_settings.h
|
||||
echo "#define TFM_NO_ASM" >> ./wolfSSL/user_settings.h
|
||||
space wolfSSL/user_settings.h
|
||||
echo "/* RNG DEFAULT !!FOR TESTING ONLY!! */" >> ./wolfSSL/user_settings.h
|
||||
echo "/* comment out the error below to get started w/ bad entropy source" >> ./wolfSSL/user_settings.h
|
||||
echo " * This will need fixed before distribution but is OK to test with */" >> ./wolfSSL/user_settings.h
|
||||
echo "#error \"needs solved, see: https://www.wolfssl.com/docs/porting-guide/\"" >> ./wolfSSL/user_settings.h
|
||||
echo "#define WOLFSSL_GENSEED_FORTEST" >> ./wolfSSL/user_settings.h
|
||||
space wolfSSL/user_settings.h
|
||||
echo "#endif /* ARDUINO_USER_SETTINGS_H */" >> ./wolfSSL/user_settings.h
|
||||
|
||||
cp wolfSSL/wolfssl/wolfcrypt/settings.h wolfSSL/wolfssl/wolfcrypt/settings.h.bak
|
||||
echo " /* wolfSSL Generated ARDUINO settings */" > ./wolfSSL/wolfssl/wolfcrypt/settings.h
|
||||
echo "#ifndef WOLFSSL_USER_SETTINGS" >> ./wolfSSL/wolfssl/wolfcrypt/settings.h
|
||||
echo " #define WOLFSSL_USER_SETTINGS" >> ./wolfSSL/wolfssl/wolfcrypt/settings.h
|
||||
echo "#endif /* WOLFSSL_USER_SETTINGS */" >> ./wolfSSL/wolfssl/wolfcrypt/settings.h
|
||||
echo "#define WOLFSSL_ARDUINO" >> ./wolfSSL/wolfssl/wolfcrypt/settings.h
|
||||
echo "#define WOLFSSL_USER_SETTINGS" >> ./wolfSSL/wolfssl/wolfcrypt/settings.h
|
||||
echo " /* wolfSSL Generated ARDUINO settings: END */" >> ./wolfSSL/wolfssl/wolfcrypt/settings.h
|
||||
cat ./wolfSSL/wolfssl/wolfcrypt/settings.h.bak >> ./wolfSSL/wolfssl/wolfcrypt/settings.h
|
||||
|
||||
|
||||
@@ -1,153 +0,0 @@
|
||||
/* Cpu0_Main.c
|
||||
*
|
||||
* Copyright (C) 2006-2022 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
|
||||
*/
|
||||
|
||||
/* Infineon includes */
|
||||
#include "Ifx_Types.h"
|
||||
#include "IfxCpu.h"
|
||||
#include "IfxScuWdt.h"
|
||||
#include "IfxAsclin_Asc.h"
|
||||
#include "IfxCpu_Irq.h"
|
||||
#include "IfxPort.h"
|
||||
#include "SysSe/Bsp/Bsp.h"
|
||||
|
||||
/* For mapping stdio printf */
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/* used to wait for CPU sync event */
|
||||
IFX_ALIGN(4) IfxCpu_syncEvent g_cpuSyncEvent = 0;
|
||||
|
||||
#define SERIAL_BAUDRATE 115200 /* Baud rate in bit/s */
|
||||
#define SERIAL_PIN_RX IfxAsclin0_RXA_P14_1_IN /* RX pin of the board */
|
||||
#define SERIAL_PIN_TX IfxAsclin0_TX_P14_0_OUT /* TX pin of the board */
|
||||
#define INTPRIO_ASCLIN0_TX 19 /* Priority of the ISR */
|
||||
#define ASC_TX_BUFFER_SIZE 128 /* Definition of the buffer size */
|
||||
|
||||
/* Declaration of the ASC handle */
|
||||
static IfxAsclin_Asc g_asc;
|
||||
|
||||
/* Declaration of the FIFOs parameters:
|
||||
* The transfer buffers allocate memory for the data itself and for FIFO runtime
|
||||
* variables. 8 more bytes have to be added to ensure a proper circular buffer
|
||||
* handling independent from the address to which the buffers have been located.
|
||||
*/
|
||||
static uint8 g_ascTxBuffer[ASC_TX_BUFFER_SIZE + sizeof(Ifx_Fifo) + 8];
|
||||
|
||||
/******************************************************************************/
|
||||
/*----Function Implementations------------------------------------------------*/
|
||||
/******************************************************************************/
|
||||
|
||||
/* Re-target the C library printf function to the asc lin. */
|
||||
int fputc(int ch, FILE *f)
|
||||
{
|
||||
Ifx_SizeT count;
|
||||
/* convert to CRLF */
|
||||
if (ch == (int)'\n') {
|
||||
int chcr = (int)'\r';
|
||||
count = 1;
|
||||
IfxAsclin_Asc_write(&g_asc, &chcr, &count, TIME_INFINITE);
|
||||
}
|
||||
count = 1;
|
||||
IfxAsclin_Asc_write(&g_asc, &ch, &count, TIME_INFINITE);
|
||||
return ch;
|
||||
}
|
||||
|
||||
/* Add the Interrupt Service Routine */
|
||||
IFX_INTERRUPT(asclin0_Tx_ISR, 0, INTPRIO_ASCLIN0_TX);
|
||||
void asclin0_Tx_ISR(void)
|
||||
{
|
||||
IfxAsclin_Asc_isrTransmit(&g_asc);
|
||||
}
|
||||
|
||||
static void init_UART(void)
|
||||
{
|
||||
IfxAsclin_Asc_Config ascConfig;
|
||||
|
||||
IfxCpu_Irq_installInterruptHandler(asclin0_Tx_ISR, INTPRIO_ASCLIN0_TX);
|
||||
|
||||
/* Port pins configuration */
|
||||
const IfxAsclin_Asc_Pins pins = {
|
||||
NULL_PTR, IfxPort_InputMode_pullUp, /* CTS pin not used */
|
||||
&SERIAL_PIN_RX, IfxPort_InputMode_pullUp, /* RX pin */
|
||||
NULL_PTR, IfxPort_OutputMode_pushPull, /* RTS pin not used */
|
||||
&SERIAL_PIN_TX, IfxPort_OutputMode_pushPull, /* TX pin */
|
||||
IfxPort_PadDriver_cmosAutomotiveSpeed1
|
||||
};
|
||||
|
||||
/* Initialize an instance of IfxAsclin_Asc_Config with default values */
|
||||
IfxAsclin_Asc_initModuleConfig(&ascConfig, SERIAL_PIN_TX.module);
|
||||
|
||||
/* Set the desired baud rate */
|
||||
ascConfig.baudrate.baudrate = SERIAL_BAUDRATE;
|
||||
|
||||
/* ISR priorities and interrupt target */
|
||||
ascConfig.interrupt.txPriority = INTPRIO_ASCLIN0_TX;
|
||||
ascConfig.interrupt.typeOfService = IfxCpu_Irq_getTos(IfxCpu_getCoreIndex());
|
||||
|
||||
/* FIFO configuration */
|
||||
ascConfig.txBuffer = &g_ascTxBuffer;
|
||||
ascConfig.txBufferSize = ASC_TX_BUFFER_SIZE;
|
||||
|
||||
ascConfig.pins = &pins;
|
||||
|
||||
/* Initialize module with above parameters */
|
||||
IfxAsclin_Asc_initModule(&g_asc, &ascConfig);
|
||||
|
||||
/* Turn off buffers, so I/O occurs immediately */
|
||||
setvbuf(stdin, NULL, _IONBF, 0);
|
||||
setvbuf(stdout, NULL, _IONBF, 0);
|
||||
setvbuf(stderr, NULL, _IONBF, 0);
|
||||
}
|
||||
|
||||
int send_UART(const char* str)
|
||||
{
|
||||
Ifx_SizeT count = (Ifx_SizeT)strlen(str);
|
||||
IfxAsclin_Asc_write(&g_asc, str, &count, TIME_INFINITE);
|
||||
return (int)count;
|
||||
}
|
||||
|
||||
void core0_main(void)
|
||||
{
|
||||
IfxCpu_enableInterrupts();
|
||||
|
||||
/* !!WATCHDOG0 AND SAFETY WATCHDOG ARE DISABLED HERE!!
|
||||
* Enable the watchdogs and service them periodically if it is required
|
||||
*/
|
||||
IfxScuWdt_disableCpuWatchdog(IfxScuWdt_getCpuWatchdogPassword());
|
||||
IfxScuWdt_disableSafetyWatchdog(IfxScuWdt_getSafetyWatchdogPassword());
|
||||
|
||||
/* Wait for CPU sync event */
|
||||
IfxCpu_emitEvent(&g_cpuSyncEvent);
|
||||
IfxCpu_waitEvent(&g_cpuSyncEvent, 1);
|
||||
|
||||
/* Initialize the UART to board VCOM */
|
||||
init_UART();
|
||||
|
||||
/* bare metal loop */
|
||||
while(1)
|
||||
{
|
||||
extern void run_wolf_tests(void);
|
||||
run_wolf_tests();
|
||||
|
||||
/* wait 5 seconds */
|
||||
waitTime(IfxStm_getTicksFromMilliseconds(BSP_DEFAULT_TIMER, 5 * 1000));
|
||||
} /* while */
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
# Infineon AURIX Development Studio
|
||||
|
||||
An Eclipse based IDE for developing software for the Infineon TriCore AURIX TX3XX.
|
||||
|
||||
Tested Platform:
|
||||
* Infineon AURIX™ Development Studio 1.7.2 (Build 20220617-0730)
|
||||
* Infineon TriBoard TC399 v2.0
|
||||
* wolfSSL v5.4.0 (with PR 5419)
|
||||
|
||||
## Running wolfCrypt on TriCore
|
||||
|
||||
1) Add the wolfSSL source and headers to `Libraries/wolfssl`.
|
||||
- Only the following folders are required: `src`, `wolfcrypt` and `wolfssl`.
|
||||
- See script to help with producing bundle here: https://github.com/wolfSSL/wolfssl/blob/master/scripts/makedistsmall.sh
|
||||
2) Add `WOLFSSL_USER_SETTINGS` to the Preprocessing symbols list. C/C++ Build -> Settings -> TASKING C/C++ Compiler -> Preprocessing.
|
||||
3) Add `Libraries/wolfssl` to the include path. C/C++ General -> Paths and Symbols -> Includes -> GNU C
|
||||
4) Add ignores for the following warnings. Unused static function (553) and switch missing break (536). C/C++ Build -> Settings -> TASKING C/C++ Compiler -> Diagnostics
|
||||
5) Copy `Cpu0_Main.c`, `user_settings.h` and `wolf_main.c` into the project folder.
|
||||
6) Increase the stack by modifying `Lcf_Tasking_Tricore_Tc.lsl` to adjusting the USTACK0-4 (`LCF_USTACK#_SIZE`) from 2k to 12k.
|
||||
6) Build and run/debug.
|
||||
|
||||
### Example output from wolfCrypt test and benchmark
|
||||
|
||||
Benchmark Configuration:
|
||||
* TriCore (TC1.6.2P) 32-bit super-scalar running at 300MHz:
|
||||
* Release build: `-O2`
|
||||
* SP Math SMALL: sp_c32.c for RSA/ECC/DH
|
||||
* AES GCM SMALL
|
||||
|
||||
```
|
||||
Running wolfCrypt Tests...
|
||||
------------------------------------------------------------------------------
|
||||
wolfSSL version 5.4.0
|
||||
------------------------------------------------------------------------------
|
||||
error test passed!
|
||||
MEMORY test passed!
|
||||
base64 test passed!
|
||||
asn test passed!
|
||||
RANDOM test passed!
|
||||
SHA test passed!
|
||||
SHA-256 test passed!
|
||||
Hash test passed!
|
||||
HMAC-SHA test passed!
|
||||
HMAC-SHA256 test passed!
|
||||
HMAC-KDF test passed!
|
||||
TLSv1.3 KDF test passed!
|
||||
GMAC test passed!
|
||||
Chacha test passed!
|
||||
POLY1305 test passed!
|
||||
ChaCha20-Poly1305 AEAD test passed!
|
||||
AES test passed!
|
||||
AES192 test passed!
|
||||
AES256 test passed!
|
||||
AES-GCM test passed!
|
||||
RSA test passed!
|
||||
ECC test passed!
|
||||
ECC buffer test passed!
|
||||
CMAC test passed!
|
||||
logging test passed!
|
||||
time test passed!
|
||||
mutex test passed!
|
||||
memcb test passed!
|
||||
Test complete
|
||||
Crypt Test: Return code 0
|
||||
Running wolfCrypt Benchmarks...
|
||||
wolfCrypt Benchmark (block bytes 1024, min 1.0 sec each)
|
||||
RNG 725 KB took 1.023 seconds, 708.703 KB/s
|
||||
AES-128-CBC-enc 2 MB took 1.002 seconds, 2.071 MB/s
|
||||
AES-128-CBC-dec 2 MB took 1.005 seconds, 2.065 MB/s
|
||||
AES-192-CBC-enc 2 MB took 1.002 seconds, 1.779 MB/s
|
||||
AES-192-CBC-dec 2 MB took 1.013 seconds, 1.783 MB/s
|
||||
AES-256-CBC-enc 2 MB took 1.003 seconds, 1.558 MB/s
|
||||
AES-256-CBC-dec 2 MB took 1.009 seconds, 1.573 MB/s
|
||||
AES-128-GCM-enc 225 KB took 1.013 seconds, 222.112 KB/s
|
||||
AES-128-GCM-dec 225 KB took 1.014 seconds, 221.892 KB/s
|
||||
AES-192-GCM-enc 225 KB took 1.046 seconds, 215.107 KB/s
|
||||
AES-192-GCM-dec 225 KB took 1.046 seconds, 215.104 KB/s
|
||||
AES-256-GCM-enc 225 KB took 1.070 seconds, 210.279 KB/s
|
||||
AES-256-GCM-dec 225 KB took 1.069 seconds, 210.477 KB/s
|
||||
GMAC Small 251 KB took 1.000 seconds, 251.000 KB/s
|
||||
AES-128-ECB-enc 2 MB took 1.000 seconds, 2.000 MB/s
|
||||
AES-128-ECB-dec 2 MB took 1.000 seconds, 2.049 MB/s
|
||||
AES-192-ECB-enc 2 MB took 1.000 seconds, 1.727 MB/s
|
||||
AES-192-ECB-dec 2 MB took 1.000 seconds, 1.772 MB/s
|
||||
AES-256-ECB-enc 2 MB took 1.000 seconds, 1.518 MB/s
|
||||
AES-256-ECB-dec 2 MB took 1.000 seconds, 1.563 MB/s
|
||||
CHACHA 3 MB took 1.007 seconds, 3.322 MB/s
|
||||
CHA-POLY 2 MB took 1.011 seconds, 2.028 MB/s
|
||||
POLY1305 6 MB took 1.003 seconds, 6.012 MB/s
|
||||
SHA 3 MB took 1.004 seconds, 3.380 MB/s
|
||||
SHA-256 2 MB took 1.003 seconds, 1.558 MB/s
|
||||
AES-128-CMAC 2 MB took 1.010 seconds, 2.055 MB/s
|
||||
AES-256-CMAC 2 MB took 1.010 seconds, 1.547 MB/s
|
||||
HMAC-SHA 3 MB took 1.004 seconds, 3.356 MB/s
|
||||
HMAC-SHA256 2 MB took 1.010 seconds, 1.547 MB/s
|
||||
RSA 2048 public 50 ops took 1.020 sec, avg 20.400 ms, 49.019 ops/sec
|
||||
RSA 2048 private 2 ops took 2.377 sec, avg 1188.492 ms, 0.841 ops/sec
|
||||
ECC [ SECP256R1] 256 key gen 16 ops took 1.061 sec, avg 66.313 ms, 15.080 ops/sec
|
||||
ECDHE [ SECP256R1] 256 agree 16 ops took 1.059 sec, avg 66.187 ms, 15.109 ops/sec
|
||||
ECDSA [ SECP256R1] 256 sign 14 ops took 1.058 sec, avg 75.570 ms, 13.233 ops/sec
|
||||
ECDSA [ SECP256R1] 256 verify 8 ops took 1.080 sec, avg 135.002 ms, 7.407 ops/sec
|
||||
Benchmark complete
|
||||
Benchmark Test: Return code 0
|
||||
```
|
||||
|
||||
|
||||
## Running wolfCrypt on the HSM (Cortex M3)
|
||||
|
||||
Coming soon
|
||||
|
||||
|
||||
## Support
|
||||
|
||||
For questions please email facts@wolfssl.com
|
||||
@@ -1,8 +0,0 @@
|
||||
# vim:ft=automake
|
||||
# included from Top Level Makefile.am
|
||||
# All paths should be given relative to the root
|
||||
|
||||
EXTRA_DIST+= IDE/AURIX/Cpu0_Main.c
|
||||
EXTRA_DIST+= IDE/AURIX/README.md
|
||||
EXTRA_DIST+= IDE/AURIX/user_settings.h
|
||||
EXTRA_DIST+= IDE/AURIX/wolf_main.c
|
||||
@@ -1,461 +0,0 @@
|
||||
/* user_settings.h
|
||||
*
|
||||
* Copyright (C) 2006-2022 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
|
||||
*/
|
||||
|
||||
/* Template for the Infineon AURIX Development Studio and TC3XX
|
||||
* Example wolfSSL user settings with #if 0/1 gates to enable/disable algorithms and features.
|
||||
* This file is included with wolfssl/wolfcrypt/settings.h when WOLFSSL_USER_SETTINGS is defined.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef WOLFSSL_USER_SETTINGS_H
|
||||
#define WOLFSSL_USER_SETTINGS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Platform */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Alignment and sizeof 64-bit */
|
||||
#define WOLFSSL_GENERAL_ALIGNMENT 4
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
|
||||
/* disable threading - mutex locking */
|
||||
#define SINGLE_THREADED
|
||||
|
||||
/* ignore file include warnings */
|
||||
#define WOLFSSL_IGNORE_FILE_WARN
|
||||
|
||||
/* disable the built-in socket support and use the IO callbacks.
|
||||
* Set with wolfSSL_CTX_SetIORecv/wolfSSL_CTX_SetIOSend
|
||||
*/
|
||||
#define WOLFSSL_USER_IO
|
||||
|
||||
/* Disable file system */
|
||||
#define NO_FILESYSTEM
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Port */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/* Override Current Time */
|
||||
/* Allows custom "custom_time()" function to be used for benchmark */
|
||||
#define WOLFSSL_USER_CURRTIME
|
||||
#define WOLFSSL_GMTIME
|
||||
#define USER_TICKS
|
||||
extern unsigned long my_time(unsigned long* timer);
|
||||
#define XTIME my_time
|
||||
|
||||
/* Use built-in P-RNG (SHA256 based) with HW RNG */
|
||||
#undef HAVE_HASHDRBG
|
||||
#define HAVE_HASHDRBG
|
||||
|
||||
/* Custom Seed Source */
|
||||
#define CUSTOM_RAND_TYPE unsigned int
|
||||
extern unsigned int my_rng_seed_gen(void);
|
||||
#undef CUSTOM_RAND_GENERATE
|
||||
#define CUSTOM_RAND_GENERATE my_rng_seed_gen
|
||||
|
||||
/* Standard Lib - C89 */
|
||||
#define XSTRCASECMP(s1,s2) strcmp((s1),(s2))
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Math Configuration */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
#undef USE_FAST_MATH
|
||||
#undef WOLFSSL_SP
|
||||
#if 1
|
||||
/* Wolf Single Precision Math */
|
||||
#define WOLFSSL_HAVE_SP_RSA
|
||||
//#define WOLFSSL_HAVE_SP_DH
|
||||
#define WOLFSSL_HAVE_SP_ECC
|
||||
#define WOLFSSL_SP_4096 /* Enable RSA/RH 4096-bit support */
|
||||
#define WOLFSSL_SP_384 /* Enable ECC 384-bit SECP384R1 support */
|
||||
|
||||
#define WOLFSSL_SP_MATH /* only SP math - disables integer.c/tfm.c */
|
||||
//#define WOLFSSL_SP_MATH_ALL /* use SP math for all key sizes and curves */
|
||||
|
||||
#define WOLFSSL_SP_NO_MALLOC
|
||||
//#define WOLFSSL_SP_DIV_32 /* do not use 64-bit divides */
|
||||
//#define WOLFSSL_SP_CACHE_RESISTANT
|
||||
|
||||
/* use smaller version of code */
|
||||
#define WOLFSSL_SP_SMALL
|
||||
|
||||
/* SP Assembly Speedups - specific to chip type */
|
||||
//#define WOLFSSL_SP_ASM
|
||||
//#define WOLFSSL_SP_ARM32_ASM
|
||||
//#define WOLFSSL_SP_ARM64_ASM
|
||||
//#define WOLFSSL_SP_ARM_THUMB_ASM
|
||||
//#define WOLFSSL_SP_ARM_CORTEX_M_ASM
|
||||
#endif
|
||||
|
||||
#ifndef WOLFSSL_SP_MATH
|
||||
#if 0
|
||||
/* fast math (tfmc.) (stack based and timing resistant) */
|
||||
#define USE_FAST_MATH
|
||||
#define TFM_TIMING_RESISTANT
|
||||
#else
|
||||
/* normal heap based integer.c (not timing resistant) */
|
||||
#define USE_INTEGER_HEAP_MATH
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Crypto */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* RSA */
|
||||
#undef NO_RSA
|
||||
#if 1
|
||||
#ifdef USE_FAST_MATH
|
||||
/* Maximum math bits (Max RSA key bits * 2) */
|
||||
#define FP_MAX_BITS 4096
|
||||
#endif
|
||||
|
||||
/* half as much memory but twice as slow */
|
||||
//#define RSA_LOW_MEM
|
||||
|
||||
/* Enables blinding mode, to prevent timing attacks */
|
||||
#define WC_RSA_BLINDING
|
||||
|
||||
/* RSA PSS Support */
|
||||
#define WC_RSA_PSS
|
||||
#else
|
||||
#define NO_RSA
|
||||
#endif
|
||||
|
||||
/* DH */
|
||||
#undef NO_DH
|
||||
#if 0
|
||||
/* Use table for DH instead of -lm (math) lib dependency */
|
||||
#if 1
|
||||
#define WOLFSSL_DH_CONST
|
||||
#define HAVE_FFDHE_2048
|
||||
//#define HAVE_FFDHE_4096
|
||||
//#define HAVE_FFDHE_6144
|
||||
//#define HAVE_FFDHE_8192
|
||||
#endif
|
||||
#else
|
||||
#define NO_DH
|
||||
#endif
|
||||
|
||||
/* ECC */
|
||||
#undef HAVE_ECC
|
||||
#if 1
|
||||
#define HAVE_ECC
|
||||
|
||||
/* Manually define enabled curves */
|
||||
#define ECC_USER_CURVES
|
||||
|
||||
#ifdef ECC_USER_CURVES
|
||||
/* Manual Curve Selection */
|
||||
//#define HAVE_ECC192
|
||||
//#define HAVE_ECC224
|
||||
#undef NO_ECC256
|
||||
#define HAVE_ECC384
|
||||
//#define HAVE_ECC521
|
||||
#endif
|
||||
|
||||
/* Fixed point cache (speeds repeated operations against same private key) */
|
||||
//#define FP_ECC
|
||||
#ifdef FP_ECC
|
||||
/* Bits / Entries */
|
||||
#define FP_ENTRIES 2
|
||||
#define FP_LUT 4
|
||||
#endif
|
||||
|
||||
/* Optional ECC calculation method */
|
||||
/* Note: doubles heap usage, but slightly faster */
|
||||
#define ECC_SHAMIR
|
||||
|
||||
/* Reduces heap usage, but slower */
|
||||
#define ECC_TIMING_RESISTANT
|
||||
|
||||
/* Compressed ECC Key Support */
|
||||
//#define HAVE_COMP_KEY
|
||||
|
||||
/* Use alternate ECC size for ECC math */
|
||||
#ifdef USE_FAST_MATH
|
||||
/* MAX ECC BITS = ROUND8(MAX ECC) * 2 */
|
||||
#if defined(NO_RSA) && defined(NO_DH)
|
||||
/* Custom fastmath size if not using RSA/DH */
|
||||
#define FP_MAX_BITS (256 * 2)
|
||||
#else
|
||||
/* use heap allocation for ECC points */
|
||||
#define ALT_ECC_SIZE
|
||||
|
||||
/* wolfSSL will compute the FP_MAX_BITS_ECC, but it can be overriden */
|
||||
//#define FP_MAX_BITS_ECC (256 * 2)
|
||||
#endif
|
||||
|
||||
/* Speedups specific to curve */
|
||||
#ifndef NO_ECC256
|
||||
#define TFM_ECC256
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* AES */
|
||||
#undef NO_AES
|
||||
#if 1
|
||||
#define HAVE_AES_CBC
|
||||
|
||||
/* GCM Method: GCM_TABLE_4BIT, GCM_SMALL, GCM_WORD32 or GCM_TABLE */
|
||||
#define HAVE_AESGCM
|
||||
#define GCM_SMALL
|
||||
|
||||
#define WOLFSSL_AES_DIRECT
|
||||
#define HAVE_AES_ECB
|
||||
#else
|
||||
#define NO_AES
|
||||
#endif
|
||||
|
||||
|
||||
/* DES3 */
|
||||
#undef NO_DES3
|
||||
#if 0
|
||||
#else
|
||||
#define NO_DES3
|
||||
#endif
|
||||
|
||||
/* ChaCha20 / Poly1305 */
|
||||
#undef HAVE_CHACHA
|
||||
#undef HAVE_POLY1305
|
||||
#if 1
|
||||
#define HAVE_CHACHA
|
||||
#define HAVE_POLY1305
|
||||
|
||||
/* Needed for Poly1305 */
|
||||
#define HAVE_ONE_TIME_AUTH
|
||||
#endif
|
||||
|
||||
/* Ed25519 / Curve25519 */
|
||||
#undef HAVE_CURVE25519
|
||||
#undef HAVE_ED25519
|
||||
#if 0
|
||||
#define HAVE_CURVE25519
|
||||
#define HAVE_ED25519 /* ED25519 Requires SHA512 */
|
||||
|
||||
/* Optionally use small math (less flash usage, but much slower) */
|
||||
#if 1
|
||||
#define CURVED25519_SMALL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Hashing */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Sha */
|
||||
#undef NO_SHA
|
||||
#if 1
|
||||
/* on by default */
|
||||
/* 1k smaller, but 25% slower */
|
||||
//#define USE_SLOW_SHA
|
||||
#else
|
||||
#define NO_SHA
|
||||
#endif
|
||||
|
||||
/* Sha256 */
|
||||
#undef NO_SHA256
|
||||
#if 1
|
||||
/* not unrolled - ~2k smaller and ~25% slower */
|
||||
//#define USE_SLOW_SHA256
|
||||
|
||||
/* Sha224 */
|
||||
#if 0
|
||||
#define WOLFSSL_SHA224
|
||||
#endif
|
||||
#else
|
||||
#define NO_SHA256
|
||||
#endif
|
||||
|
||||
/* Sha512 */
|
||||
#undef WOLFSSL_SHA512
|
||||
#if 0
|
||||
#define WOLFSSL_SHA512
|
||||
|
||||
/* Sha384 */
|
||||
#undef WOLFSSL_SHA384
|
||||
#if 0
|
||||
#define WOLFSSL_SHA384
|
||||
#endif
|
||||
|
||||
/* over twice as small, but 50% slower */
|
||||
//#define USE_SLOW_SHA512
|
||||
#endif
|
||||
|
||||
/* Sha3 */
|
||||
#undef WOLFSSL_SHA3
|
||||
#if 0
|
||||
#define WOLFSSL_SHA3
|
||||
#endif
|
||||
|
||||
/* MD5 */
|
||||
#undef NO_MD5
|
||||
#if 0
|
||||
/* on by default */
|
||||
#else
|
||||
#define NO_MD5
|
||||
#endif
|
||||
|
||||
/* HKDF */
|
||||
#undef HAVE_HKDF
|
||||
#if 1
|
||||
#define HAVE_HKDF
|
||||
#endif
|
||||
|
||||
/* CMAC */
|
||||
#undef WOLFSSL_CMAC
|
||||
#if 1
|
||||
#define WOLFSSL_CMAC
|
||||
/* Note: requires WOLFSSL_AES_DIRECT */
|
||||
#endif
|
||||
|
||||
/* HMAC - on by default */
|
||||
#undef NO_HMAC
|
||||
#if 1
|
||||
/* on by default */
|
||||
#else
|
||||
#define NO_HMAC
|
||||
#endif
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* ASN */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
#if 0
|
||||
/* Use the newer ASN template code */
|
||||
#define WOLFSSL_ASN_TEMPLATE
|
||||
//#define WOLFSSL_CUSTOM_OID
|
||||
//#define HAVE_OID_ENCODING
|
||||
//#define HAVE_OID_DECODING
|
||||
#else
|
||||
/* Use the original custom ASN code */
|
||||
#endif
|
||||
/* Optionally disable time checking for ASN */
|
||||
//#define NO_ASN_TIME
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Benchmark / Test */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Use reduced benchmark / test sizes */
|
||||
#define BENCH_EMBEDDED
|
||||
|
||||
/* Use test buffers from array (not filesystem) */
|
||||
#ifndef NO_FILESYSTEM
|
||||
#define USE_CERT_BUFFERS_256
|
||||
#define USE_CERT_BUFFERS_2048
|
||||
#endif
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Debugging */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#undef DEBUG_WOLFSSL
|
||||
#undef NO_ERROR_STRINGS
|
||||
#if 0
|
||||
#define DEBUG_WOLFSSL
|
||||
#define WOLFSSL_LOG_PRINTF
|
||||
#else
|
||||
#if 0
|
||||
#define NO_ERROR_STRINGS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Memory */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
#if 0
|
||||
/* Static memory requires fast math or SP math with no malloc */
|
||||
#define WOLFSSL_STATIC_MEMORY
|
||||
|
||||
/* Disable fallback malloc/free */
|
||||
#define WOLFSSL_NO_MALLOC
|
||||
#if 1
|
||||
#define WOLFSSL_MALLOC_CHECK /* trap malloc failure */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Enable Features */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#define WOLFSSL_TLS13
|
||||
#define WOLFSSL_OLD_PRIME_CHECK /* Use faster DH prime checking */
|
||||
#define HAVE_TLS_EXTENSIONS
|
||||
#define HAVE_SUPPORTED_CURVES
|
||||
#define WOLFSSL_BASE64_ENCODE
|
||||
|
||||
//#define WOLFSSL_KEY_GEN /* For RSA Key gen only */
|
||||
//#define KEEP_PEER_CERT
|
||||
//#define HAVE_COMP_KEY
|
||||
|
||||
/* TLS Session Cache */
|
||||
#if 0
|
||||
#define SMALL_SESSION_CACHE
|
||||
#else
|
||||
#define NO_SESSION_CACHE
|
||||
#endif
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Disable Features */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
//#define NO_WOLFSSL_SERVER
|
||||
//#define NO_WOLFSSL_CLIENT
|
||||
//#define NO_CRYPT_TEST
|
||||
//#define NO_CRYPT_BENCHMARK
|
||||
//#define WOLFCRYPT_ONLY
|
||||
|
||||
/* In-lining of misc.c functions */
|
||||
/* If defined, must include wolfcrypt/src/misc.c in build */
|
||||
/* Slower, but about 1k smaller */
|
||||
//#define NO_INLINE
|
||||
|
||||
#define NO_WRITEV
|
||||
#define NO_MAIN_DRIVER
|
||||
//#define NO_DEV_RANDOM
|
||||
|
||||
#define NO_OLD_TLS
|
||||
#define NO_PSK
|
||||
|
||||
#define NO_DSA
|
||||
#define NO_RC4
|
||||
#define NO_MD4
|
||||
#define NO_PWDBASED
|
||||
//#define NO_CODING
|
||||
//#define NO_CERTS
|
||||
//#define NO_SIG_WRAPPER
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* WOLFSSL_USER_SETTINGS_H */
|
||||
@@ -1,150 +0,0 @@
|
||||
/* wolf_main.c
|
||||
*
|
||||
* Copyright (C) 2006-2022 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
|
||||
*/
|
||||
|
||||
|
||||
/* wolfSSL includes */
|
||||
#ifndef WOLFSSL_USER_SETTINGS
|
||||
#include <wolfssl/options.h>
|
||||
#endif
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
#include <wolfssl/wolfcrypt/error-crypt.h>
|
||||
#include <wolfssl/wolfcrypt/random.h> /* for CUSTOM_RAND_TYPE */
|
||||
#include <wolfcrypt/test/test.h>
|
||||
#include <wolfcrypt/benchmark/benchmark.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
/* Infineon Includes */
|
||||
#include "Ifx_Types.h"
|
||||
#include "IfxStm.h"
|
||||
|
||||
extern int send_UART(const char* str);
|
||||
static void my_logging_cb(const int logLevel, const char *const logMessage)
|
||||
{
|
||||
send_UART(logMessage);
|
||||
send_UART("\r\n");
|
||||
(void)logLevel; /* not used */
|
||||
}
|
||||
|
||||
/* TIME CODE */
|
||||
/* Optionally you can define NO_ASN_TIME to disable all cert time checks */
|
||||
static int hw_get_time_sec(void)
|
||||
{
|
||||
/* get time in seconds */
|
||||
return IfxStm_get(&MODULE_STM0) / IfxStm_getFrequency(&MODULE_STM0);
|
||||
}
|
||||
|
||||
/* This is used by wolfCrypt asn.c for cert time checking */
|
||||
unsigned long my_time(unsigned long* timer)
|
||||
{
|
||||
(void)timer;
|
||||
return hw_get_time_sec();
|
||||
}
|
||||
|
||||
#ifndef WOLFCRYPT_ONLY
|
||||
/* This is used by TLS only */
|
||||
unsigned int LowResTimer(void)
|
||||
{
|
||||
return hw_get_time_sec();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef NO_CRYPT_BENCHMARK
|
||||
/* This is used by wolfCrypt benchmark tool only */
|
||||
double current_time(int reset)
|
||||
{
|
||||
double timeNow;
|
||||
uint64_t timeMs, ticks = IfxStm_get(&MODULE_STM0);
|
||||
(void)reset;
|
||||
timeMs = ticks / (IfxStm_getFrequency(&MODULE_STM0) / 1000);
|
||||
timeNow = (timeMs / 1000); // sec
|
||||
timeNow += (double)(timeMs % 1000) / 1000; // ms
|
||||
return timeNow;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* RNG CODE */
|
||||
/* TODO: Implement real RNG */
|
||||
static unsigned int gCounter;
|
||||
unsigned int hw_rand(void)
|
||||
{
|
||||
//#warning Must implement your own random source
|
||||
|
||||
return ++gCounter;
|
||||
}
|
||||
|
||||
unsigned int my_rng_seed_gen(void)
|
||||
{
|
||||
return hw_rand();
|
||||
}
|
||||
|
||||
typedef struct func_args {
|
||||
int argc;
|
||||
char** argv;
|
||||
int return_code;
|
||||
} func_args;
|
||||
|
||||
void run_wolf_tests(void)
|
||||
{
|
||||
func_args args;
|
||||
|
||||
#ifdef DEBUG_WOLFSSL
|
||||
wolfSSL_Debugging_ON();
|
||||
#endif
|
||||
wolfSSL_SetLoggingCb(my_logging_cb);
|
||||
|
||||
/* initialize wolfSSL */
|
||||
#ifdef WOLFCRYPT_ONLY
|
||||
wolfCrypt_Init();
|
||||
#else
|
||||
wolfSSL_Init();
|
||||
#endif
|
||||
|
||||
memset(&args, 0, sizeof(args));
|
||||
args.return_code = NOT_COMPILED_IN; /* default */
|
||||
|
||||
printf("Running wolfCrypt Tests...\n");
|
||||
#ifndef NO_CRYPT_TEST
|
||||
args.return_code = 0;
|
||||
wolfcrypt_test(&args);
|
||||
printf("Crypt Test: Return code %d\n", args.return_code);
|
||||
#else
|
||||
args.return_code = NOT_COMPILED_IN;
|
||||
#endif
|
||||
|
||||
printf("Running wolfCrypt Benchmarks...\n");
|
||||
#ifndef NO_CRYPT_BENCHMARK
|
||||
args.return_code = 0;
|
||||
benchmark_test(&args);
|
||||
#else
|
||||
args.return_code = NOT_COMPILED_IN;
|
||||
#endif
|
||||
printf("Benchmark Test: Return code %d\n", args.return_code);
|
||||
|
||||
#ifdef WOLFCRYPT_ONLY
|
||||
wolfCrypt_Cleanup();
|
||||
#else
|
||||
wolfSSL_Cleanup();
|
||||
#endif
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
cc_library_shared {
|
||||
|
||||
name: "libwolfssl",
|
||||
|
||||
arch: {
|
||||
arm: {
|
||||
instruction_set: "arm",
|
||||
},
|
||||
arm64: {
|
||||
cflags: ["-DARM64"],
|
||||
},
|
||||
},
|
||||
compile_multilib: "both",
|
||||
export_include_dirs: ["."],
|
||||
shared_libs: ["liblog"],
|
||||
cflags: [
|
||||
"-DWOLFSSL_USER_SETTINGS",
|
||||
"-Os",
|
||||
"-fomit-frame-pointer",
|
||||
|
||||
/* If using WOLFSSL_ARMASM then add these cflags for ARM crypto extensions */
|
||||
/* "-mcpu=cortex-a73+crypto", */
|
||||
/* "-march=armv8-a", */
|
||||
/* "-mstrict-align", */
|
||||
],
|
||||
include_dirs: [
|
||||
"external/wolfssl/wolfssl",
|
||||
"external/wolfssl",
|
||||
],
|
||||
|
||||
srcs: [
|
||||
"./src/crl.c",
|
||||
"./src/internal.c",
|
||||
"./src/keys.c",
|
||||
"./src/ocsp.c",
|
||||
"./src/sniffer.c",
|
||||
"./src/ssl.c",
|
||||
"./src/tls.c",
|
||||
"./src/tls13.c",
|
||||
"./src/wolfio.c",
|
||||
] + [
|
||||
"./wolfcrypt/src/aes.c",
|
||||
"./wolfcrypt/src/arc4.c",
|
||||
"./wolfcrypt/src/asm.c",
|
||||
"./wolfcrypt/src/asn.c",
|
||||
"./wolfcrypt/src/blake2b.c",
|
||||
"./wolfcrypt/src/blake2s.c",
|
||||
"./wolfcrypt/src/camellia.c",
|
||||
"./wolfcrypt/src/chacha.c",
|
||||
"./wolfcrypt/src/chacha20_poly1305.c",
|
||||
"./wolfcrypt/src/cmac.c",
|
||||
"./wolfcrypt/src/coding.c",
|
||||
"./wolfcrypt/src/compress.c",
|
||||
"./wolfcrypt/src/cpuid.c",
|
||||
"./wolfcrypt/src/cryptocb.c",
|
||||
"./wolfcrypt/src/curve25519.c",
|
||||
"./wolfcrypt/src/curve448.c",
|
||||
"./wolfcrypt/src/des3.c",
|
||||
"./wolfcrypt/src/dh.c",
|
||||
"./wolfcrypt/src/dsa.c",
|
||||
"./wolfcrypt/src/ecc.c",
|
||||
"./wolfcrypt/src/ecc_fp.c",
|
||||
"./wolfcrypt/src/ed25519.c",
|
||||
"./wolfcrypt/src/ed448.c",
|
||||
"./wolfcrypt/src/error.c",
|
||||
"./wolfcrypt/src/fe_448.c",
|
||||
"./wolfcrypt/src/fe_low_mem.c",
|
||||
"./wolfcrypt/src/fe_operations.c",
|
||||
"./wolfcrypt/src/fips.c",
|
||||
"./wolfcrypt/src/fips_test.c",
|
||||
"./wolfcrypt/src/ge_448.c",
|
||||
"./wolfcrypt/src/ge_low_mem.c",
|
||||
"./wolfcrypt/src/ge_operations.c",
|
||||
"./wolfcrypt/src/hash.c",
|
||||
"./wolfcrypt/src/kdf.c",
|
||||
"./wolfcrypt/src/hmac.c",
|
||||
"./wolfcrypt/src/integer.c",
|
||||
"./wolfcrypt/src/kdf.c",
|
||||
"./wolfcrypt/src/logging.c",
|
||||
"./wolfcrypt/src/md2.c",
|
||||
"./wolfcrypt/src/md4.c",
|
||||
"./wolfcrypt/src/md5.c",
|
||||
"./wolfcrypt/src/memory.c",
|
||||
"./wolfcrypt/src/pkcs12.c",
|
||||
"./wolfcrypt/src/pkcs7.c",
|
||||
"./wolfcrypt/src/poly1305.c",
|
||||
"./wolfcrypt/src/pwdbased.c",
|
||||
"./wolfcrypt/src/random.c",
|
||||
"./wolfcrypt/src/rc2.c",
|
||||
"./wolfcrypt/src/ripemd.c",
|
||||
"./wolfcrypt/src/rsa.c",
|
||||
"./wolfcrypt/src/selftest.c",
|
||||
"./wolfcrypt/src/sha256.c",
|
||||
"./wolfcrypt/src/sha3.c",
|
||||
"./wolfcrypt/src/sha512.c",
|
||||
"./wolfcrypt/src/sha.c",
|
||||
"./wolfcrypt/src/signature.c",
|
||||
"./wolfcrypt/src/sp_arm32.c",
|
||||
"./wolfcrypt/src/sp_arm64.c",
|
||||
"./wolfcrypt/src/sp_armthumb.c",
|
||||
"./wolfcrypt/src/sp_c32.c",
|
||||
"./wolfcrypt/src/sp_c64.c",
|
||||
"./wolfcrypt/src/sp_cortexm.c",
|
||||
"./wolfcrypt/src/sp_dsp32.c",
|
||||
"./wolfcrypt/src/sp_int.c",
|
||||
"./wolfcrypt/src/sp_x86_64.c",
|
||||
"./wolfcrypt/src/srp.c",
|
||||
"./wolfcrypt/src/tfm.c",
|
||||
"./wolfcrypt/src/wc_dsp.c",
|
||||
"./wolfcrypt/src/wc_encrypt.c",
|
||||
"./wolfcrypt/src/wc_pkcs11.c",
|
||||
"./wolfcrypt/src/wc_port.c",
|
||||
"./wolfcrypt/src/wolfcrypt_first.c",
|
||||
"./wolfcrypt/src/wolfcrypt_last.c",
|
||||
"./wolfcrypt/src/wolfevent.c",
|
||||
"./wolfcrypt/src/wolfmath.c",
|
||||
],
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
# Android wolfSSL Support
|
||||
|
||||
Tested on Android v8.1 with WPA Supplicant and KeyStore to replace BoringSSL.
|
||||
|
||||
## Files
|
||||
|
||||
* `Android.bp`: Template build system file for wolfSSL.
|
||||
* `user_settings.h`: Template build settings for wolfSSL
|
||||
|
||||
## Installation
|
||||
|
||||
1) Place the wolfSSL library into `./external/wolfssl`
|
||||
2) Copy `Android.bp` into `./external/wolfssl`
|
||||
3) Copy `user_settings.h` into `./external/wolfssl`
|
||||
4) Add `PRODUCT_PACKAGES += libwolfssl` to your device .mk.
|
||||
|
||||
## Typical Android build instruction
|
||||
|
||||
```sh
|
||||
source build/envsetup.sh
|
||||
lunch [num]
|
||||
mm -j8
|
||||
```
|
||||
|
||||
## Using wolfSSL in your Application
|
||||
|
||||
In your `Android.mk` build file for your application add the following:
|
||||
|
||||
```makefile
|
||||
# Crypto Provider - wolfSSL
|
||||
LOCAL_CFLAGS += -DWOLFSSL_USER_SETTINGS -Iexternal/wolfssl -Iexternal/wolfssl/wolfssl
|
||||
LOCAL_SHARED_LIBRARIES += libwolfssl
|
||||
```
|
||||
|
||||
## Support
|
||||
|
||||
For questions please email support@wolfssl.com
|
||||
@@ -1,8 +0,0 @@
|
||||
# vim:ft=automake
|
||||
# included from Top Level Makefile.am
|
||||
# All paths should be given relative to the root
|
||||
|
||||
EXTRA_DIST += \
|
||||
IDE/Android/Android.bp \
|
||||
IDE/Android/README.md \
|
||||
IDE/Android/user_settings.h
|
||||
@@ -1,138 +0,0 @@
|
||||
/* Custom build settings for Android */
|
||||
|
||||
#ifndef _WOLF_USER_SETTINGS_H_
|
||||
#define _WOLF_USER_SETTINGS_H_
|
||||
|
||||
#if 0
|
||||
#define HAVE_FIPS_VERSION 2
|
||||
#define HAVE_FIPS
|
||||
#endif
|
||||
|
||||
#ifdef __aarch64__
|
||||
#if !defined(__clang__) || \
|
||||
(defined(__clang__) && defined(__clang_major__) && __clang_major__ >= 5)
|
||||
/* older clang v4 has issue with inline assembly constraints */
|
||||
#define WOLFSSL_ARMASM
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if 1 /* SP Assembly Speedups (wPAA) */
|
||||
#define WOLFSSL_SP
|
||||
#define WOLFSSL_SP_SMALL /* use smaller version of code */
|
||||
#define WOLFSSL_HAVE_SP_RSA
|
||||
#define WOLFSSL_HAVE_SP_DH
|
||||
#define WOLFSSL_HAVE_SP_ECC
|
||||
#ifdef WOLFSSL_ARMASM
|
||||
#define WOLFSSL_SP_ARM64_ASM
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* WPA Supplicant Support */
|
||||
#define WOLFSSL_WPAS_SMALL
|
||||
#define OPENSSL_ALL
|
||||
#define HAVE_THREAD_LS
|
||||
|
||||
#define USE_FAST_MATH
|
||||
#define FP_MAX_BITS (4096*2) /* Maximum math bits (Max RSA key bits * 2) */
|
||||
#define TFM_TIMING_RESISTANT
|
||||
#define ECC_TIMING_RESISTANT
|
||||
#define WC_RSA_BLINDING
|
||||
|
||||
#define HAVE_HASHDRBG
|
||||
|
||||
#if 1
|
||||
#define WOLFSSL_TLS13
|
||||
#endif
|
||||
#define WC_RSA_PSS
|
||||
#define HAVE_SESSION_TICKET
|
||||
#define HAVE_TLS_EXTENSIONS
|
||||
#define HAVE_SUPPORTED_CURVES
|
||||
#define HAVE_EXTENDED_MASTER
|
||||
#define HAVE_ENCRYPT_THEN_MAC
|
||||
#define WOLFSSL_ENCRYPTED_KEYS
|
||||
#define HAVE_KEYING_MATERIAL
|
||||
#define NO_OLD_TLS
|
||||
#define NO_CHECK_PRIVATE_KEY
|
||||
|
||||
/* enable PK callback support for signing operations to key store */
|
||||
#define HAVE_PK_CALLBACKS
|
||||
/* crypto callback support is not in FIPS 3389 */
|
||||
#ifndef HAVE_FIPS
|
||||
#define WOLF_CRYPTO_CB
|
||||
#endif
|
||||
|
||||
#define KEEP_OUR_CERT
|
||||
#define KEEP_PEER_CERT
|
||||
#define WOLFSSL_ALWAYS_VERIFY_CB
|
||||
#define WOLFSSL_ALWAYS_KEEP_SNI
|
||||
#define HAVE_EX_DATA
|
||||
#define HAVE_EXT_CACHE
|
||||
#define WOLFSSL_EITHER_SIDE
|
||||
#define WOLFSSL_PUBLIC_MP
|
||||
#define WOLFSSL_DER_LOAD
|
||||
|
||||
#define WOLFSSL_CERT_GEN
|
||||
#define WOLFSSL_CERT_EXT
|
||||
#define WOLFSSL_CERT_REQ
|
||||
|
||||
#define WOLFSSL_KEY_GEN
|
||||
#define WC_RSA_NO_PADDING
|
||||
|
||||
#define WOLFSSL_DH_CONST
|
||||
#define HAVE_FFDHE_2048
|
||||
#define HAVE_FFDHE_3072
|
||||
#define HAVE_FFDHE_4096
|
||||
#define HAVE_DH_DEFAULT_PARAMS
|
||||
#ifdef HAVE_FIPS
|
||||
#define WOLFSSL_VALIDATE_FFC_IMPORT
|
||||
#define HAVE_FFDHE_Q
|
||||
#endif
|
||||
|
||||
#define WOLFSSL_SHA224
|
||||
#define WOLFSSL_SHA512
|
||||
#define WOLFSSL_SHA384
|
||||
#define WOLFSSL_NOSHA512_256
|
||||
#define WOLFSSL_NOSHA512_224
|
||||
#define WOLFSSL_SHA3
|
||||
|
||||
#define HAVE_HKDF
|
||||
#define HAVE_PKCS8
|
||||
|
||||
#define HAVE_ECC
|
||||
#define TFM_ECC256
|
||||
#define ECC_SHAMIR
|
||||
#define HAVE_COMP_KEY
|
||||
#ifdef HAVE_FIPS
|
||||
#define HAVE_ECC_CDH
|
||||
#define WOLFSSL_VALIDATE_ECC_IMPORT
|
||||
#endif
|
||||
#ifdef __i386
|
||||
#define TFM_NO_ASM
|
||||
#endif
|
||||
|
||||
#define HAVE_AESGCM
|
||||
#define HAVE_AESCCM
|
||||
#define WOLFSSL_AES_DIRECT
|
||||
#define WOLFSSL_AES_COUNTER
|
||||
#define HAVE_AES_ECB
|
||||
#define WOLFSSL_CMAC
|
||||
|
||||
#define WOLFSSL_BASE64_ENCODE
|
||||
#define HAVE_CRL
|
||||
|
||||
#define NO_DSA
|
||||
#define NO_RC4
|
||||
#define NO_PSK
|
||||
#define WOLFSSL_NO_SHAKE256
|
||||
#define NO_MD4
|
||||
#define NO_OLD_MD5_NAME
|
||||
#define NO_OLD_SHA_NAMES
|
||||
#define NO_OLD_SHA256_NAMES
|
||||
#define NO_OLD_WC_NAMES
|
||||
|
||||
#if 0
|
||||
#define DEBUG_WOLFSSL
|
||||
#define WOLFSSL_ANDROID_DEBUG
|
||||
#endif
|
||||
|
||||
#endif /* _WOLF_USER_SETTINGS_H_ */
|
||||
@@ -22,15 +22,13 @@ The `IDE/CRYPTOCELL/main.c` example application provides a function to run the s
|
||||
- SHA-256
|
||||
- AES CBC
|
||||
- CryptoCell 310 RNG
|
||||
- RSA sign/verify and RSA key gen (2048 bit in PKCSv1.5 padding mode)
|
||||
- RSA sign/verify and RSA key gen
|
||||
- RSA encrypt/decrypt
|
||||
- ECC sign/verify/shared secret
|
||||
- ECC key import/export and key gen pairs
|
||||
- Hardware RNG
|
||||
- RTC for benchmark timing source
|
||||
|
||||
Note: All Cryptocell features are not supported. The wolfcrypt RSA API allows import and export of Private/Public keys in DER format. However, this is not possible with key pairs generated with Cryptocell because the importing/exporting Cryptocell keys has not been implemented yet.
|
||||
|
||||
## Setup
|
||||
### Setting up Nordic SDK with wolfSSL
|
||||
1. Download the wolfSSL source code or a zip file from GitHub and place it under your SDK `InstallFolder/external/` directory. You can also copy or simlink to the source.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* main.c
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -18,8 +18,6 @@
|
||||
* 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>
|
||||
#include <wolfcrypt/test/test.h>
|
||||
#include <wolfcrypt/benchmark/benchmark.h>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* user_settings.h
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -41,7 +41,6 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(WOLFSSL_CRYPTOCELL)
|
||||
/* see SASI_AES_KEY_MAX_SIZE_IN_BYTES in the nRF5 SDK */
|
||||
#define AES_MAX_KEY_SIZE 128
|
||||
#endif /* WOLFSSL_CRYPTOCELL*/
|
||||
|
||||
@@ -138,9 +137,6 @@ extern "C" {
|
||||
#if 1
|
||||
#define HAVE_ECC
|
||||
|
||||
#include <strings.h>
|
||||
/* strings.h required for strncasecmp */
|
||||
|
||||
/* Manually define enabled curves */
|
||||
#undef ECC_USER_CURVES
|
||||
#define ECC_USER_CURVES
|
||||
@@ -558,6 +554,12 @@ extern "C" {
|
||||
#undef NO_OLD_TLS
|
||||
#define NO_OLD_TLS
|
||||
|
||||
#undef NO_HC128
|
||||
#define NO_HC128
|
||||
|
||||
#undef NO_RABBIT
|
||||
#define NO_RABBIT
|
||||
|
||||
#undef NO_PSK
|
||||
#define NO_PSK
|
||||
|
||||
|
||||
@@ -1,64 +1,71 @@
|
||||
|
||||
|
||||
# Deos Port
|
||||
|
||||
## Overview
|
||||
|
||||
You can enable the wolfSSL support for Deos RTOS available
|
||||
[here](https://www.ddci.com/products_deos_do_178c_arinc_653/) using
|
||||
the `#define WOLFSSL_DEOS`. Deos is a time & space partitioned,
|
||||
multi-core enabled, DO-178C DAL A certifiable RTOS.
|
||||
|
||||
You can enable the wolfSSL support for Deos RTOS available [here](https://www.ddci.com/products_deos_do_178c_arinc_653/) using the `#define WOLFSSL_DEOS`.
|
||||
Deos is a time & space partitioned, multi-core enabled, DO-178C DAL A certifiable RTOS.
|
||||
## Usage
|
||||
|
||||
You can start with your OpenArbor IDE-based example project for Deos
|
||||
with the network stack (lwip) to integrate wolfSSL source code.
|
||||
You can start with your OpenArbor IDE-based example project for Deos with the network stack (lwip) to integrate wolfSSL source code.
|
||||
|
||||
wolfSSL supports a compile-time user configurable options in the
|
||||
`IDE/ECLIPSE/DEOS/user_settings.h` file.
|
||||
wolfSSL supports a compile-time user configurable options in the `IDE/ECLIPSE/DEOS/user_settings.h` file.
|
||||
|
||||
### Importing the project
|
||||
The `tls_wolfssl.c` example application provides a simple function to run the selected examples at compile time through the following four #defines in user_settings.h. You can undefine any of these macro options to run a test.
|
||||
```
|
||||
1. #undef NO_CRYPT_TEST
|
||||
2. #undef NO_CRYPT_BENCHMARK
|
||||
3. #undef NO_WOLFSSL_CLIENT
|
||||
4. #undef NO_WOLFSSL_SERVER
|
||||
```
|
||||
Do one of the following steps for building and running wolfSSL with the Deos kernel examples, which are included in the DDS release:
|
||||
If you want to create a project from scratch, skip the Importing the project section and follow the steps in the other sections.
|
||||
|
||||
If you want to use an pre-configured example project, go to the Importing the project section, skip the other sections and follow the Building and Running section.
|
||||
|
||||
#### Importing the project
|
||||
In this section you will import a pre-configured example project.
|
||||
|
||||
Note: To work wolfssl directory must not be under the workspace directory.
|
||||
|
||||
1. Launch the OpenArbor IDE as an administrator
|
||||
2. In the Workspace Launcher dialog, in the Workspace field, enter
|
||||
your workspace
|
||||
2. In the Workspace Launcher dialog, in the Workspace field, enter your
|
||||
workspace
|
||||
3. Right-click in the Project Explorer view and select Import
|
||||
4. In the Import dialog, select General > Existing Projects into
|
||||
Workspace, then click Next.
|
||||
5. In the Import Projects dialog, select `Select root directory` and
|
||||
browse to `IDE/ECLIPSE/DEOS/deos_wolfssl` and select the wolfssl
|
||||
project
|
||||
4. In the Import dialog, select General > Existing Projects into Workspace, then click Next.
|
||||
5. In the Import Projects dialog, select Select archive file, then browse to `IDE/ECLIPSE/DEOS/` and double-click `deosWolfssl.zip` file
|
||||
6. In the Import Projects dialog, click Finish
|
||||
|
||||
#### Dependencies
|
||||
|
||||
* ansi
|
||||
* gnu-language
|
||||
* deos-time
|
||||
|
||||
### Setting up a Deos project with wolfSSL
|
||||
|
||||
The `tls_wolfssl.c` example application provides a simple function to
|
||||
run the selected examples at compile time through the following four
|
||||
`#defines` in `user_settings.h`. You can undefine any of these macro
|
||||
options to run a test.
|
||||
|
||||
#### Setting up a Deos project with wolfSSL
|
||||
1. Download the wolfSSL source code or a zip file from GitHub. You can remove all of the files except for these folders and its contents. The top folder for this example is wolfsslPort.
|
||||
```
|
||||
#undef NO_CRYPT_TEST
|
||||
#undef NO_CRYPT_BENCHMARK
|
||||
#undef NO_WOLFSSL_CLIENT
|
||||
#undef NO_WOLFSSL_SERVER
|
||||
wolfsslPort
|
||||
|-- IDE
|
||||
| -- ECLIPSE
|
||||
| -- DEOS
|
||||
|-- src
|
||||
|-- wolfcrypt
|
||||
| -- benchmark
|
||||
| -- src
|
||||
| -- test
|
||||
|-- wolfssl
|
||||
|-- openssl
|
||||
|-- wolfcrypt
|
||||
|-- port
|
||||
```
|
||||
2. Remove these two platform specific assembly source files:
|
||||
- wolfsslPort/wolfcrypt/src/aes_asm.asm
|
||||
- wolfsslPort/wolfcrypt/src/aes_asm.S
|
||||
|
||||
1. Launch the OpenArbor IDE
|
||||
3. Launch the OpenArbor IDE as an administrator
|
||||
4. Create a DDC-I Deos example project. In the main menu, go to File >DDC-I Deos example project > socket > udp-vs-tcp
|
||||
5. Import the `wolfSSLPort` source code into your project.
|
||||
- Right-click the ` udp-vs-tcp` project and choose File -> Import.
|
||||
- Expand the General folder and select File System, then click Next. You should now see the Import File system dialog.
|
||||
- Browse to the location containing the wolfSSL code and choose OK. Select the `wolfsslPort` folder and check the `Create top-level folder` button, then select Finish. You should see the folder hierarchy the same as wolfSSL folder structures.
|
||||
6. Review the configuration in $(PROJECT_DIR)/wolfsslPort/IDE/ECLIPSE/DEOS/user_setting.h
|
||||
|
||||
2. Create a DDC-I Deos example project. In the main menu, go to File >
|
||||
DDC-I Deos example project > socket > udp-vs-tcp
|
||||
|
||||
3. Customize your config/udp-vs-tcp.pd.xml with the following changes:
|
||||
7. Review the custom malloc/realloc/free configuration $(PROJECT_DIR)/wolfsslPort/IDE/ECLIPSE/DEOS/deos_malloc.c . Memory allocated with malloc() is never freed.
|
||||
|
||||
#### Configuring the Deos Project
|
||||
1. Customize your config/udp-vs-tcp.pd.xml with the following changes:
|
||||
```
|
||||
<processTemplate
|
||||
mutexQuota = "5"
|
||||
@@ -83,54 +90,35 @@ options to run a test.
|
||||
|
||||
</processTemplate>
|
||||
```
|
||||
Depending on your configuration, wolfSSL uses upto four mutexes. You also need to configure enough memory for the stack of each threads and the process logical memory pool.
|
||||
|
||||
Depending on your configuration, wolfSSL uses upto four mutexes. You
|
||||
also need to configure enough memory for the stack of each threads and
|
||||
the process logical memory pool.
|
||||
|
||||
4. Right click on the `udp-vs-tcp` project, select properties and add
|
||||
the following macros in the DDC-I Options > C Compile >
|
||||
Preprocessor
|
||||
|
||||
* WOLFSSL_USER_SETTINGS
|
||||
|
||||
5. Add the following directory paths in the DDC-I Options > C Compile >
|
||||
Directories and in the DDC-I Options > C++ Compile > Directories
|
||||
|
||||
* $(PROJECT_DIR.wolfssl)/../../../..
|
||||
* $(PROJECT_DIR.wolfssl)/..
|
||||
* $(PROJECT_DIR.printx)/code
|
||||
|
||||
6. Add the following library dependencies in the
|
||||
DDC-I Options > Deos > Dependencies
|
||||
|
||||
* math
|
||||
* ansi
|
||||
* deos-time
|
||||
|
||||
For benchmark and test code:
|
||||
|
||||
* printx - You must add printx into your workspace, File >DDC-I
|
||||
Deos example project > training > printx
|
||||
|
||||
7. Edit $(PROJECT_DIR)/wolfsslPort/IDE/ECLIPSE/DEOS/user_setting.h to
|
||||
customize your configuration. For example, you can undef or define
|
||||
these tests.
|
||||
|
||||
* `#undef NO_CRYPT_TEST`
|
||||
* `#undef NO_CRYPT_BENCHMARK`
|
||||
* `#undef NO_WOLFSSL_CLIENT`
|
||||
* `#undef NO_WOLFSSL_SERVER`
|
||||
|
||||
8. Edit your application source file where main() thread is defined
|
||||
and add the following:
|
||||
|
||||
* #include "printx.h"
|
||||
* #include "tls_wolfssl.h"
|
||||
* and a call to `wolfsslRunTests()`
|
||||
|
||||
2. Right click on the `udp-vs-tcp` project, select properties and add the following macros in the DDC-I Options > C Compile > Preprocessor
|
||||
- DEOS_ALLOW_OBSOLETE_DEFINITIONS
|
||||
- WOLFSSL_USER_SETTINGS
|
||||
3. Add the following directory paths in the DDC-I Options > C Compile > Directories and in the DDC-I Options > C++ Compile > Directories
|
||||
- $(PROJECT_DIR)/wolfsslPort
|
||||
- $(PROJECT_DIR)/wolfsslPort/wolfssl
|
||||
- $(PROJECT_DIR)/wolfsslPort/IDE/ECLIPSE/DEOS
|
||||
- $(PROJECT_DIR.printx)/code
|
||||
4. Change the optimization level in the DDC-I Options > C Compile > Code Generation > Optimization level:g
|
||||
- g
|
||||
5. Add the following library dependencies in the DDC-I Options > Deos > Dependencies
|
||||
- math
|
||||
- dart
|
||||
- ansi
|
||||
- printx
|
||||
- You must add printx into your workspace, File >DDC-I Deos example project > training > printx
|
||||
6. Edit $(PROJECT_DIR)/wolfsslPort/IDE/ECLIPSE/DEOS/user_setting.h to customize your configuration. For example, you can undef or define these tests.
|
||||
- #undef NO_CRYPT_TEST
|
||||
- #undef NO_CRYPT_BENCHMARK
|
||||
- #undef NO_WOLFSSL_CLIENT
|
||||
- #undef NO_WOLFSSL_SERVER
|
||||
7. Edit your application source file where main() thread is defined and add the following:
|
||||
- #include "printx.h"
|
||||
- #include "tls_wolfssl.h"
|
||||
- and a call to `wolfsslRunTests()`
|
||||
Here's an example:
|
||||
|
||||
```
|
||||
#include <deos.h>
|
||||
#include <printx.h>
|
||||
@@ -149,10 +137,7 @@ int main(void)
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
9. Review `$(PROJECT_DIR)/udp-vs-tcp/mailbox-transport.config`
|
||||
configuration.
|
||||
|
||||
8. Review $(PROJECT_DIR)/udp-vs-tcp/mailbox-transport.config configuration.
|
||||
```
|
||||
transportConfigurationId
|
||||
2 # Client thread quota - for client and server TCP
|
||||
@@ -181,62 +166,45 @@ userServiceThread # Server thread template name
|
||||
/
|
||||
```
|
||||
|
||||
#### Building and Running
|
||||
|
||||
1. Build your project, then load and run your image on a target
|
||||
platform. Review the test results on the console output.
|
||||
#### Building and Running
|
||||
1. Build your project, then load and run your image on a target platform. Review the test results on the console output.
|
||||
|
||||
|
||||
### `wolfcrypt_test()`
|
||||
|
||||
`wolfcrypt_test()` prints a message on similar to the following:
|
||||
|
||||
wolfcrypt_test() prints a message on the target console similar to the following output:
|
||||
```
|
||||
error test passed!
|
||||
base64 test passed!
|
||||
asn test passed!
|
||||
...
|
||||
```
|
||||
|
||||
This example doesn't show the whole output.
|
||||
|
||||
### `benchmark_test()`
|
||||
|
||||
`benchmark_test()` prints a message on the similar to the following:
|
||||
benchmark_test() prints a message on the target console similar to the following output.
|
||||
|
||||
```
|
||||
------------------------------------------------------------------------------
|
||||
wolfSSL version 4.6.0
|
||||
wolfSSL version 3.15.5
|
||||
------------------------------------------------------------------------------
|
||||
wolfCrypt Benchmark (block bytes 1024, min 1.0 sec each)
|
||||
RNG 2 MB took 1.000 seconds, 2.124 MB/s
|
||||
AES-128-CBC-enc 5 MB took 1.000 seconds, 5.127 MB/s
|
||||
AES-128-CBC-dec 5 MB took 1.000 seconds, 4.907 MB/s
|
||||
AES-192-CBC-enc 5 MB took 1.000 seconds, 4.736 MB/s
|
||||
AES-192-CBC-dec 5 MB took 1.000 seconds, 4.761 MB/s
|
||||
RNG 225 KB tooks 1.026 seconds, 219.313 KB/s
|
||||
AES-128-CBC-enc 250 KB toks 1.105 seconds 226.210 KB/s
|
||||
AES-128-CBC-dec 225 KB tooks 1.005 seconds, 223.922 KB/s
|
||||
...
|
||||
```
|
||||
|
||||
This example doesn't show the whole output.
|
||||
|
||||
### `wolfssl_client_test()`
|
||||
|
||||
You can modify the `TCP_SERVER_IP_ADDR` and `TCP_SERVER_PORT` macros
|
||||
in the `tls_wolfssl.c` file to configure the host address and
|
||||
port. You will also need to define the server certificate. The example
|
||||
client uses the GET request to get a web resource from the server at
|
||||
https://google.com.
|
||||
You can modify the `TCP_SERVER_IP_ADDR` and `TCP_SERVER_PORT` macros in the `tls_wolfssl.c` file to configure the host address and port. You will also need to define the server certificate. The example client uses the GET request to get a web resource from the server at https://google.com.
|
||||
|
||||
### `wolfssl_server_test()`
|
||||
|
||||
You can modify the `TLS_SERVER_PORT` in the `tls_wolfssl.c` file to
|
||||
configure the port number to listen on a local-host. Once you start
|
||||
the TLS server and `Listening for client connection` displays on the
|
||||
serial console, the server is ready to accept client connections.
|
||||
|
||||
You can connect to the server using the wolfssl TLS client example
|
||||
from your Linux or Windows host as follows:
|
||||
You can modify the `TLS_SERVER_PORT` in the `tls_wolfssl.c` file to configure the port number to listen on a local-host.
|
||||
Once you start the TLS server and `Listening for client connection` displays on the serial console, the server is ready to accept client connections.
|
||||
|
||||
You can connect to the server using the wolfssl TLS client example from your Linux or Windows host as follows:
|
||||
```
|
||||
$ ./examples/client/client.exe -h TLS_SERVER_IP_ADDRESS
|
||||
|
||||
@@ -250,10 +218,8 @@ I hear ya fa shizzle!
|
||||
|
||||
## References
|
||||
|
||||
The following software and tool chains were used for testing:
|
||||
|
||||
- OpenArbor 7.0.0
|
||||
The test results were collected from the qemu-x86 reference platform target with the following software and tool chains:
|
||||
- OpenArbor, eclipse based IDE, toolVersion = "3.31.0"
|
||||
- wolfssl [latest version](https://github.com/wolfSSL/wolfssl)
|
||||
|
||||
For more information or questions, please email
|
||||
[support@wolfssl.com](mailto:support@wolfssl.com)
|
||||
For more information or questions, please email [support@wolfssl.com](mailto:support@wolfssl.com)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* deos_malloc.c
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -19,11 +19,27 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
*/
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
#include <wolfssl/wolfcrypt/types.h>
|
||||
#include <deos.h>
|
||||
#include <wolfssl/ssl.h>
|
||||
|
||||
#define ROUND_UP(x, align) (((int) (x) + (align - 1)) & ~(align - 1))
|
||||
#define SIZEOF_HEADER sizeof(size_t) /* tracks size of allocated block */
|
||||
|
||||
#define HEAP_SIZE_MAX (1*1024*1024)
|
||||
|
||||
static size_t allocatedMemory = 0;
|
||||
|
||||
size_t getMemAllocatedSize_deos(size_t* size){
|
||||
|
||||
if (size)
|
||||
*size = allocatedMemory;
|
||||
|
||||
return allocatedMemory;
|
||||
}
|
||||
|
||||
/* Simply returns without freeing any memory. */
|
||||
|
||||
void free_deos(void *ptr) {
|
||||
free(ptr);
|
||||
//printf("fake free_deos()\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -35,6 +51,10 @@ void *realloc_deos(void *ptr, size_t size) {
|
||||
newptr = malloc_deos(size);
|
||||
|
||||
if (ptr != NULL && newptr != NULL) {
|
||||
|
||||
if ( *((char *)ptr - SIZEOF_HEADER) < *((char *)newptr - SIZEOF_HEADER))
|
||||
size = *((char *)ptr - SIZEOF_HEADER);
|
||||
|
||||
XMEMCPY((char *) newptr, (const char *) ptr, size);
|
||||
free_deos(ptr);
|
||||
}
|
||||
@@ -43,5 +63,46 @@ void *realloc_deos(void *ptr, size_t size) {
|
||||
}
|
||||
|
||||
void *malloc_deos(size_t size) {
|
||||
return malloc(size);
|
||||
PDEOS_SYSTEM_INFO systemInfoPtr;
|
||||
static VirtualAddressTYP heapAddr = NULL;
|
||||
static VirtualAddressTYP freeAddr = NULL;
|
||||
VirtualAddressTYP retAddr = NULL;
|
||||
DWORD allocationSize = 0;
|
||||
static int initialized = 0;
|
||||
|
||||
if (size <= 0)
|
||||
return NULL;
|
||||
|
||||
if (!initialized) {
|
||||
systemInfoPtr = (PDEOS_SYSTEM_INFO)getSystemInfoDEOS();
|
||||
freeAddr = (VirtualAddressTYP)getNextLibraryStartAddress();
|
||||
allocationSize = (((HEAP_SIZE_MAX - 1) / systemInfoPtr->dwPageSize) + 1) *
|
||||
systemInfoPtr->dwPageSize;
|
||||
|
||||
if (virtualAllocDEOS(freeAddr, allocationSize) != allocSuccess){
|
||||
printf("ERROR: virtualAllocDEOS failed\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
setNextLibraryStartAddress(freeAddr + allocationSize);
|
||||
heapAddr = freeAddr;
|
||||
|
||||
initialized = 1;
|
||||
}
|
||||
|
||||
size = ROUND_UP(size, sizeof(size_t));
|
||||
|
||||
if ((size + SIZEOF_HEADER) > (HEAP_SIZE_MAX - (freeAddr - heapAddr))){
|
||||
printf("ERROR: malloc_deos cannot allocate from heap memory anymore\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
*freeAddr = size;
|
||||
freeAddr += SIZEOF_HEADER;
|
||||
retAddr = freeAddr;
|
||||
XMEMSET(retAddr, 0, size);
|
||||
freeAddr += size;
|
||||
allocatedMemory += size;
|
||||
|
||||
return retAddr;
|
||||
}
|
||||
|
||||
@@ -1,344 +0,0 @@
|
||||
<?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="org.eclipse.cdt.core.default.config.472844465">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.core.defaultConfigDataProvider" id="org.eclipse.cdt.core.default.config.472844465" moduleId="org.eclipse.cdt.core.settings" name="Configuration">
|
||||
<externalSettings/>
|
||||
<extensions/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.pathentry">
|
||||
<pathentry base-path="C:/DDC-I/desk/ppc/include" include="./" kind="inc" path="" system="true"/>
|
||||
<pathentry base-path="C:/DDC-I/desk/include" include="./" kind="inc" path="" system="true"/>
|
||||
<pathentry base-path="C:/" include="./" kind="inc" path="" system="true"/>
|
||||
<pathentry kind="mac" name="DIAGNOSTIC" path="" value=""/>
|
||||
<pathentry kind="mac" name="WOLFSSL_USER_SETTINGS" path="" value=""/>
|
||||
<pathentry kind="mac" name="__OpenArbor_editor" path="" value=""/>
|
||||
<pathentry kind="mac" name="__DBL_MIN_EXP__" path="" value="(-1021)"/>
|
||||
<pathentry kind="mac" name="__FLT32X_MAX_EXP__" path="" value="1024"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xvmsubmsp" path="" value="__builtin_vsx_xvmsubsp"/>
|
||||
<pathentry kind="mac" name="__UINT_LEAST16_MAX__" path="" value="0xffff"/>
|
||||
<pathentry kind="mac" name="__ATOMIC_ACQUIRE" path="" value="2"/>
|
||||
<pathentry kind="mac" name="__FLT_MIN__" path="" value="1.1754943508222875e-38F"/>
|
||||
<pathentry kind="mac" name="__GCC_IEC_559_COMPLEX" path="" value="2"/>
|
||||
<pathentry kind="mac" name="__UINT_LEAST8_TYPE__" path="" value="unsigned char"/>
|
||||
<pathentry kind="mac" name="__INTMAX_C(c)" path="" value="c ## LL"/>
|
||||
<pathentry kind="mac" name="__CHAR_BIT__" path="" value="8"/>
|
||||
<pathentry kind="mac" name="__UINT8_MAX__" path="" value="0xff"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xvnmaddadp" path="" value="__builtin_vsx_xvnmadddp"/>
|
||||
<pathentry kind="mac" name="__WINT_MAX__" path="" value="0xffffffffU"/>
|
||||
<pathentry kind="mac" name="__FLT32_MIN_EXP__" path="" value="(-125)"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xxlnor" path="" value="__builtin_vec_nor"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xvnmsubmdp" path="" value="__builtin_vsx_xvnmsubdp"/>
|
||||
<pathentry kind="mac" name="__ORDER_LITTLE_ENDIAN__" path="" value="1234"/>
|
||||
<pathentry kind="mac" name="__SIZE_MAX__" path="" value="0xffffffffU"/>
|
||||
<pathentry kind="mac" name="__WCHAR_MAX__" path="" value="0x7fffffffL"/>
|
||||
<pathentry kind="mac" name="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__DBL_DENORM_MIN__" path="" value="((double)4.9406564584124654e-324L)"/>
|
||||
<pathentry kind="mac" name="__GCC_ATOMIC_CHAR_LOCK_FREE" path="" value="2"/>
|
||||
<pathentry kind="mac" name="__GCC_IEC_559" path="" value="2"/>
|
||||
<pathentry kind="mac" name="__FLT32X_DECIMAL_DIG__" path="" value="17"/>
|
||||
<pathentry kind="mac" name="__FLT_EVAL_METHOD__" path="" value="0"/>
|
||||
<pathentry kind="mac" name="__unix__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__FLT64_DECIMAL_DIG__" path="" value="17"/>
|
||||
<pathentry kind="mac" name="__GCC_ATOMIC_CHAR32_T_LOCK_FREE" path="" value="2"/>
|
||||
<pathentry kind="mac" name="pixel" path="" value="pixel"/>
|
||||
<pathentry kind="mac" name="bool" path="" value="bool"/>
|
||||
<pathentry kind="mac" name="__UINT_FAST64_MAX__" path="" value="0xffffffffffffffffULL"/>
|
||||
<pathentry kind="mac" name="__SIG_ATOMIC_TYPE__" path="" value="int"/>
|
||||
<pathentry kind="mac" name="__DBL_MIN_10_EXP__" path="" value="(-307)"/>
|
||||
<pathentry kind="mac" name="__FINITE_MATH_ONLY__" path="" value="0"/>
|
||||
<pathentry kind="mac" name="__GNUC_PATCHLEVEL__" path="" value="0"/>
|
||||
<pathentry kind="mac" name="__FLT32_HAS_DENORM__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xvnmaddasp" path="" value="__builtin_vsx_xvnmaddsp"/>
|
||||
<pathentry kind="mac" name="__UINT_FAST8_MAX__" path="" value="0xffffffffU"/>
|
||||
<pathentry kind="mac" name="__has_include(STR)" path="" value="__has_include__(STR)"/>
|
||||
<pathentry kind="mac" name="__DEC64_MAX_EXP__" path="" value="385"/>
|
||||
<pathentry kind="mac" name="__INT8_C(c)" path="" value="c"/>
|
||||
<pathentry kind="mac" name="__INT_LEAST8_WIDTH__" path="" value="8"/>
|
||||
<pathentry kind="mac" name="__UINT_LEAST64_MAX__" path="" value="0xffffffffffffffffULL"/>
|
||||
<pathentry kind="mac" name="__SHRT_MAX__" path="" value="0x7fff"/>
|
||||
<pathentry kind="mac" name="__LDBL_MAX__" path="" value="1.7976931348623157e+308L"/>
|
||||
<pathentry kind="mac" name="__UINT_LEAST8_MAX__" path="" value="0xff"/>
|
||||
<pathentry kind="mac" name="__GCC_ATOMIC_BOOL_LOCK_FREE" path="" value="2"/>
|
||||
<pathentry kind="mac" name="_ARCH_PPC" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__UINTMAX_TYPE__" path="" value="long long unsigned int"/>
|
||||
<pathentry kind="mac" name="__DEC32_EPSILON__" path="" value="1E-6DF"/>
|
||||
<pathentry kind="mac" name="__FLT_EVAL_METHOD_TS_18661_3__" path="" value="0"/>
|
||||
<pathentry kind="mac" name="__CHAR_UNSIGNED__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__UINT32_MAX__" path="" value="0xffffffffUL"/>
|
||||
<pathentry kind="mac" name="__LDBL_MAX_EXP__" path="" value="1024"/>
|
||||
<pathentry kind="mac" name="__WINT_MIN__" path="" value="0U"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xvmaddmdp" path="" value="__builtin_vsx_xvmadddp"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_vperm" path="" value="__builtin_vec_perm"/>
|
||||
<pathentry kind="mac" name="__INT_LEAST16_WIDTH__" path="" value="16"/>
|
||||
<pathentry kind="mac" name="__SCHAR_MAX__" path="" value="0x7f"/>
|
||||
<pathentry kind="mac" name="__WCHAR_MIN__" path="" value="(-__WCHAR_MAX__ - 1)"/>
|
||||
<pathentry kind="mac" name="vector" path="" value="vector"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xvnmsubmsp" path="" value="__builtin_vsx_xvnmsubsp"/>
|
||||
<pathentry kind="mac" name="__INT64_C(c)" path="" value="c ## LL"/>
|
||||
<pathentry kind="mac" name="__DBL_DIG__" path="" value="15"/>
|
||||
<pathentry kind="mac" name="__GCC_ATOMIC_POINTER_LOCK_FREE" path="" value="2"/>
|
||||
<pathentry kind="mac" name="__SIZEOF_INT__" path="" value="4"/>
|
||||
<pathentry kind="mac" name="__SIZEOF_POINTER__" path="" value="4"/>
|
||||
<pathentry kind="mac" name="__USER_LABEL_PREFIX__" path="" value=""/>
|
||||
<pathentry kind="mac" name="__STDC_HOSTED__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__LDBL_HAS_INFINITY__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xvmaddmsp" path="" value="__builtin_vsx_xvmaddsp"/>
|
||||
<pathentry kind="mac" name="__FLT32_DIG__" path="" value="6"/>
|
||||
<pathentry kind="mac" name="__FLT_EPSILON__" path="" value="1.1920928955078125e-7F"/>
|
||||
<pathentry kind="mac" name="__SHRT_WIDTH__" path="" value="16"/>
|
||||
<pathentry kind="mac" name="_CALL_SYSV" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__LDBL_MIN__" path="" value="2.2250738585072014e-308L"/>
|
||||
<pathentry kind="mac" name="__STDC_UTF_16__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__DEC32_MAX__" path="" value="9.999999E96DF"/>
|
||||
<pathentry kind="mac" name="__FLT32X_HAS_INFINITY__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__INT32_MAX__" path="" value="0x7fffffffL"/>
|
||||
<pathentry kind="mac" name="__INT_WIDTH__" path="" value="32"/>
|
||||
<pathentry kind="mac" name="__SIZEOF_LONG__" path="" value="4"/>
|
||||
<pathentry kind="mac" name="__UINT16_C(c)" path="" value="c"/>
|
||||
<pathentry kind="mac" name="__PTRDIFF_WIDTH__" path="" value="32"/>
|
||||
<pathentry kind="mac" name="__DECIMAL_DIG__" path="" value="17"/>
|
||||
<pathentry kind="mac" name="__FLT64_EPSILON__" path="" value="2.2204460492503131e-16F64"/>
|
||||
<pathentry kind="mac" name="__INTMAX_WIDTH__" path="" value="64"/>
|
||||
<pathentry kind="mac" name="__has_include_next(STR)" path="" value="__has_include_next__(STR)"/>
|
||||
<pathentry kind="mac" name="__LDBL_HAS_QUIET_NAN__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__FLT64_MANT_DIG__" path="" value="53"/>
|
||||
<pathentry kind="mac" name="__GNUC__" path="" value="7"/>
|
||||
<pathentry kind="mac" name="__FLT_HAS_DENORM__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__SIZEOF_LONG_DOUBLE__" path="" value="8"/>
|
||||
<pathentry kind="mac" name="__BIGGEST_ALIGNMENT__" path="" value="16"/>
|
||||
<pathentry kind="mac" name="__FLT64_MAX_10_EXP__" path="" value="308"/>
|
||||
<pathentry kind="mac" name="__DBL_MAX__" path="" value="((double)1.7976931348623157e+308L)"/>
|
||||
<pathentry kind="mac" name="__INT_FAST32_MAX__" path="" value="0x7fffffff"/>
|
||||
<pathentry kind="mac" name="__DBL_HAS_INFINITY__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xvnmaddmdp" path="" value="__builtin_vsx_xvnmadddp"/>
|
||||
<pathentry kind="mac" name="__DEC32_MIN_EXP__" path="" value="(-94)"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xxlandc" path="" value="__builtin_vec_andc"/>
|
||||
<pathentry kind="mac" name="__INTPTR_WIDTH__" path="" value="32"/>
|
||||
<pathentry kind="mac" name="__FLT32X_HAS_DENORM__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__INT_FAST16_TYPE__" path="" value="int"/>
|
||||
<pathentry kind="mac" name="__LDBL_HAS_DENORM__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__DEC128_MAX__" path="" value="9.999999999999999999999999999999999E6144DL"/>
|
||||
<pathentry kind="mac" name="__INT_LEAST32_MAX__" path="" value="0x7fffffffL"/>
|
||||
<pathentry kind="mac" name="__DEC32_MIN__" path="" value="1E-95DF"/>
|
||||
<pathentry kind="mac" name="__DBL_MAX_EXP__" path="" value="1024"/>
|
||||
<pathentry kind="mac" name="__WCHAR_WIDTH__" path="" value="32"/>
|
||||
<pathentry kind="mac" name="__FLT32_MAX__" path="" value="3.4028234663852886e+38F32"/>
|
||||
<pathentry kind="mac" name="__DEC128_EPSILON__" path="" value="1E-33DL"/>
|
||||
<pathentry kind="mac" name="__PTRDIFF_MAX__" path="" value="0x7fffffff"/>
|
||||
<pathentry kind="mac" name="__FLT32_HAS_QUIET_NAN__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__LONG_LONG_MAX__" path="" value="0x7fffffffffffffffLL"/>
|
||||
<pathentry kind="mac" name="__SIZEOF_SIZE_T__" path="" value="4"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xvnmaddmsp" path="" value="__builtin_vsx_xvnmaddsp"/>
|
||||
<pathentry kind="mac" name="__PPC__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__SIZEOF_WINT_T__" path="" value="4"/>
|
||||
<pathentry kind="mac" name="__LONG_LONG_WIDTH__" path="" value="64"/>
|
||||
<pathentry kind="mac" name="__FLT32_MAX_EXP__" path="" value="128"/>
|
||||
<pathentry kind="mac" name="__GXX_ABI_VERSION" path="" value="1011"/>
|
||||
<pathentry kind="mac" name="__FLT_MIN_EXP__" path="" value="(-125)"/>
|
||||
<pathentry kind="mac" name="__INT_FAST64_TYPE__" path="" value="long long int"/>
|
||||
<pathentry kind="mac" name="__FP_FAST_FMAF" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__FP_FAST_FMAL" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__FLT64_DENORM_MIN__" path="" value="4.9406564584124654e-324F64"/>
|
||||
<pathentry kind="mac" name="__DBL_MIN__" path="" value="((double)2.2250738585072014e-308L)"/>
|
||||
<pathentry kind="mac" name="__FLT32X_EPSILON__" path="" value="2.2204460492503131e-16F32x"/>
|
||||
<pathentry kind="mac" name="__FLT64_MIN_EXP__" path="" value="(-1021)"/>
|
||||
<pathentry kind="mac" name="__FLT64_MIN_10_EXP__" path="" value="(-307)"/>
|
||||
<pathentry kind="mac" name="__DEC128_MIN__" path="" value="1E-6143DL"/>
|
||||
<pathentry kind="mac" name="__REGISTER_PREFIX__" path="" value=""/>
|
||||
<pathentry kind="mac" name="__UINT16_MAX__" path="" value="0xffff"/>
|
||||
<pathentry kind="mac" name="__DBL_HAS_DENORM__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xxland" path="" value="__builtin_vec_and"/>
|
||||
<pathentry kind="mac" name="__FLT32_MIN__" path="" value="1.1754943508222875e-38F32"/>
|
||||
<pathentry kind="mac" name="__UINT8_TYPE__" path="" value="unsigned char"/>
|
||||
<pathentry kind="mac" name="__NO_INLINE__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__FLT_MANT_DIG__" path="" value="24"/>
|
||||
<pathentry kind="mac" name="__LDBL_DECIMAL_DIG__" path="" value="17"/>
|
||||
<pathentry kind="mac" name="__VERSION__" path="" value=""7.3.0""/>
|
||||
<pathentry kind="mac" name="__UINT64_C(c)" path="" value="c ## ULL"/>
|
||||
<pathentry kind="mac" name="__BIG_ENDIAN__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__GCC_ATOMIC_INT_LOCK_FREE" path="" value="2"/>
|
||||
<pathentry kind="mac" name="__pixel" path="" value="__attribute__((altivec(pixel__))) unsigned short"/>
|
||||
<pathentry kind="mac" name="__FLT32_MANT_DIG__" path="" value="24"/>
|
||||
<pathentry kind="mac" name="__FLOAT_WORD_ORDER__" path="" value="__ORDER_BIG_ENDIAN__"/>
|
||||
<pathentry kind="mac" name="__SCHAR_WIDTH__" path="" value="8"/>
|
||||
<pathentry kind="mac" name="__INT32_C(c)" path="" value="c ## L"/>
|
||||
<pathentry kind="mac" name="__DEC64_EPSILON__" path="" value="1E-15DD"/>
|
||||
<pathentry kind="mac" name="__ORDER_PDP_ENDIAN__" path="" value="3412"/>
|
||||
<pathentry kind="mac" name="__DEC128_MIN_EXP__" path="" value="(-6142)"/>
|
||||
<pathentry kind="mac" name="__FLT32_MAX_10_EXP__" path="" value="38"/>
|
||||
<pathentry kind="mac" name="__INT_FAST32_TYPE__" path="" value="int"/>
|
||||
<pathentry kind="mac" name="__UINT_LEAST16_TYPE__" path="" value="short unsigned int"/>
|
||||
<pathentry kind="mac" name="unix" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__INT16_MAX__" path="" value="0x7fff"/>
|
||||
<pathentry kind="mac" name="__SIZE_TYPE__" path="" value="unsigned int"/>
|
||||
<pathentry kind="mac" name="__UINT64_MAX__" path="" value="0xffffffffffffffffULL"/>
|
||||
<pathentry kind="mac" name="__INT8_TYPE__" path="" value="signed char"/>
|
||||
<pathentry kind="mac" name="__ELF__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__HAVE_BSWAP__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__FLT_RADIX__" path="" value="2"/>
|
||||
<pathentry kind="mac" name="__INT_LEAST16_TYPE__" path="" value="short int"/>
|
||||
<pathentry kind="mac" name="__LDBL_EPSILON__" path="" value="2.2204460492503131e-16L"/>
|
||||
<pathentry kind="mac" name="__UINTMAX_C(c)" path="" value="c ## ULL"/>
|
||||
<pathentry kind="mac" name="__SIG_ATOMIC_MAX__" path="" value="0x7fffffff"/>
|
||||
<pathentry kind="mac" name="__GCC_ATOMIC_WCHAR_T_LOCK_FREE" path="" value="2"/>
|
||||
<pathentry kind="mac" name="__SIZEOF_PTRDIFF_T__" path="" value="4"/>
|
||||
<pathentry kind="mac" name="__FLT32X_MANT_DIG__" path="" value="53"/>
|
||||
<pathentry kind="mac" name="__FLT32X_MIN_EXP__" path="" value="(-1021)"/>
|
||||
<pathentry kind="mac" name="__DEC32_SUBNORMAL_MIN__" path="" value="0.000001E-95DF"/>
|
||||
<pathentry kind="mac" name="__INT_FAST16_MAX__" path="" value="0x7fffffff"/>
|
||||
<pathentry kind="mac" name="__vector" path="" value="__attribute__((altivec(vector__)))"/>
|
||||
<pathentry kind="mac" name="__FLT64_DIG__" path="" value="15"/>
|
||||
<pathentry kind="mac" name="__UINT_FAST32_MAX__" path="" value="0xffffffffU"/>
|
||||
<pathentry kind="mac" name="__UINT_LEAST64_TYPE__" path="" value="long long unsigned int"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xvmsubadp" path="" value="__builtin_vsx_xvmsubdp"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xxsel" path="" value="__builtin_vec_sel"/>
|
||||
<pathentry kind="mac" name="__FLT_HAS_QUIET_NAN__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__bool" path="" value="__attribute__((altivec(bool__))) unsigned"/>
|
||||
<pathentry kind="mac" name="__FLT_MAX_10_EXP__" path="" value="38"/>
|
||||
<pathentry kind="mac" name="__LONG_MAX__" path="" value="0x7fffffffL"/>
|
||||
<pathentry kind="mac" name="__DEC128_SUBNORMAL_MIN__" path="" value="0.000000000000000000000000000000001E-6143DL"/>
|
||||
<pathentry kind="mac" name="__FLT_HAS_INFINITY__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__unix" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__UINT_FAST16_TYPE__" path="" value="unsigned int"/>
|
||||
<pathentry kind="mac" name="__DEC64_MAX__" path="" value="9.999999999999999E384DD"/>
|
||||
<pathentry kind="mac" name="__INT_FAST32_WIDTH__" path="" value="32"/>
|
||||
<pathentry kind="mac" name="__CHAR16_TYPE__" path="" value="short unsigned int"/>
|
||||
<pathentry kind="mac" name="__PRAGMA_REDEFINE_EXTNAME" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__SIZE_WIDTH__" path="" value="32"/>
|
||||
<pathentry kind="mac" name="__INT_LEAST16_MAX__" path="" value="0x7fff"/>
|
||||
<pathentry kind="mac" name="__DEC64_MANT_DIG__" path="" value="16"/>
|
||||
<pathentry kind="mac" name="__INT64_MAX__" path="" value="0x7fffffffffffffffLL"/>
|
||||
<pathentry kind="mac" name="__UINT_LEAST32_MAX__" path="" value="0xffffffffUL"/>
|
||||
<pathentry kind="mac" name="__FLT32_DENORM_MIN__" path="" value="1.4012984643248171e-45F32"/>
|
||||
<pathentry kind="mac" name="__GCC_ATOMIC_LONG_LOCK_FREE" path="" value="2"/>
|
||||
<pathentry kind="mac" name="__SIG_ATOMIC_WIDTH__" path="" value="32"/>
|
||||
<pathentry kind="mac" name="__INT_LEAST64_TYPE__" path="" value="long long int"/>
|
||||
<pathentry kind="mac" name="__INT16_TYPE__" path="" value="short int"/>
|
||||
<pathentry kind="mac" name="__INT_LEAST8_TYPE__" path="" value="signed char"/>
|
||||
<pathentry kind="mac" name="__STDC_VERSION__" path="" value="201112L"/>
|
||||
<pathentry kind="mac" name="__DEC32_MAX_EXP__" path="" value="97"/>
|
||||
<pathentry kind="mac" name="_BIG_ENDIAN" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__INT_FAST8_MAX__" path="" value="0x7fffffff"/>
|
||||
<pathentry kind="mac" name="__INTPTR_MAX__" path="" value="0x7fffffff"/>
|
||||
<pathentry kind="mac" name="__FLT64_HAS_QUIET_NAN__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__PPC" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__FLT32_MIN_10_EXP__" path="" value="(-37)"/>
|
||||
<pathentry kind="mac" name="__FLT32X_DIG__" path="" value="15"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xvmsubasp" path="" value="__builtin_vsx_xvmsubsp"/>
|
||||
<pathentry kind="mac" name="__LDBL_MANT_DIG__" path="" value="53"/>
|
||||
<pathentry kind="mac" name="__svr4__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__DBL_HAS_QUIET_NAN__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__FLT64_HAS_INFINITY__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__SIG_ATOMIC_MIN__" path="" value="(-__SIG_ATOMIC_MAX__ - 1)"/>
|
||||
<pathentry kind="mac" name="__INTPTR_TYPE__" path="" value="int"/>
|
||||
<pathentry kind="mac" name="__UINT16_TYPE__" path="" value="short unsigned int"/>
|
||||
<pathentry kind="mac" name="__WCHAR_TYPE__" path="" value="long int"/>
|
||||
<pathentry kind="mac" name="__SIZEOF_FLOAT__" path="" value="4"/>
|
||||
<pathentry kind="mac" name="__UINTPTR_MAX__" path="" value="0xffffffffU"/>
|
||||
<pathentry kind="mac" name="__INT_FAST64_WIDTH__" path="" value="64"/>
|
||||
<pathentry kind="mac" name="__DEC64_MIN_EXP__" path="" value="(-382)"/>
|
||||
<pathentry kind="mac" name="__FLT32_DECIMAL_DIG__" path="" value="9"/>
|
||||
<pathentry kind="mac" name="__INT_FAST64_MAX__" path="" value="0x7fffffffffffffffLL"/>
|
||||
<pathentry kind="mac" name="__GCC_ATOMIC_TEST_AND_SET_TRUEVAL" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__FLT_DIG__" path="" value="6"/>
|
||||
<pathentry kind="mac" name="__FLT32_HAS_INFINITY__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__UINT_FAST64_TYPE__" path="" value="long long unsigned int"/>
|
||||
<pathentry kind="mac" name="__INT_MAX__" path="" value="0x7fffffff"/>
|
||||
<pathentry kind="mac" name="__INT64_TYPE__" path="" value="long long int"/>
|
||||
<pathentry kind="mac" name="__FLT_MAX_EXP__" path="" value="128"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xxlor" path="" value="__builtin_vec_or"/>
|
||||
<pathentry kind="mac" name="__DBL_MANT_DIG__" path="" value="53"/>
|
||||
<pathentry kind="mac" name="__INT_LEAST64_MAX__" path="" value="0x7fffffffffffffffLL"/>
|
||||
<pathentry kind="mac" name="__GCC_ATOMIC_CHAR16_T_LOCK_FREE" path="" value="2"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xxlxor" path="" value="__builtin_vec_xor"/>
|
||||
<pathentry kind="mac" name="__DEC64_MIN__" path="" value="1E-383DD"/>
|
||||
<pathentry kind="mac" name="__WINT_TYPE__" path="" value="unsigned int"/>
|
||||
<pathentry kind="mac" name="__UINT_LEAST32_TYPE__" path="" value="long unsigned int"/>
|
||||
<pathentry kind="mac" name="__SIZEOF_SHORT__" path="" value="2"/>
|
||||
<pathentry kind="mac" name="__LDBL_MIN_EXP__" path="" value="(-1021)"/>
|
||||
<pathentry kind="mac" name="__FLT64_MAX__" path="" value="1.7976931348623157e+308F64"/>
|
||||
<pathentry kind="mac" name="__WINT_WIDTH__" path="" value="32"/>
|
||||
<pathentry kind="mac" name="__INT_LEAST8_MAX__" path="" value="0x7f"/>
|
||||
<pathentry kind="mac" name="__FLT32X_MAX_10_EXP__" path="" value="308"/>
|
||||
<pathentry kind="mac" name="__LDBL_MAX_10_EXP__" path="" value="308"/>
|
||||
<pathentry kind="mac" name="__ATOMIC_RELAXED" path="" value="0"/>
|
||||
<pathentry kind="mac" name="__DBL_EPSILON__" path="" value="((double)2.2204460492503131e-16L)"/>
|
||||
<pathentry kind="mac" name="__UINT8_C(c)" path="" value="c"/>
|
||||
<pathentry kind="mac" name="PPC" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__FLT64_MAX_EXP__" path="" value="1024"/>
|
||||
<pathentry kind="mac" name="__INT_LEAST32_TYPE__" path="" value="long int"/>
|
||||
<pathentry kind="mac" name="__SIZEOF_WCHAR_T__" path="" value="4"/>
|
||||
<pathentry kind="mac" name="__UINT64_TYPE__" path="" value="long long unsigned int"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xvnmsubadp" path="" value="__builtin_vsx_xvnmsubdp"/>
|
||||
<pathentry kind="mac" name="__INT_FAST8_TYPE__" path="" value="int"/>
|
||||
<pathentry kind="mac" name="__GNUC_STDC_INLINE__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__FLT64_HAS_DENORM__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__FLT32_EPSILON__" path="" value="1.1920928955078125e-7F32"/>
|
||||
<pathentry kind="mac" name="__DBL_DECIMAL_DIG__" path="" value="17"/>
|
||||
<pathentry kind="mac" name="__STDC_UTF_32__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__INT_FAST8_WIDTH__" path="" value="32"/>
|
||||
<pathentry kind="mac" name="__DEC_EVAL_METHOD__" path="" value="2"/>
|
||||
<pathentry kind="mac" name="__FLT32X_MAX__" path="" value="1.7976931348623157e+308F32x"/>
|
||||
<pathentry kind="mac" name="__VEC_ELEMENT_REG_ORDER__" path="" value="__ORDER_BIG_ENDIAN__"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xvmaddadp" path="" value="__builtin_vsx_xvmadddp"/>
|
||||
<pathentry kind="mac" name="__ORDER_BIG_ENDIAN__" path="" value="4321"/>
|
||||
<pathentry kind="mac" name="__UINT32_C(c)" path="" value="c ## UL"/>
|
||||
<pathentry kind="mac" name="__INTMAX_MAX__" path="" value="0x7fffffffffffffffLL"/>
|
||||
<pathentry kind="mac" name="__BYTE_ORDER__" path="" value="__ORDER_BIG_ENDIAN__"/>
|
||||
<pathentry kind="mac" name="__FLT_DENORM_MIN__" path="" value="1.4012984643248171e-45F"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xvnmsubasp" path="" value="__builtin_vsx_xvnmsubsp"/>
|
||||
<pathentry kind="mac" name="__INT8_MAX__" path="" value="0x7f"/>
|
||||
<pathentry kind="mac" name="__LONG_WIDTH__" path="" value="32"/>
|
||||
<pathentry kind="mac" name="__UINT_FAST32_TYPE__" path="" value="unsigned int"/>
|
||||
<pathentry kind="mac" name="__CHAR32_TYPE__" path="" value="long unsigned int"/>
|
||||
<pathentry kind="mac" name="__FLT_MAX__" path="" value="3.4028234663852886e+38F"/>
|
||||
<pathentry kind="mac" name="__FP_FAST_FMA" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__INT32_TYPE__" path="" value="long int"/>
|
||||
<pathentry kind="mac" name="__SIZEOF_DOUBLE__" path="" value="8"/>
|
||||
<pathentry kind="mac" name="__FLT_MIN_10_EXP__" path="" value="(-37)"/>
|
||||
<pathentry kind="mac" name="__FLT64_MIN__" path="" value="2.2250738585072014e-308F64"/>
|
||||
<pathentry kind="mac" name="__INT_LEAST32_WIDTH__" path="" value="32"/>
|
||||
<pathentry kind="mac" name="__INTMAX_TYPE__" path="" value="long long int"/>
|
||||
<pathentry kind="mac" name="__DEC128_MAX_EXP__" path="" value="6145"/>
|
||||
<pathentry kind="mac" name="__FLT32X_HAS_QUIET_NAN__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__ATOMIC_CONSUME" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__GNUC_MINOR__" path="" value="3"/>
|
||||
<pathentry kind="mac" name="__INT_FAST16_WIDTH__" path="" value="32"/>
|
||||
<pathentry kind="mac" name="__UINTMAX_MAX__" path="" value="0xffffffffffffffffULL"/>
|
||||
<pathentry kind="mac" name="__DEC32_MANT_DIG__" path="" value="7"/>
|
||||
<pathentry kind="mac" name="__FLT32X_DENORM_MIN__" path="" value="4.9406564584124654e-324F32x"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xvmaddasp" path="" value="__builtin_vsx_xvmaddsp"/>
|
||||
<pathentry kind="mac" name="__DBL_MAX_10_EXP__" path="" value="308"/>
|
||||
<pathentry kind="mac" name="__LDBL_DENORM_MIN__" path="" value="4.9406564584124654e-324L"/>
|
||||
<pathentry kind="mac" name="__INT16_C(c)" path="" value="c"/>
|
||||
<pathentry kind="mac" name="__STDC__" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__builtin_vsx_xvmsubmdp" path="" value="__builtin_vsx_xvmsubdp"/>
|
||||
<pathentry kind="mac" name="__PTRDIFF_TYPE__" path="" value="int"/>
|
||||
<pathentry kind="mac" name="__ATOMIC_SEQ_CST" path="" value="5"/>
|
||||
<pathentry kind="mac" name="__UINT32_TYPE__" path="" value="long unsigned int"/>
|
||||
<pathentry kind="mac" name="__FLT32X_MIN_10_EXP__" path="" value="(-307)"/>
|
||||
<pathentry kind="mac" name="__UINTPTR_TYPE__" path="" value="unsigned int"/>
|
||||
<pathentry kind="mac" name="__DEC64_SUBNORMAL_MIN__" path="" value="0.000000000000001E-383DD"/>
|
||||
<pathentry kind="mac" name="__DEC128_MANT_DIG__" path="" value="34"/>
|
||||
<pathentry kind="mac" name="__LDBL_MIN_10_EXP__" path="" value="(-307)"/>
|
||||
<pathentry kind="mac" name="__SIZEOF_LONG_LONG__" path="" value="8"/>
|
||||
<pathentry kind="mac" name="_Bool" path="" value="_Bool"/>
|
||||
<pathentry kind="mac" name="__GCC_ATOMIC_LLONG_LOCK_FREE" path="" value="1"/>
|
||||
<pathentry kind="mac" name="__FLT32X_MIN__" path="" value="2.2250738585072014e-308F32x"/>
|
||||
<pathentry kind="mac" name="__LDBL_DIG__" path="" value="15"/>
|
||||
<pathentry kind="mac" name="__FLT_DECIMAL_DIG__" path="" value="9"/>
|
||||
<pathentry kind="mac" name="__UINT_FAST16_MAX__" path="" value="0xffffffffU"/>
|
||||
<pathentry kind="mac" name="__GCC_ATOMIC_SHORT_LOCK_FREE" path="" value="2"/>
|
||||
<pathentry kind="mac" name="__INT_LEAST64_WIDTH__" path="" value="64"/>
|
||||
<pathentry kind="mac" name="__UINT_FAST8_TYPE__" path="" value="unsigned int"/>
|
||||
<pathentry kind="mac" name="__ATOMIC_ACQ_REL" path="" value="4"/>
|
||||
<pathentry kind="mac" name="__ATOMIC_RELEASE" path="" value="3"/>
|
||||
</storageModule>
|
||||
</cproject>
|
||||
@@ -1,36 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<project xmlns="http://www.ddci.com/DEOS_SHARED_OBJECToptions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="ddci:/xsd/DEOS_SHARED_OBJECT.xsd http://www.ddci.com/DEOS_SHARED_OBJECToptions">
|
||||
<version>26</version>
|
||||
<targetArch>ppc</targetArch>
|
||||
<variant>diagnostic</variant>
|
||||
<depend>kernel</depend>
|
||||
<depend variant="diagnostic">video</depend>
|
||||
<depend>ansi</depend>
|
||||
<depend>math</depend>
|
||||
<depend>deos-time</depend>
|
||||
<depend>sal</depend>
|
||||
<depend>mtl</depend>
|
||||
<depend>printx</depend>
|
||||
<depend>gnu-language</depend>
|
||||
<kernelFile kfs="hypstart">lib$(PROJECT_NAME).so</kernelFile>
|
||||
<copyToAppbin>$(BINARY)</copyToAppbin>
|
||||
<copyToAppbin>$(BINARY).dbg</copyToAppbin>
|
||||
<gccCCompileDirectories targetArch="arm">$(DESK_DIR)/arm/include</gccCCompileDirectories>
|
||||
<gccCCompileDirectories targetArch="ppc">$(DESK_DIR)/ppc/include</gccCCompileDirectories>
|
||||
<gccCCompileDirectories targetArch="x86">$(DESK_DIR)/x86/include</gccCCompileDirectories>
|
||||
<gccCCompileDirectories>$(DESK_DIR)/include</gccCCompileDirectories>
|
||||
<gccCCompileDirectories>$(PROJECT_DIR)/../../../..</gccCCompileDirectories>
|
||||
<gccCCompileDirectories>$(PROJECT_DIR)/../../../../fips</gccCCompileDirectories>
|
||||
<gccCCompileDirectories>$(PROJECT_DIR)/..</gccCCompileDirectories>
|
||||
<gccCCompileDirectories>$(PROJECT_DIR.printx)/code</gccCCompileDirectories>
|
||||
<gccCCompileDefinedMacros>WOLFSSL_USER_SETTINGS</gccCCompileDefinedMacros>
|
||||
<gccCppLinkDirectories targetArch="arm">$(DESK_DIR)/arm/appbin</gccCppLinkDirectories>
|
||||
<gccCppLinkDirectories targetArch="ppc">$(DESK_DIR)/ppc/appbin</gccCppLinkDirectories>
|
||||
<gccCppLinkDirectories targetArch="x86">$(DESK_DIR)/x86/appbin</gccCppLinkDirectories>
|
||||
<gccCppLinkUseIntermediateArchive>true</gccCppLinkUseIntermediateArchive>
|
||||
<gccCppLinkAdditionalOptions>-L $(PROJECT_DIR.printx)/output/powerpc-motorola-elf/diagnostic</gccCppLinkAdditionalOptions>
|
||||
<fpuType>none</fpuType>
|
||||
<ignore>fips.c</ignore>
|
||||
<ignore>fips_test.c</ignore>
|
||||
<ignore>selftest.c</ignore>
|
||||
</project>
|
||||
@@ -1,619 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>wolfssl</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.ddci.common.ide.Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.ddci.common.ide.DdciNature</nature>
|
||||
<nature>com.ddci.common.ide.ExecutableNature</nature>
|
||||
<nature>com.ddci.deos.common.deosLoadListNature</nature>
|
||||
<nature>com.ddci.common.ide.DEOS_SHARED_OBJECT</nature>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>deos_malloc.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/IDE/ECLIPSE/DEOS/deos_malloc.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>fips.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/fips/fips.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>fips_test.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/fips/fips_test.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>selftest.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/fips/selftest.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>user_settings.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/IDE/ECLIPSE/DEOS/user_settings.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfssl</name>
|
||||
<type>2</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfssl</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src/crl.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/src/crl.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src/internal.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/src/internal.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src/keys.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/src/keys.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src/ocsp.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/src/ocsp.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src/sniffer.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/src/sniffer.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src/ssl.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/src/ssl.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src/tls.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/src/tls.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src/tls13.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/src/tls13.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src/wolfio.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/src/wolfio.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/benchmark</name>
|
||||
<type>2</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/benchmark</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/test</name>
|
||||
<type>2</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/test</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/aes.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/aes.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/arc4.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/arc4.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/asm.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/asm.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/asn.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/asn.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/blake2b.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/blake2b.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/blake2s.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/blake2s.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/camellia.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/camellia.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/chacha.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/chacha.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/chacha20_poly1305.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/chacha20_poly1305.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/cmac.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/cmac.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/coding.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/coding.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/compress.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/compress.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/cpuid.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/cpuid.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/cryptocb.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/cryptocb.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/curve25519.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/curve25519.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/curve448.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/curve448.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/des3.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/des3.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/dh.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/dh.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/dsa.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/dsa.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/ecc.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/ecc.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/ecc_fp.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/ecc_fp.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/ed25519.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/ed25519.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/ed448.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/ed448.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/error.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/error.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fe_448.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fe_448.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fe_low_mem.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fe_low_mem.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fe_operations.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fe_operations.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fe_x25519_128.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fe_x25519_128.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_mont_small.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mont_small.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_mul_comba_12.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_12.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_mul_comba_17.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_17.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_mul_comba_20.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_20.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_mul_comba_24.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_24.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_mul_comba_28.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_28.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_mul_comba_3.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_3.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_mul_comba_32.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_32.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_mul_comba_4.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_4.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_mul_comba_48.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_48.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_mul_comba_6.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_6.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_mul_comba_64.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_64.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_mul_comba_7.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_7.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_mul_comba_8.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_8.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_mul_comba_9.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_9.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_mul_comba_small_set.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_small_set.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_sqr_comba_12.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_12.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_sqr_comba_17.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_17.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_sqr_comba_20.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_20.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_sqr_comba_24.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_24.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_sqr_comba_28.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_28.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_sqr_comba_3.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_3.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_sqr_comba_32.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_32.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_sqr_comba_4.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_4.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_sqr_comba_48.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_48.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_sqr_comba_6.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_6.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_sqr_comba_64.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_64.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_sqr_comba_7.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_7.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_sqr_comba_8.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_8.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_sqr_comba_9.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_9.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_sqr_comba_small_set.i</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_small_set.i</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/ge_448.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/ge_448.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/ge_low_mem.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/ge_low_mem.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/ge_operations.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/ge_operations.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/kdf.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/kdf.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/hash.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/hash.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/hmac.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/hmac.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/integer.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/integer.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/logging.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/logging.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/md2.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/md2.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/md4.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/md4.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/md5.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/md5.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/memory.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/memory.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/pkcs12.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/pkcs12.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/pkcs7.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/pkcs7.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/poly1305.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/poly1305.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/pwdbased.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/pwdbased.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/random.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/random.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/rc2.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/rc2.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/ripemd.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/ripemd.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/rsa.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/rsa.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/sha.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sha.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/sha256.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sha256.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/sha3.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sha3.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/sha512.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sha512.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/signature.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/signature.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/sp_arm32.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sp_arm32.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/sp_arm64.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sp_arm64.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/sp_armthumb.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sp_armthumb.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/sp_c32.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sp_c32.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/sp_c64.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sp_c64.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/sp_cortexm.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sp_cortexm.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/sp_dsp32.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sp_dsp32.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/sp_int.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sp_int.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/sp_x86_64.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sp_x86_64.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/srp.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/srp.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/tfm.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/tfm.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/wc_dsp.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/wc_dsp.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/wc_encrypt.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/wc_encrypt.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/wc_pkcs11.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/wc_pkcs11.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/wc_port.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/wc_port.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/wolfevent.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/wolfevent.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/wolfmath.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/wolfmath.c</locationURI>
|
||||
</link>
|
||||
</linkedResources>
|
||||
<variableList>
|
||||
<variable>
|
||||
<name>WOLFSSL_ROOT</name>
|
||||
<value>$%7BPARENT-4-PROJECT_LOC%7D</value>
|
||||
</variable>
|
||||
</variableList>
|
||||
</projectDescription>
|
||||
@@ -7,7 +7,4 @@ EXTRA_DIST += \
|
||||
IDE/ECLIPSE/DEOS/user_settings.h \
|
||||
IDE/ECLIPSE/DEOS/tls_wolfssl.h \
|
||||
IDE/ECLIPSE/DEOS/tls_wolfssl.c \
|
||||
IDE/ECLIPSE/DEOS/deos_malloc.c \
|
||||
IDE/ECLIPSE/DEOS/deos_wolfssl/.cproject \
|
||||
IDE/ECLIPSE/DEOS/deos_wolfssl/.options \
|
||||
IDE/ECLIPSE/DEOS/deos_wolfssl/.project
|
||||
IDE/ECLIPSE/DEOS/deos_malloc.c
|
||||
@@ -1,6 +1,6 @@
|
||||
/* tls_wolfssl.c
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -31,19 +31,19 @@ int setupTransport(clientConnectionHandleType* connectionHandle,
|
||||
char* connectionId) {
|
||||
int ret, error;
|
||||
void * sendBuffer;
|
||||
size_t bufferSizeInBytes;
|
||||
DWORD bufferSizeInBytes;
|
||||
|
||||
if ((ret = socketTransportInitialize("mailbox-transport.config",
|
||||
"transportConfigurationId",
|
||||
waitIndefinitely,&error)) != transportSuccess)
|
||||
(DWORD)waitIndefinitely,&error)) != transportSuccess)
|
||||
printf("Initialize 0x%x, error=%d\n", ret, error);
|
||||
|
||||
else if ((ret = socketTransportClientInitialize(waitIndefinitely,
|
||||
else if ((ret = socketTransportClientInitialize((DWORD)waitIndefinitely,
|
||||
&error)) != transportSuccess)
|
||||
printf("ClientInitialize 0x%x, error=%d\n", ret, error);
|
||||
|
||||
else if ((ret = socketTransportCreateConnection(connectionId,
|
||||
waitIndefinitely,
|
||||
(DWORD)waitIndefinitely,
|
||||
COMPATIBILITY_ID_2,
|
||||
connectionHandle,
|
||||
&sendBuffer,
|
||||
@@ -53,7 +53,7 @@ int setupTransport(clientConnectionHandleType* connectionHandle,
|
||||
|
||||
else if ((ret = socketTransportSetConnectionForThread(currentThreadHandle(),
|
||||
*connectionHandle,
|
||||
waitIndefinitely,
|
||||
(DWORD)waitIndefinitely,
|
||||
&error)) != transportSuccess)
|
||||
printf("SetConnectionForThread 0x%x, error=%d\n", ret, error);
|
||||
|
||||
@@ -162,7 +162,7 @@ void wolfssl_client_test(uintData_t statusPtr) {
|
||||
TCP_SERVER_IP_ADDR, TCP_SERVER_PORT);
|
||||
|
||||
server_addr.sin_family = AF_INET;
|
||||
server_addr.sin_addr.s_addr = inet_addr(TCP_SERVER_IP_ADDR);
|
||||
server_addr.sin_addr = inet_addr(TCP_SERVER_IP_ADDR);
|
||||
server_addr.sin_port = htons(TCP_SERVER_PORT);
|
||||
|
||||
printf("Calling connect on socket\n");
|
||||
@@ -380,7 +380,10 @@ void wolfssl_server_test(uintData_t statusPtr)
|
||||
int socketAddrLen=sizeof(sockaddr);
|
||||
char rx_buf[RX_BUF_SIZE];
|
||||
char tx_buf[TX_BUF_SIZE];
|
||||
unsigned char attempt_conn;
|
||||
clientConnectionHandleType TCPserverHandle;
|
||||
void * sendBuffer;
|
||||
DWORD bufferSizeInBytes;
|
||||
|
||||
WOLFSSL * ssl;
|
||||
WOLFSSL_CTX * ctx;
|
||||
@@ -407,7 +410,7 @@ void wolfssl_server_test(uintData_t statusPtr)
|
||||
|
||||
printf("Setting up server_addr struct\n");
|
||||
server_addr.sin_family = AF_INET;
|
||||
server_addr.sin_addr.s_addr = INADDR_ANY;
|
||||
server_addr.sin_addr = INADDR_ANY;
|
||||
server_addr.sin_port = htons(TLS_SERVER_PORT);
|
||||
|
||||
bindStatus = bind(sock_listen, (sockaddr *) &server_addr, sizeof(server_addr));
|
||||
@@ -510,7 +513,7 @@ void wolfssl_server_test(uintData_t statusPtr)
|
||||
wolfSSL_CTX_free(ctx);
|
||||
return;
|
||||
}
|
||||
/* goToSleep() for 500 milliseconds */
|
||||
/* goToSleep() for 500 milli sec*/
|
||||
}
|
||||
} while ((ret != SSL_SUCCESS) && (error == SSL_ERROR_WANT_READ));
|
||||
|
||||
@@ -569,6 +572,7 @@ int wolfsslRunTests (void)
|
||||
{
|
||||
thread_handle_t TCPhandle;
|
||||
threadStatus ts;
|
||||
int ret;
|
||||
|
||||
#if !defined(NO_CRYPT_TEST)
|
||||
wolfcrypt_test(NULL);
|
||||
@@ -580,14 +584,14 @@ int wolfsslRunTests (void)
|
||||
ts = createThread("TCPclient", "TCPThreadTemplate", wolfssl_client_test,
|
||||
0, &TCPhandle );
|
||||
if (ts != threadSuccess) {
|
||||
printf("Unable to create TCP client thread, %i ", (size_t)ts);
|
||||
printf("Unable to create TCP client thread, %i ", (DWORD)ts);
|
||||
}
|
||||
#endif
|
||||
#if !defined(NO_WOLFSSL_SERVER)
|
||||
ts = createThread("TCPserver", "TCPThreadTemplate", wolfssl_server_test,
|
||||
0, &TCPhandle );
|
||||
if (ts != threadSuccess) {
|
||||
printf("Unable to create TCP server thread, %i ", (size_t)ts);
|
||||
printf("Unable to create TCP server thread, %i ", (DWORD)ts);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* tls_wolfssl.h
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* user_setting.h
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -26,141 +26,73 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/* RTEMS */
|
||||
#define WOLFSSL_DEOS_RTEMS
|
||||
#define WOLFSSL_DEOS
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
#include <pthread.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h> /* for size_t */
|
||||
#include <stdlib.h> /* for malloc/free */
|
||||
/* You can select none or all of the following tests
|
||||
using #define instead of #undef.
|
||||
By default, all four tests run*/
|
||||
|
||||
#if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
|
||||
#define BIG_ENDIAN_ORDER
|
||||
#else
|
||||
#undef BIG_ENDIAN_ORDER
|
||||
#define LITTLE_ENDIAN_ORDER
|
||||
#endif
|
||||
#else
|
||||
/* DEOS Native */
|
||||
#define WOLFSSL_DEOS
|
||||
|
||||
#include <deos.h>
|
||||
#include <timeout.h>
|
||||
#include <socketapi.h>
|
||||
#include <lwip-socket.h>
|
||||
#include <mem.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h> /* for rand_r: pseudo-random number generator */
|
||||
#include <stdio.h> /* for snprintf */
|
||||
#endif
|
||||
|
||||
/* Porting */
|
||||
#undef NO_CRYPT_TEST
|
||||
#undef NO_CRYPT_BENCHMARK
|
||||
#undef NO_WOLFSSL_CLIENT
|
||||
#undef NO_WOLFSSL_SERVER
|
||||
|
||||
/* adjust CURRENT_UNIX_TIMESTAMP to seconds since Jan 01 1970. (UTC)
|
||||
You can get the current time from https://www.unixtimestamp.com/ */
|
||||
#define CURRENT_UNIX_TIMESTAMP 1663020069
|
||||
You can get the current time from https://www.unixtimestamp.com/
|
||||
*/
|
||||
#define CURRENT_UNIX_TIMESTAMP 1545864916
|
||||
|
||||
#define BENCH_EMBEDDED /* use kB instead of mB for embedded benchmarking */
|
||||
#define WOLFSSL_IGNORE_FILE_WARN /* ignore warning for include of files not required */
|
||||
|
||||
/* Math */
|
||||
#define USE_FAST_MATH
|
||||
#define FP_MAX_BITS (4096*2)
|
||||
#define NO_FILESYSTEM
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#define TFM_TIMING_RESISTANT
|
||||
#define ECC_TIMING_RESISTANT
|
||||
#define WC_RSA_BLINDING
|
||||
|
||||
/* Wolf Single Precision Math */
|
||||
#undef WOLFSSL_SP
|
||||
#if 1
|
||||
#define WOLFSSL_HAVE_SP_RSA
|
||||
#define WOLFSSL_HAVE_SP_DH
|
||||
#define WOLFSSL_HAVE_SP_ECC
|
||||
#define WOLFSSL_SP_4096 /* Enable RSA/RH 4096-bit support */
|
||||
#define WOLFSSL_SP_384 /* Enable ECC 384-bit SECP384R1 support */
|
||||
/* prevents from including multiple definition of main() */
|
||||
#define NO_MAIN_DRIVER
|
||||
#define NO_TESTSUITE_MAIN_DRIVER
|
||||
|
||||
//#define WOLFSSL_SP_CACHE_RESISTANT
|
||||
#define WOLFSSL_SP_MATH /* only SP math - disables integer.c/tfm.c */
|
||||
//#define WOLFSSL_SP_MATH_ALL /* use SP math for all key sizes and curves */
|
||||
/* includes certificate test buffers via header files */
|
||||
#define USE_CERT_BUFFERS_2048
|
||||
|
||||
#define WOLFSSL_SP_NO_MALLOC
|
||||
//#define WOLFSSL_SP_DIV_32 /* do not use 64-bit divides */
|
||||
/*use kB instead of mB for embedded benchmarking*/
|
||||
#define BENCH_EMBEDDED
|
||||
|
||||
/* use smaller version of code */
|
||||
#define WOLFSSL_SP_SMALL
|
||||
#endif
|
||||
#define NO_WRITE_TEMP_FILES
|
||||
|
||||
/* Algorithms */
|
||||
#undef NO_RSA
|
||||
#undef NO_DH
|
||||
#define WOLFSSL_DH_CONST
|
||||
#define HAVE_ECC
|
||||
#define ECC_USER_CURVES
|
||||
#define HAVE_ECC384
|
||||
|
||||
#if 1
|
||||
#define HAVE_CURVE25519
|
||||
#define HAVE_ED25519
|
||||
#define CURVED25519_SMALL
|
||||
#endif
|
||||
|
||||
#undef NO_SHA
|
||||
#undef NO_MD5
|
||||
#undef NO_SHA256
|
||||
#define HAVE_AESGCM
|
||||
#define WOLFSSL_SHA384
|
||||
#define WOLFSSL_SHA512
|
||||
#define HAVE_ECC
|
||||
#define HAVE_CURVE25519
|
||||
#define CURVE25519_SMALL
|
||||
#define HAVE_ED25519
|
||||
#define ED25519_SMALL
|
||||
|
||||
/* TLS */
|
||||
#define HAVE_TLS_EXTENSIONS
|
||||
#define HAVE_SUPPORTED_CURVES
|
||||
#define HAVE_EXTENDED_MASTER
|
||||
#define HAVE_ENCRYPT_THEN_MAC
|
||||
|
||||
//#define WOLFSSL_DTLS
|
||||
//#define WOLFSSL_DTLS13
|
||||
//#define WOLFSSL_NO_TLS12
|
||||
|
||||
/* TLS 1.3 */
|
||||
#if 0
|
||||
/* TLS 1.3 */
|
||||
#define WOLFSSL_TLS13
|
||||
#define WC_RSA_PSS
|
||||
#define HAVE_HKDF
|
||||
#define HAVE_FFDHE_2048
|
||||
#define HAVE_FFDHE_3072
|
||||
#define HAVE_FFDHE_4096
|
||||
#define HAVE_AEAD
|
||||
#endif
|
||||
|
||||
/* wolfSentry */
|
||||
#if 0
|
||||
#define WOLFSSL_WOLFSENTRY_HOOKS
|
||||
#define HAVE_EX_DATA
|
||||
#define HAVE_EX_DATA_CLEANUP_HOOKS
|
||||
|
||||
/* You can use your own custom random generator function with
|
||||
no input parameters and a `CUSTOM_RAND_TYPE` return type*/
|
||||
|
||||
#ifndef CUSTOM_RAND_GENERATE
|
||||
#define CUSTOM_RAND_TYPE int
|
||||
#define CUSTOM_RAND_GENERATE yourRandGenFunc
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* compatibility layer */
|
||||
#if 0
|
||||
#define OPENSSL_EXTRA
|
||||
#endif
|
||||
|
||||
/* Random */
|
||||
#ifdef WOLFSSL_DEOS_RTEMS
|
||||
extern int rtems_wolf_seed(unsigned char* output, unsigned int sz);
|
||||
#define CUSTOM_RAND_GENERATE_SEED rtems_wolf_seed
|
||||
#endif
|
||||
|
||||
/* custom heap handling */
|
||||
#ifdef WOLFSSL_DEOS
|
||||
#define WOLFSSL_NO_MALLOC
|
||||
#if 1
|
||||
#undef XMALLOC_OVERRIDE
|
||||
#define XMALLOC_OVERRIDE
|
||||
|
||||
/* prototypes for user heap override functions */
|
||||
|
||||
#include <stddef.h> /* for size_t */
|
||||
|
||||
extern void *malloc_deos(size_t size);
|
||||
extern void free_deos(void *ptr);
|
||||
extern void *realloc_deos(void *ptr, size_t size);
|
||||
@@ -168,39 +100,10 @@ You can get the current time from https://www.unixtimestamp.com/ */
|
||||
#define XMALLOC(n, h, t) malloc_deos(n)
|
||||
#define XFREE(p, h, t) free_deos(p)
|
||||
#define XREALLOC(p, n, h, t) realloc_deos(p, n)
|
||||
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#define DEBUG_WOLFSSL
|
||||
#endif
|
||||
|
||||
/* You can select none or all of the following tests
|
||||
* using #define instead of #undef.
|
||||
* By default, all four tests run*/
|
||||
#define NO_CRYPT_TEST
|
||||
#define NO_CRYPT_BENCHMARK
|
||||
#undef NO_WOLFSSL_CLIENT
|
||||
#undef NO_WOLFSSL_SERVER
|
||||
|
||||
/* file system has not been ported since it is a separate product */
|
||||
#define NO_FILESYSTEM
|
||||
#define NO_WOLFSSL_DIR
|
||||
#define NO_WRITEV
|
||||
#define NO_WRITE_TEMP_FILES
|
||||
|
||||
/* disable old protocols and algorithms */
|
||||
#define NO_OLD_TLS
|
||||
#define NO_PSK
|
||||
#define NO_DSA
|
||||
#define NO_RC4
|
||||
#define NO_MD4
|
||||
|
||||
#define NO_PWDBASED
|
||||
|
||||
/* prevents from including multiple definition of main() */
|
||||
#define NO_MAIN_DRIVER
|
||||
#define NO_TESTSUITE_MAIN_DRIVER
|
||||
|
||||
#define printf printx
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
# Micrium μC/OS-III Port
|
||||
## Overview
|
||||
You can enable the wolfSSL support for Micrium μC/OS-III RTOS available [here](http://www.micrium.com/) using the define `MICRIUM`.
|
||||
You can enable the wolfSSL support for Micrium μC/OS-III RTOS available [here](http://www.micriums.com/) using the define `MICRIUM`.
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -72,7 +72,7 @@ The test results below were collected from the NXP Kinetis K70 (Freescale TWR-K7
|
||||
|
||||
- IAR Embedded Workbench IDE - ARM 8.32.1 (IAR ELF Linker V8.32.1.169/W32 for ARM)
|
||||
|
||||
- The starting project is based on an IAR EWARM project from Micrium download center at [micrium_twr-k70f120m-os3/](https://www.micrium.com/download/micrium_twr-k70f120m-os3/) but the K70X_FLASH.icf linker script file was slightly modified to configure the stack and heap sizes to 16KB and 20KB. The test was run on a 1 MBytes of program flash and 128 KBytes of static RAM. ([Similar TCP version](https://www.micrium.com/download/twr-k70f120m_os3-tcpip-wifi-lib/))
|
||||
- The starting project is based on an IAR EWARM project from Micrium download center at [micrium_twr-k70f120m-os3/](https://www.micrium.com/download/micrium_twr-k70f120m-os3/) but the K70X_FLASH.icf linker script file was slightly modified to configure the stack and heap sizes to 16KB and 20KB. The test was run on a 1 MBytes of program flash and 128 KBytes of static RAM.
|
||||
|
||||
- wolfssl [latest version](https://github.com/wolfSSL/wolfssl)
|
||||
|
||||
@@ -93,6 +93,8 @@ HMAC-SHA test passed!
|
||||
HAC-SHA256 test passed!
|
||||
HMAC-SHA512 test passed!
|
||||
GMC test passed!
|
||||
HC-128 test passed!
|
||||
Rabbit test passed!
|
||||
DS test passed!
|
||||
DS3 test passed!
|
||||
AES test passed!
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* client_wolfssl.c
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* client_wolfssl.h
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* server_wolfssl.c
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* server_wolfssl.h
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* user_setting.h
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* wolfsslRunTests.c
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
|
||||
@@ -1,173 +0,0 @@
|
||||
# RT-Thread Port
|
||||
## Overview
|
||||
You can enable the wolfSSL support for RT-Thread available [here](https://www.rt-thread.io) using the define `RTTHREAD`.
|
||||
|
||||
## Usage
|
||||
|
||||
wolfSSL supports a compile-time user configurable options in the `IDE/ECLIPSE/RTTHREAD/user_settings.h` file.
|
||||
|
||||
The `wolfssl_test.c` example application provides a simple function to run the test and benchmark.
|
||||
|
||||
1. Open your IDE-based example project for RT-Thread.
|
||||
|
||||
2. Create the following folder and sub-folders structures in your project.
|
||||
```
|
||||
wolfssl
|
||||
|src
|
||||
|wolfcrypt
|
||||
|benchmark
|
||||
|src
|
||||
|test
|
||||
|wolfssl
|
||||
|openssl
|
||||
|wolfcrypt
|
||||
|example
|
||||
```
|
||||
The folder hierarchy is the same as the wolfSSL folders with an exception of the example folder.
|
||||
|
||||
3. Add or link all of the header and source files in `IDE/ECLIPSE/RTTHREAD/` folder into the example folder.
|
||||
|
||||
4. Add or link all the source code in the corresponding folder in wolfSSL.
|
||||
|
||||
5. Remove non-C platform dependent files from your build.
|
||||
|
||||
6. In your C/C++ compiler preprocessor settings, add the wolfSSL directories to your include paths.
|
||||
Here's an example of the paths that must be added.
|
||||
|
||||
```
|
||||
$PROJ_DIR$\...
|
||||
$PROJ_DIR$\...\wolfcrypt
|
||||
$PROJ_DIR$\...\wolfssl
|
||||
$PROJ_DIR$\...\IDE\ECLIPSE\RTTHREAD
|
||||
```
|
||||
|
||||
7. In your C/C++ compiler preprocessor settings, define the WOLFSSL_USER_SETTINGS symbol to add user_settings.h file in your project.
|
||||
|
||||
8. Add a call to `wolfssl_test()` from your startup task. Here's an example:
|
||||
|
||||
```c
|
||||
static void test_task (void *p_arg)
|
||||
{
|
||||
...
|
||||
while (1) {
|
||||
wolfssl_test();
|
||||
rt_thread_mdelay(500);
|
||||
}
|
||||
}
|
||||
```
|
||||
9. Rebuild all your project.
|
||||
|
||||
10. Now you are ready to download and debug your image on the board.
|
||||
|
||||
|
||||
The test results below were collected from the RT-Thread ART-Pi with the following software and tool chains:
|
||||
|
||||
- STM32H750XBH6
|
||||
|
||||
- RT-Thread Studio (Version: 2.0.0)
|
||||
|
||||
- GNU ARM Cross C Compiler (Optimization level: -O0)
|
||||
|
||||
- The starting project is based on [RT-Thread ART-Pi SDK](https://github.com/RT-Thread-Studio/sdk-bsp-stm32h750-realthread-artpi) (./projects/art_pi_wifi)
|
||||
|
||||
- wolfssl [latest version](https://github.com/wolfSSL/wolfssl)
|
||||
|
||||
|
||||
### `WOLFSSL_WOLFCRYPT_TEST` output of wolfcrypt_test()
|
||||
```
|
||||
error test passed!
|
||||
MEMORY test passed!
|
||||
base64 test passed!
|
||||
asn test passed!
|
||||
RANDOM test passed!
|
||||
MD5 test passed!
|
||||
MD4 test passed!
|
||||
SHA test passed!
|
||||
SHA-256 test passed!
|
||||
SHA-512 test passed!
|
||||
Hash test passed!
|
||||
HMAC-MD5 test passed!
|
||||
HMAC-SHA test passed!
|
||||
HMAC-SHA256 test passed!
|
||||
HMAC-SHA512 test passed!
|
||||
X963-KDF test passed!
|
||||
GMAC test passed!
|
||||
ARC4 test passed!
|
||||
DES test passed!
|
||||
DES3 test passed!
|
||||
AES test passed!
|
||||
AES192 test passed!
|
||||
AES256 test passed!
|
||||
AES-GCM test passed!
|
||||
AES Key Wrap test passed!
|
||||
RSA test passed!
|
||||
DH test passed!
|
||||
DSA test passed!
|
||||
PWDBASED test passed!
|
||||
ECC test passed!
|
||||
ECC buffer test passed!
|
||||
CURVE25519 test passed!
|
||||
ED25519 test passed!
|
||||
PKCS7encrypted test passed!
|
||||
PKCS7signed test passed!
|
||||
PKCS7enveloped test passed!
|
||||
PKCS7authenveloped test passed!
|
||||
logging test passed!
|
||||
mutex test passed!
|
||||
memcb test passed!
|
||||
```
|
||||
### `WOLFSSL_BENCHMARK_TEST` output of benchmark_test()
|
||||
```
|
||||
------------------------------------------------------------------------------
|
||||
wolfSSL version 4.5.0
|
||||
------------------------------------------------------------------------------
|
||||
wolfCrypt Benchmark (block bytes 1024, min 1.0 sec each)
|
||||
RNG 50 KB took 1.000 seconds, 50.000 KB/s
|
||||
AES-128-CBC-enc 2 MB took 1.000 seconds, 2.075 MB/s
|
||||
AES-128-CBC-dec 2 MB took 1.000 seconds, 1.611 MB/s
|
||||
AES-192-CBC-enc 2 MB took 1.000 seconds, 2.002 MB/s
|
||||
AES-192-CBC-dec 2 MB took 1.000 seconds, 1.514 MB/s
|
||||
AES-256-CBC-enc 2 MB took 1.000 seconds, 1.855 MB/s
|
||||
AES-256-CBC-dec 1 MB took 1.000 seconds, 1.465 MB/s
|
||||
AES-128-GCM-enc 700 KB took 1.000 seconds, 700.000 KB/s
|
||||
AES-128-GCM-dec 675 KB took 1.000 seconds, 675.000 KB/s
|
||||
AES-192-GCM-enc 675 KB took 1.000 seconds, 675.000 KB/s
|
||||
AES-192-GCM-dec 675 KB took 1.000 seconds, 675.000 KB/s
|
||||
AES-256-GCM-enc 650 KB took 1.000 seconds, 650.000 KB/s
|
||||
AES-256-GCM-dec 650 KB took 1.000 seconds, 650.000 KB/s
|
||||
AES-128-ECB-enc 2 MB took 1.000 seconds, 1.902 MB/s
|
||||
AES-128-ECB-dec 2 MB took 1.000 seconds, 1.521 MB/s
|
||||
AES-192-ECB-enc 2 MB took 1.000 seconds, 1.780 MB/s
|
||||
AES-192-ECB-dec 1 MB took 1.000 seconds, 1.433 MB/s
|
||||
AES-256-ECB-enc 2 MB took 1.000 seconds, 1.638 MB/s
|
||||
AES-256-ECB-dec 1 MB took 1.000 seconds, 1.405 MB/s
|
||||
ARC4 5 MB took 1.000 seconds, 4.956 MB/s
|
||||
RABBIT 6 MB took 1.000 seconds, 6.470 MB/s
|
||||
3DES 750 KB took 1.000 seconds, 750.000 KB/s
|
||||
MD5 12 MB took 1.000 seconds, 12.061 MB/s
|
||||
SHA 4 MB took 1.000 seconds, 3.979 MB/s
|
||||
SHA-256 2 MB took 1.000 seconds, 1.782 MB/s
|
||||
SHA-512 1 MB took 1.000 seconds, 1.001 MB/s
|
||||
HMAC-MD5 12 MB took 1.000 seconds, 12.329 MB/s
|
||||
HMAC-SHA 4 MB took 1.000 seconds, 3.662 MB/s
|
||||
HMAC-SHA256 2 MB took 1.000 seconds, 1.758 MB/s
|
||||
HMAC-SHA512 1 MB took 1.000 seconds, 1.001 MB/s
|
||||
PBKDF2 224 bytes took 1.000 seconds, 224.000 bytes/s
|
||||
RSA 2048 public 20 ops took 1.000 sec, avg 50.000 ms, 20.000 ops/sec
|
||||
RSA 2048 private 2 ops took 1.000 sec, avg 500.000 ms, 2.000 ops/sec
|
||||
DH 2048 key gen 4 ops took 1.000 sec, avg 250.000 ms, 4.000 ops/sec
|
||||
DH 2048 agree 4 ops took 1.000 sec, avg 250.000 ms, 4.000 ops/sec
|
||||
ECC 256 key gen 6 ops took 1.000 sec, avg 166.667 ms, 6.000 ops/sec
|
||||
ECDHE 256 agree 6 ops took 1.000 sec, avg 166.667 ms, 6.000 ops/sec
|
||||
ECDSA 256 sign 6 ops took 1.000 sec, avg 166.667 ms, 6.000 ops/sec
|
||||
ECDSA 256 verify 4 ops took 1.000 sec, avg 250.000 ms, 4.000 ops/sec
|
||||
CURVE 25519 key gen 4 ops took 1.000 sec, avg 250.000 ms, 4.000 ops/sec
|
||||
CURVE 25519 agree 2 ops took 1.000 sec, avg 500.000 ms, 2.000 ops/sec
|
||||
ED 25519 key gen 4 ops took 1.000 sec, avg 250.000 ms, 4.000 ops/sec
|
||||
ED 25519 sign 2 ops took 1.000 sec, avg 500.000 ms, 2.000 ops/sec
|
||||
ED 25519 verify 2 ops took 1.000 sec, avg 500.000 ms, 2.000 ops/sec
|
||||
```
|
||||
|
||||
## References
|
||||
|
||||
For more information please contact info@wolfssl.com.
|
||||
@@ -1,8 +0,0 @@
|
||||
# vim:ft=automake
|
||||
# included from Top Level Makefile.am
|
||||
# All paths should be given relative to the root
|
||||
|
||||
EXTRA_DIST += \
|
||||
IDE/ECLIPSE/RTTHREAD/README.md \
|
||||
IDE/ECLIPSE/RTTHREAD/user_settings.h \
|
||||
IDE/ECLIPSE/RTTHREAD/wolfssl_test.c
|
||||
@@ -1,81 +0,0 @@
|
||||
/* user_setting.h
|
||||
*
|
||||
* Copyright (C) 2006-2022 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_USER_SETTINGS_H_
|
||||
#define WOLFSSL_USER_SETTINGS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define RTTHREAD
|
||||
|
||||
/* You can select one or all of the following tests */
|
||||
#define WOLFSSL_WOLFCRYPT_TEST
|
||||
#define WOLFSSL_BENCHMARK_TEST
|
||||
#define WOLFSSL_CLIENT_TEST
|
||||
#define WOLFSSL_SERVER_TEST
|
||||
#define USE_TEST_GENSEED
|
||||
#define NO_DEV_RANDOM
|
||||
#define HAVE_PKCS7
|
||||
#define HAVE_AES_KEYWRAP
|
||||
#define HAVE_X963_KDF
|
||||
#define WOLFSSL_AES_DIRECT
|
||||
/* adjust CURRENT_UNIX_TS to seconds since Jan 01 1970. (UTC)
|
||||
You can get the current time from https://www.unixtimestamp.com/
|
||||
*/
|
||||
#define CURRENT_UNIX_TS 1542605837UL
|
||||
|
||||
/* When using Windows simulator, you must define USE_WINDOWS_API for test.h to build */
|
||||
#ifdef _WIN32
|
||||
#define USE_WINDOWS_API
|
||||
#endif
|
||||
|
||||
#define NO_FILESYSTEM
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
|
||||
/* prevents from including multiple definition of main() */
|
||||
#define NO_MAIN_DRIVER
|
||||
#define NO_TESTSUITE_MAIN_DRIVER
|
||||
|
||||
/* includes certificate test buffers via header files */
|
||||
#define USE_CERT_BUFFERS_2048
|
||||
/*use kB instead of mB for embedded benchmarking*/
|
||||
#define BENCH_EMBEDDED
|
||||
|
||||
#define NO_WRITE_TEMP_FILES
|
||||
|
||||
#define XSNPRINTF snprintf
|
||||
#define NO_WRITEV
|
||||
|
||||
#define HAVE_AESGCM
|
||||
#define WOLFSSL_SHA512
|
||||
#define HAVE_ECC
|
||||
#define HAVE_CURVE25519
|
||||
#define CURVE25519_SMALL
|
||||
#define HAVE_ED25519
|
||||
#define ED25519_SMALL
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,33 +0,0 @@
|
||||
/* wolfsslRunTests.c
|
||||
*
|
||||
* Copyright (C) 2006-2022 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 <stdint.h>
|
||||
#include <wolfcrypt/test/test.h>
|
||||
#include <wolfcrypt/benchmark/benchmark.h>
|
||||
|
||||
int wolfssl_test(void) {
|
||||
#if !defined(NO_CRYPT_TEST)
|
||||
wolfcrypt_test(NULL);
|
||||
#endif
|
||||
#if !defined(NO_CRYPT_BENCHMARK)
|
||||
benchmark_test(NULL);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
@@ -1 +1,199 @@
|
||||
This folder has moved to `IDE/RISCV/SIFIVE-HIFIVE1`.
|
||||
# SiFive RISC-V HiFive1 Port
|
||||
|
||||
## Overview
|
||||
You can enable the wolfSSL support for RISC-V using the `#define WOLFSSL_SIFIVE_RISC_V`.
|
||||
|
||||
## Prerequisites
|
||||
1. Follow the instructions on the SiFive GitHub [here](https://github.com/sifive/freedom-e-sdk) and SiFive website [here](https://www.sifive.com/) to download the freedom-e-sdk and software tools.
|
||||
3. Run a simple hello application on your development board to confirm that your board functions as expected and the communication between your computer and the board works.
|
||||
|
||||
## Usage
|
||||
You can start with a wolfcrypt example project to integrate the wolfSSL source code.
|
||||
wolfSSL supports a compile-time user configurable options in the `IDE/ECLIPSE/SIFIVE/user_settings.h` file.
|
||||
|
||||
The `IDE/ECLIPSE/SIFIVE/main.c` example application provides a function to run the selected examples at compile time through the following two #defines in user_settings.h. You can define these macro options to disable the test run.
|
||||
```
|
||||
- #undef NO_CRYPT_TEST
|
||||
- #undef NO_CRYPT_BENCHMARK
|
||||
```
|
||||
|
||||
## Setup
|
||||
### Setting up the SDK with wolfSSL
|
||||
1. Download the wolfSSL source code or a zip file from GitHub and place it under your SDK `$HOME` directory. You can also copy or simlink to the source.
|
||||
```
|
||||
For example,
|
||||
$ cd $HOME
|
||||
$ git clone --depth=1 https://github.com/wolfSSL/wolfssl.git
|
||||
|
||||
```
|
||||
2. Copy the wolfcrypt example project into your `freedom-e-sdk/software` directory.
|
||||
|
||||
```
|
||||
$ cp -rf ~/wolfssl/IDE/ECLIPSE/SIFIVE ~/freedom-e-sdk/software/wolfcrypt
|
||||
```
|
||||
|
||||
3. Edit your `~/freedom-e-sdk/scripts/standalone.mk` and add the following line after the last RISCV_CFLAGS entry:
|
||||
|
||||
```
|
||||
RISCV_CFLAGS += -I$(WOLFSSL_SRC_DIR) -I$(WOLFSSL_SRC_DIR)/IDE/ECLIPSE/SIFIVE -DWOLFSSL_USER_SETTINGS
|
||||
```
|
||||
|
||||
4. WOLFSSL_SRC_DIR variable must be set in the environment when GNU make is started.
|
||||
|
||||
```
|
||||
$ export WOLFSSL_SRC_DIR=~/wolfssl
|
||||
```
|
||||
|
||||
5. Setup your riscv64 compiler
|
||||
|
||||
```
|
||||
$ export RISCV_OPENOCD_PATH=/opt/riscv-openocd
|
||||
```
|
||||
6. (Optional) Setup OpenOCD if your target supports it:
|
||||
|
||||
```
|
||||
$ export RISCV_OPENOCD_PATH=/opt/riscv-openocd
|
||||
```
|
||||
## Building and Running
|
||||
|
||||
You can build from source or create a static library.
|
||||
|
||||
1. Using command-line:
|
||||
|
||||
```
|
||||
$ cd freedom-e-sdk
|
||||
$ make PROGRAM=wolfcrypt TARGET=sifive-hifive1-revb CONFIGURATION=debug clean software upload
|
||||
```
|
||||
This example cleans, builds and uploads the software on the sifive-hifive1-revb target but you can also combine and build for any of the supported targets.
|
||||
|
||||
Review the test results on the target console.
|
||||
|
||||
2. Building a static library for RISC-V using a cross-compiler:
|
||||
|
||||
```
|
||||
$ cd $WOLFSSL_SRC_DIR
|
||||
|
||||
$./configure --host=riscv64-unknown-elf \
|
||||
CC=riscv64-unknown-elf-gcc \
|
||||
AR=riscv64-unknown-elf-ar \
|
||||
AS=riscv64-unknown-elf-as \
|
||||
RANLIB=$RISCV_PATH/bin/riscv64-unknown-elf-gcc-ranlib \
|
||||
LD=riscv64-unknown-elf-ld \
|
||||
CXX=riscv64-unknown-elf-g++ \
|
||||
--disable-examples --enable-static --disable-shared \
|
||||
CFLAGS="-march=rv32imac -mabi=ilp32 -mcmodel=medlow -ffunction-sections -fdata-sections -I~/freedom-e-sdk/bsp/sifive-hifive1/install/include -O0 -g -DNO_FILESYSTEM -DWOLFSSL_NO_SOCK -DNO_WRITEV -DWOLFCRYPT_ONLY -DWOLFSSL_SIFIVE_RISC_V"
|
||||
|
||||
$make
|
||||
$sudo make install
|
||||
```
|
||||
You can now build and link your software to the wolfSSL libwolfssl.a static library.
|
||||
|
||||
### `wolfcrypt_test()`
|
||||
|
||||
wolfcrypt_test() prints a message on the target console similar to the following output:
|
||||
|
||||
```
|
||||
SiFive HiFive1 Demo
|
||||
Setting clock to 320MHz
|
||||
Actual Clock 320MHz
|
||||
|
||||
error test passed!
|
||||
MEMORY test passed!
|
||||
base64 test passed!
|
||||
asn test passed!
|
||||
SHA test passed!
|
||||
SHA-256 test passed!
|
||||
SHA-512 test passed!
|
||||
Hash test passed!
|
||||
HMAC-SHA test passed!
|
||||
HMAC-SHA256 test passed!
|
||||
HMAC-SHA512 test passed!
|
||||
GMAC test passed!
|
||||
Chacha test passed!
|
||||
POLY1305 test passed!
|
||||
ChaCha20-Poly1305 AEAD test passed!
|
||||
AES test passed!
|
||||
AES192 test passed!
|
||||
AES256 test passed!
|
||||
AES-GCM test passed!
|
||||
RANDOM test passed!
|
||||
ECC test passed!
|
||||
ECC buffer test passed!
|
||||
CURVE25519 test passed!
|
||||
ED25519 test passed!
|
||||
logging test passed!
|
||||
mutex test passed!
|
||||
Test complete
|
||||
```
|
||||
### `benchmark_test()`
|
||||
|
||||
benchmark_test() prints a message on the target console similar to the following output.
|
||||
|
||||
TARGET=sifive-hifive1-revb:
|
||||
|
||||
```
|
||||
SiFive HiFive1 Demo
|
||||
Setting clock to 320MHz
|
||||
Actual Clock 320MHz
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
wolfSSL version 4.0.0
|
||||
------------------------------------------------------------------------------
|
||||
wolfCrypt Benchmark (block bytes 1024, min 1.0 sec each)
|
||||
RNG 250 KB took 1.098 seconds, 227.714 KB/s
|
||||
AES-128-CBC-enc 50 KB took 1.132 seconds, 44.175 KB/s
|
||||
AES-128-CBC-dec 50 KB took 1.142 seconds, 43.778 KB/s
|
||||
AES-192-CBC-enc 50 KB took 1.250 seconds, 40.007 KB/s
|
||||
AES-192-CBC-dec 50 KB took 1.260 seconds, 39.677 KB/s
|
||||
AES-256-CBC-enc 50 KB took 1.368 seconds, 36.552 KB/s
|
||||
AES-256-CBC-dec 50 KB took 1.378 seconds, 36.279 KB/s
|
||||
AES-128-GCM-enc 25 KB took 1.225 seconds, 20.412 KB/s
|
||||
AES-128-GCM-dec 25 KB took 1.225 seconds, 20.402 KB/s
|
||||
AES-192-GCM-enc 25 KB took 1.290 seconds, 19.373 KB/s
|
||||
AES-192-GCM-dec 25 KB took 1.291 seconds, 19.366 KB/s
|
||||
AES-256-GCM-enc 25 KB took 1.352 seconds, 18.487 KB/s
|
||||
AES-256-GCM-dec 25 KB took 1.353 seconds, 18.478 KB/s
|
||||
CHACHA 1 MB took 1.006 seconds, 1.020 MB/s
|
||||
CHA-POLY 700 KB took 1.032 seconds, 678.045 KB/s
|
||||
POLY1305 2 MB took 1.007 seconds, 2.255 MB/s
|
||||
SHA 2 MB took 1.002 seconds, 1.511 MB/s
|
||||
SHA-256 525 KB took 1.011 seconds, 519.279 KB/s
|
||||
SHA-512 275 KB took 1.017 seconds, 270.477 KB/s
|
||||
HMAC-SHA 1 MB took 1.013 seconds, 1.399 MB/s
|
||||
HMAC-SHA256 525 KB took 1.019 seconds, 515.020 KB/s
|
||||
HMAC-SHA512 275 KB took 1.032 seconds, 266.351 KB/s
|
||||
ECC 256 key gen 2 ops took 1.104 sec, avg 551.834 ms, 1.812 ops/sec
|
||||
ECDHE 256 agree 2 ops took 1.101 sec, avg 550.400 ms, 1.817 ops/sec
|
||||
ECDSA 256 sign 2 ops took 1.173 sec, avg 586.502 ms, 1.705 ops/sec
|
||||
ECDSA 256 verify 2 ops took 2.153 sec, avg 1076.294 ms, 0.929 ops/sec
|
||||
CURVE 25519 key gen 2 ops took 1.629 sec, avg 814.423 ms, 1.228 ops/sec
|
||||
CURVE 25519 agree 2 ops took 1.626 sec, avg 813.156 ms, 1.230 ops/sec
|
||||
ED 25519 key gen 1 ops took 1.436 sec, avg 1436.096 ms, 0.696 ops/sec
|
||||
ED 25519 sign 2 ops took 2.913 sec, avg 1456.421 ms, 0.687 ops/sec
|
||||
ED 25519 verify 2 ops took 5.012 sec, avg 2506.012 ms, 0.399 ops/sec
|
||||
Benchmark complete
|
||||
```
|
||||
|
||||
## Tested Configurations
|
||||
- P-RNG (NIST DRBG) with SHA-256
|
||||
- SHA 1/256/512
|
||||
- AES 128/192/256 CBC/GCM
|
||||
- ECC 256 sign/verify/shared secret with fast math or Single Precision (SP) library
|
||||
- ED25519/Curve25519
|
||||
- HMAC
|
||||
- ChaCha20/Poly1305
|
||||
|
||||
## Known Caveats
|
||||
- If you find the wolfcrypt test stuck on early_trap_vector error, it is like related to memory issues
|
||||
- Using the `__stack_size` default value of 0x400 will not be enough for the ECC test to pass.
|
||||
The `IDE/ECLIPSE/SIFIVE/Makefile` overwrites the value with 0x1000 (4 KBytes)
|
||||
- Enabling RSA will cause the ECC test to fail due to memory shortage.
|
||||
|
||||
## References
|
||||
|
||||
The test results were collected from a SiFive reference platform target with the following hardware, software and tool chains:
|
||||
- HiFive1 Rev A/Rev B: HiFive1 Development Board with the Freedom Everywhere SoC, E300
|
||||
- freedom-e-sdk
|
||||
- wolfssl [latest version](https://github.com/wolfSSL/wolfssl)
|
||||
|
||||
For more information or questions, please email [support@wolfssl.com](mailto:support@wolfssl.com)
|
||||
|
||||
@@ -3,4 +3,7 @@
|
||||
# All paths should be given relative to the root
|
||||
|
||||
EXTRA_DIST += \
|
||||
IDE/ECLIPSE/SIFIVE/README.md
|
||||
IDE/ECLIPSE/SIFIVE/README.md \
|
||||
IDE/ECLIPSE/SIFIVE/main.c \
|
||||
IDE/ECLIPSE/SIFIVE/Makefile\
|
||||
IDE/ECLIPSE/SIFIVE/user_settings.h
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* main.c
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -143,12 +143,12 @@ int main(void)
|
||||
#ifdef USE_CLOCK_HZ
|
||||
/* Speed up clock */
|
||||
printf("SiFive HiFive1 Demo\n");
|
||||
printf("Setting clock to %dMHz\n", (int)(USE_CLOCK_HZ/1000000));
|
||||
printf("Setting clock to %dMHz\n", USE_CLOCK_HZ/1000000);
|
||||
clk_Hz = metal_clock_set_rate_hz(
|
||||
&__METAL_DT_SIFIVE_FE310_G000_PLL_HANDLE->clock, USE_CLOCK_HZ
|
||||
);
|
||||
#endif
|
||||
printf("Actual Clock %dMHz\n", (int)(clk_Hz/1000000));
|
||||
printf("Actual Clock %dMHz\n", clk_Hz/1000000);
|
||||
|
||||
/* Reconfigure the SPI Bus for dual mode */
|
||||
#define QSPI0_CTRL 0x10014000UL
|
||||
@@ -1,6 +1,6 @@
|
||||
/* user_settings.h
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -558,6 +558,12 @@ extern "C" {
|
||||
#undef NO_OLD_TLS
|
||||
#define NO_OLD_TLS
|
||||
|
||||
#undef NO_HC128
|
||||
#define NO_HC128
|
||||
|
||||
#undef NO_RABBIT
|
||||
#define NO_RABBIT
|
||||
|
||||
#undef NO_PSK
|
||||
#define NO_PSK
|
||||
|
||||
@@ -1,37 +1,30 @@
|
||||
# ESP-IDF port
|
||||
|
||||
NOTICE: These Espressif examples have been created and tested with the latest stable release branch of
|
||||
[ESP-IDF V4](https://docs.espressif.com/projects/esp-idf/en/v4.4.1/esp32/get-started/index.html)
|
||||
and have not yet been upgraded to the master branch V5.
|
||||
See the latest [migration guides](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/migration-guides/index.html).
|
||||
|
||||
## Overview
|
||||
ESP-IDF development framework with wolfSSL by setting *WOLFSSL_ESPIDF* definition
|
||||
|
||||
Including the following examples:
|
||||
|
||||
* Simple [TLS client](./examples/wolfssl_client/)/[server](./examples/wolfssl_server/)
|
||||
* Cryptographic [test](./examples/wolfssl_test/)
|
||||
* Cryptographic [benchmark](./examples/wolfssl_benchmark/)
|
||||
* simple tls_client/server
|
||||
* crypt test
|
||||
* crypt benchmark
|
||||
|
||||
The *user_settings.h* file enables some of the hardened settings.
|
||||
|
||||
## Requirements
|
||||
1. [ESP-IDF development framework](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/)
|
||||
1. ESP-IDF development framework
|
||||
[https://docs.espressif.com/projects/esp-idf/en/latest/get-started/]
|
||||
|
||||
## Setup for Linux
|
||||
1. Run `setup.sh` at _/path/to_`/wolfssl/IDE/Espressif/ESP-IDF/` to deploy files into ESP-IDF tree
|
||||
2. Find Wolfssl files at _/path/to/esp_`/esp-idf/components/wolfssl/`
|
||||
3. Find [Example programs](https://github.com/wolfSSL/wolfssl/tree/master/IDE/Espressif/ESP-IDF/examples) under _/path/to/esp_`/esp-idf/examples/protocols/wolfssl_xxx` (where xxx is the project name)
|
||||
Note: This expects to use Linux version.
|
||||
|
||||
## Setup for Windows
|
||||
1. Run ESP-IDF Command Prompt (cmd.exe) or Run ESP-IDF PowerShell Environment
|
||||
2. Run `setup_win.bat` at `.\IDE\Espressif\ESP-IDF\`
|
||||
3. Find Wolfssl files at _/path/to/esp_`/esp-idf/components/wolfssl/`
|
||||
4. Find [Example programs](https://github.com/wolfSSL/wolfssl/tree/master/IDE/Espressif/ESP-IDF/examples) under _/path/to/esp_`/esp-idf/examples/protocols/wolfssl_xxx` (where xxx is the project name)
|
||||
## Setup
|
||||
1. Run *setup.sh* to deploy files into ESP-IDF tree
|
||||
2. Find Wolfssl files at /path/to/esp-idf/components/wolfssl/
|
||||
3. Find Example programs under /path/to/esp-idf/examples/protocols/wolfssl_xxx
|
||||
4. Uncomment out #define WOLFSSL_ESPIDF in /path/to/wolfssl/wolfssl/wolfcrypt/settings.h
|
||||
Uncomment out #define WOLFSSL_ESPWROOM32 in /path/to/wolfssl/wolfssl/wolfcrypt/settings.h
|
||||
|
||||
## Configuration
|
||||
1. The `user_settings.h` can be found in _/path/to/esp_`/esp-idf/components/wolfssl/include/user_settings.h`
|
||||
1. The *user_settings.h* can be found in /path/to/esp-idf/components/wolfssl/include/user_settings.h
|
||||
|
||||
## Build examples
|
||||
1. See README in each example folder
|
||||
@@ -39,7 +32,4 @@ Including the following examples:
|
||||
## Support
|
||||
For question please email [support@wolfssl.com]
|
||||
|
||||
Note: This is tested with :
|
||||
- OS: Ubuntu 20.04.3 LTS and Microsoft Windows 10 Pro 10.0.19041 and well as WSL Ubuntu
|
||||
- ESP-IDF: ESP-IDF v4.3.2
|
||||
- Module : ESP32-WROOM-32
|
||||
Note: This is tested with "Ubuntu 18.04.1 LTS" and ESP32-WROOM-32.
|
||||
|
||||
@@ -1,31 +1,35 @@
|
||||
# DEMO program with ATECC608A on ESP-WROOM-32SE
|
||||
## Overview
|
||||
Running demo programs with ATECC608A on 32SE by setting `WOLFSSL_ESPWROOM32SE` definition
|
||||
Running demo programs with ATECC608A on 32SE by setting *WOLFSSL_ESPWROOM32SE* definition
|
||||
|
||||
Including the following examples:
|
||||
|
||||
* simple `TLS client`/`server`
|
||||
* simple tls_client/tls_server
|
||||
* crypt benchmark
|
||||
|
||||
The `user_settings.h` file enables some of the hardened settings.
|
||||
|
||||
The *user_settings.h* file enables some of the hardened settings.
|
||||
|
||||
## Requirements
|
||||
1. ESP-IDF development framework: https://docs.espressif.com/projects/esp-idf/en/latest/get-started/
|
||||
|
||||
2. Microchip CryptoAuthentication Library: https://github.com/MicrochipTech/cryptoauthlib
|
||||
1. ESP-IDF development framework
|
||||
[https://docs.espressif.com/projects/esp-idf/en/latest/get-started/]
|
||||
|
||||
2. Microchip CryptoAuthentication Library
|
||||
[https://github.com/MicrochipTech/cryptoauthlib]
|
||||
|
||||
## Setup
|
||||
1. Comment out `#define WOLFSSL_ESPWROOM32` in `/path/to/wolfssl/IDE/Espressif/ESP-IDF/user_settings.h`\
|
||||
Uncomment out `#define WOLFSSL_ESPWROOM32SE` in `/path/to/wolfssl/IDE/Espressif/ESP-IDF/user_settings.h`
|
||||
* **Note:** crypt test will fail if enabled `WOLFSSL_ESPWROOM32SE`
|
||||
3. wolfSSL under ESP-IDF. Please see [README.md](https://github.com/wolfSSL/wolfssl/blob/master/IDE/Espressif/ESP-IDF/README.md)
|
||||
4. CryptoAuthentication Library under ESP-IDF. Please see [README.md](https://github.com/miyazakh/cryptoauthlib_esp_idf/blob/master/README.md)
|
||||
|
||||
1. wolfSSL under ESP-IDF. Please see [README.md](https://github.com/wolfSSL/wolfssl/blob/master/IDE/Espressif/ESP-IDF/README.md)
|
||||
2. CryptoAuthentication Library under ESP-IDF. Please see [README.md](https://github.com/miyazakh/cryptoauthlib_esp_idf/blob/master/README.md)
|
||||
|
||||
3. Uncomment out #define WOLFSSL_ESPWROOM32SE in /path/to/wolfssl/wolfssl/wolfcrypt/settings.h
|
||||
|
||||
Note : Need to enable WOLFSSL_ESPIDF
|
||||
Note : crypt test will fail if enabled WOLFSSL_ESPWROOM32SE
|
||||
|
||||
## Configuration
|
||||
1. The `user_settings.h` can be found in `/path/to/esp-idf/components/wolfssl/include/user_settings.h`
|
||||
1. The *user_settings.h* can be found in /path/to/esp-idf/components/wolfssl/include/user_settings.h
|
||||
|
||||
## Build examples
|
||||
1. See `README` in each example folder
|
||||
1. See README in each example folder
|
||||
|
||||
## Benchmark
|
||||
w/o atecc608a
|
||||
@@ -44,11 +48,11 @@ ECDSA 256 verify 14 ops took 1.079 sec, avg 77.071 ms, 12.975 ops/sec
|
||||
```
|
||||
|
||||
## Support
|
||||
For question please email [support@wolfssl.com](mailto:support@wolfssl.com)
|
||||
For question please email [support@wolfssl.com]
|
||||
|
||||
Note: This is tested with the following condition:
|
||||
|
||||
- Model : ESP32-WROOM-32SE
|
||||
- ESP-IDF : v3.3-beta1-39-g6cb37ecc5(commit hash : 6cb37ecc5)
|
||||
Note: This is tested with the following condition:
|
||||
|
||||
- Model : ESP32-WROOM-32SE
|
||||
- ESP-IDF : v3.3-beta1-39-g6cb37ecc5(commit hash : 6cb37ecc5)
|
||||
- CryptAuthLib: commit hash : c6b176e
|
||||
- OS : Ubuntu 18.04.1 LTS (Bionic Beaver)
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
/* config.h - dummy
|
||||
*
|
||||
* Copyright (C) 2006-2022 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 _CONFIG_H_
|
||||
#define _CONFIG_H_
|
||||
#endif
|
||||
@@ -1,25 +0,0 @@
|
||||
/* wolfcrypt/test/test_paths.h
|
||||
*
|
||||
* Copyright (C) 2006-2022 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 NO_FILESYSTEM
|
||||
#define CERT_PREFIX "@abs_top_srcdir@/"
|
||||
#define CERT_WRITE_TEMP_DIR "@abs_top_builddir@/"
|
||||
#endif /* NO_FILESYSTEM */
|
||||
@@ -1,8 +1,8 @@
|
||||
# wolfSSL Benchmark Example
|
||||
#wolfSSL Example
|
||||
|
||||
The Example contains of wolfSSL benchmark program.
|
||||
|
||||
1. `idf.py menuconfig` to configure the program.
|
||||
1. "make menuconfig" to configure the program.
|
||||
1-1. Example Configuration ->
|
||||
|
||||
BENCH_ARG : argument that you want to use. Default is "-lng 0"
|
||||
@@ -10,7 +10,7 @@ The Example contains of wolfSSL benchmark program.
|
||||
|
||||
When you want to run the benchmark program
|
||||
|
||||
1. `idf.py -p <PORT> flash` to compile and load the firmware
|
||||
2. `idf.py monitor` to see the message
|
||||
1. "make flash" to compile and load the firmware
|
||||
2. "make monitor" to see the message
|
||||
|
||||
See the README.md file in the upper level 'examples' directory for more information about examples.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* helper.c
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
#include <wolfssl/wolfcrypt/types.h>
|
||||
#include <wolfcrypt/benchmark/benchmark.h>
|
||||
|
||||
#include "sdkconfig.h"
|
||||
@@ -33,7 +32,6 @@
|
||||
|
||||
/* proto-type */
|
||||
extern void wolf_benchmark_task();
|
||||
extern void wolf_crypt_task();
|
||||
static const char* const TAG = "wolfbenchmark";
|
||||
char* __argv[22];
|
||||
|
||||
@@ -120,7 +118,7 @@ int construct_argv()
|
||||
|
||||
__argv[cnt] = malloc(10);
|
||||
sprintf(__argv[cnt], "benchmark");
|
||||
__argv[cnt][9] = '\0';
|
||||
__argv[9] = '\0';
|
||||
cnt = 1;
|
||||
|
||||
while (*ch != '\0')
|
||||
@@ -152,7 +150,7 @@ int construct_argv()
|
||||
/* entry point */
|
||||
void app_main(void)
|
||||
{
|
||||
(void) TAG;
|
||||
#ifndef NO_CRYPT_BENCHMARK
|
||||
|
||||
/* when using atecc608a on esp32-wroom-32se */
|
||||
#if defined(WOLFSSL_ESPWROOM32SE) && defined(HAVE_PK_CALLBACKS) \
|
||||
@@ -167,11 +165,7 @@ void app_main(void)
|
||||
atmel_set_slot_allocator(my_atmel_alloc, my_atmel_free);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef NO_CRYPT_TEST
|
||||
wolf_crypt_task();
|
||||
#endif
|
||||
#ifndef NO_CRYPT_BENCHMARK
|
||||
wolf_benchmark_task();
|
||||
#endif
|
||||
#else
|
||||
#endif /* NO_CRYPT_BENCHMARK */
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
CONFIG_BENCH_ARGV="-lng 0"
|
||||
CONFIG_MAIN_TASK_STACK_SIZE=7500
|
||||
CONFIG_MAIN_TASK_STACK_SIZE=7000
|
||||
CONFIG_FREERTOS_HZ=1000
|
||||
CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
|
||||
|
||||
@@ -2,10 +2,5 @@
|
||||
# CMakeLists in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
# (Not part of the boilerplate)
|
||||
# This example uses an extra component for common functions such as Wi-Fi and Ethernet connection.
|
||||
# disable the following line if there isn't the directory
|
||||
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(wolfssl_client)
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
PROJECT_NAME := wolfssl_client
|
||||
|
||||
CFLAGS += -DWOLFSSL_USER_SETTINGS
|
||||
# if there isn't the directory, please disable the line below.
|
||||
EXTRA_COMPONENT_DIRS = $(IDF_PATH)/examples/common_components/protocol_examples_common
|
||||
|
||||
include $(IDF_PATH)/make/project.mk
|
||||
|
||||
|
||||
@@ -2,26 +2,21 @@
|
||||
|
||||
The Example contains of wolfSSL tls client demo.
|
||||
|
||||
1. `idf.py menuconfig` to config the project
|
||||
1. "make menuconfig" to config the project
|
||||
1-1. Example Configuration ->
|
||||
|
||||
1-1. Example Configuration ->
|
||||
|
||||
Target host ip address : the host that you want to connect to.(default is 127.0.0.1)
|
||||
|
||||
1-2. Example Connection Configuration ->
|
||||
|
||||
WIFI SSID: your own WIFI, which is connected to the Internet.(default is "myssid")
|
||||
WIFI Password: WIFI password, and default is "mypassword"
|
||||
|
||||
WIFI Password: WIFI password, and default is "mypassword"
|
||||
Target host ip address : the host that you want to connect to.(default is 127.0.0.1)
|
||||
|
||||
Note: the example program uses 11111 port. If you want to use different port
|
||||
, you need to modify DEFAULT_PORT definition in the code.
|
||||
|
||||
When you want to test the wolfSSL client
|
||||
|
||||
1. `idf.py -p <PORT> flash` and then `idf.py monitor` to load the firmware and see the context
|
||||
1. "make flash monitor" to load the firmware and see the context
|
||||
2. You can use <wolfssl>/examples/server/server program for test.
|
||||
|
||||
e.g. Launch ./examples/server/server -v 4 -b -i -d
|
||||
e.g. Launch ./examples/server/server -v 4 -b -i
|
||||
|
||||
See the README.md file in the upper level 'examples' directory for more information about examples.
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
menu "Example Configuration"
|
||||
|
||||
config WIFI_SSID
|
||||
string "WiFi SSID"
|
||||
default "myssid"
|
||||
help
|
||||
SSID (network name) for the example to connect to.
|
||||
|
||||
config WIFI_PASSWORD
|
||||
string "WiFi Password"
|
||||
default "mypassword"
|
||||
help
|
||||
WiFi password (WPA or WPA2) for the example to use.
|
||||
|
||||
config TARGET_HOST
|
||||
string "Target host"
|
||||
default "127.0.01.1"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* client-tls-callback.c
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -131,7 +131,6 @@ void tls_smp_client_task()
|
||||
size_t len;
|
||||
struct hostent *hp;
|
||||
struct ip4_addr *ip4_addr;
|
||||
const char sndMsg[] = "GET /index.html HTTP/1.0\r\n\r\n";
|
||||
|
||||
/* declare wolfSSL objects */
|
||||
WOLFSSL_CTX *ctx;
|
||||
@@ -258,8 +257,8 @@ void tls_smp_client_task()
|
||||
|
||||
if(sendGet){
|
||||
printf("SSL connect ok, sending GET...\n");
|
||||
len = XSTRLEN(sndMsg);
|
||||
strncpy(buff, sndMsg, len);
|
||||
len = 28;
|
||||
strncpy(buff, "GET /index.html HTTP/1.0\r\n\r\n", 28);
|
||||
buff[len] = '\0';
|
||||
} else {
|
||||
sprintf(buff, "message from esp32 tls client\n");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* user_settings.h
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -21,14 +21,9 @@
|
||||
#ifndef _TLS_WIFI_H_
|
||||
#define _TLS_WIFI_H_
|
||||
|
||||
#include "esp_idf_version.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_wifi.h"
|
||||
#if ESP_IDF_VERSION_MAJOR >= 4
|
||||
#include "esp_event.h"
|
||||
#else
|
||||
#include "esp_event_loop.h"
|
||||
#endif
|
||||
|
||||
#define DEFAULT_PORT 11111
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* wifi_connect.c
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -27,9 +27,6 @@
|
||||
#include "lwip/netdb.h"
|
||||
#include "lwip/apps/sntp.h"
|
||||
#include "nvs_flash.h"
|
||||
#if ESP_IDF_VERSION_MAJOR >= 4
|
||||
#include "protocol_examples_common.h"
|
||||
#endif
|
||||
|
||||
const static int CONNECTED_BIT = BIT0;
|
||||
static EventGroupHandle_t wifi_event_group;
|
||||
@@ -51,14 +48,12 @@ static void set_time()
|
||||
time_t now;
|
||||
struct tm timeinfo;
|
||||
char strftime_buf[64];
|
||||
/* please update the time if seeing unknown failure when loading cert. */
|
||||
/* this could cause TLS communication failure due to time expiration */
|
||||
/* incleasing 31536000 seconds is close to spend 356 days. */
|
||||
utctime.tv_sec = 1645797600; /* dummy time: Fri 25 Feb 2022 02:00:00 2022 */
|
||||
|
||||
utctime.tv_sec = 1542008020; /* dummy time: Mon Nov 12 07:33:40 2018 */
|
||||
utctime.tv_usec = 0;
|
||||
tz.tz_minuteswest = 0;
|
||||
tz.tz_dsttime = 0;
|
||||
|
||||
|
||||
settimeofday(&utctime, &tz);
|
||||
|
||||
time(&now);
|
||||
@@ -67,11 +62,9 @@ static void set_time()
|
||||
strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo);
|
||||
ESP_LOGI(TAG, "The current date/time is: %s", strftime_buf);
|
||||
|
||||
#if ESP_IDF_VERSION_MAJOR < 4
|
||||
/* wait until wifi connect */
|
||||
xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT,
|
||||
false, true, portMAX_DELAY);
|
||||
#endif
|
||||
/* now we start client tasks. */
|
||||
tls_smp_client_init();
|
||||
}
|
||||
@@ -93,7 +86,7 @@ static void tls_smp_client_init(void)
|
||||
ESP_LOGI(TAG, "create thread %s failed", TLS_SMP_CLIENT_TASK_NAME);
|
||||
}
|
||||
}
|
||||
/* event handler for wifi events */
|
||||
/* event hander for wifi events */
|
||||
static esp_err_t wifi_event_handler(void *ctx, system_event_t *event)
|
||||
{
|
||||
switch (event->event_id)
|
||||
@@ -102,13 +95,8 @@ static esp_err_t wifi_event_handler(void *ctx, system_event_t *event)
|
||||
esp_wifi_connect();
|
||||
break;
|
||||
case SYSTEM_EVENT_STA_GOT_IP:
|
||||
#if ESP_IDF_VERSION_MAJOR >= 4
|
||||
ESP_LOGI(TAG, "got ip:" IPSTR "\n",
|
||||
IP2STR(&event->event_info.got_ip.ip_info.ip));
|
||||
#else
|
||||
ESP_LOGI(TAG, "got ip:%s",
|
||||
ip4addr_ntoa(&event->event_info.got_ip.ip_info.ip));
|
||||
#endif
|
||||
/* http://esp32.info/docs/esp_idf/html/dd/d08/group__xEventGroupSetBits.html */
|
||||
xEventGroupSetBits(wifi_event_group, CONNECTED_BIT);
|
||||
break;
|
||||
@@ -128,23 +116,10 @@ void app_main(void)
|
||||
ESP_ERROR_CHECK(nvs_flash_init());
|
||||
|
||||
ESP_LOGI(TAG, "Initialize wifi");
|
||||
#if (ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1) || \
|
||||
(ESP_IDF_VERSION_MAJOR > 5)
|
||||
esp_netif_init();
|
||||
#else
|
||||
/* TCP/IP adapter initialization */
|
||||
tcpip_adapter_init();
|
||||
#endif
|
||||
|
||||
/* */
|
||||
#if ESP_IDF_VERSION_MAJOR >= 4
|
||||
(void) wifi_event_handler;
|
||||
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
||||
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
|
||||
* Read "Establishing Wi-Fi or Ethernet Connection" section in
|
||||
* examples/protocols/README.md for more information about this function.
|
||||
*/
|
||||
ESP_ERROR_CHECK(example_connect());
|
||||
#else
|
||||
wifi_event_group = xEventGroupCreate();
|
||||
ESP_ERROR_CHECK(esp_event_loop_init(wifi_event_handler, NULL));
|
||||
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
|
||||
@@ -166,7 +141,6 @@ void app_main(void)
|
||||
ESP_LOGI(TAG, "wifi_init_sta finished.");
|
||||
ESP_LOGI(TAG, "connect to ap SSID:%s password:%s",
|
||||
TLS_SMP_WIFI_SSID, TLS_SMP_WIFI_PASS);
|
||||
#endif
|
||||
ESP_LOGI(TAG, "Set dummy time...");
|
||||
set_time();
|
||||
}
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
# CMakeLists in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
# (Not part of the boilerplate)
|
||||
# This example uses an extra component for common functions such as Wi-Fi and Ethernet connection.
|
||||
# disable the following line if there isn't the directory
|
||||
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(wolfssl_server)
|
||||
|
||||
@@ -7,8 +7,5 @@ PROJECT_NAME := tls_server
|
||||
|
||||
CFLAGS += -DWOLFSSL_USER_SETTINGS
|
||||
|
||||
# if there isn't the directory, please disable the line below.
|
||||
EXTRA_COMPONENT_DIRS = $(IDF_PATH)/examples/common_components/protocol_examples_common
|
||||
|
||||
include $(IDF_PATH)/make/project.mk
|
||||
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
# wolfSSL Server Example
|
||||
#wolfSSL Example
|
||||
|
||||
The Example contains a wolfSSL simple server.
|
||||
|
||||
1. `idf.py menuconfigure` to configure the project
|
||||
1. "make menuconfigure" to configure the project
|
||||
|
||||
1-1. Example Connection Configuration ->
|
||||
|
||||
1-1. Example Configuration ->
|
||||
WIFI SSID : your own WIFI, which is connected to the Internet.(default is "myssid")
|
||||
WIFI Password : WIFI password, and default is "mypassword"
|
||||
|
||||
When you want to test the wolfSSL simple server demo
|
||||
|
||||
1. `idf.py -p <PORT> flash` to compile the code and load the firmware
|
||||
2. `idf.py monitor` to see the context. The assigned IP address can be found in output message.
|
||||
1. "make flash" to compile the code and load the firmware
|
||||
2. "make monitor" to see the context. The assigned IP address can be found in output message.
|
||||
3. Once the server connects to the wifi, it is waiting for client request.
|
||||
("Waiting for a connection..." message will be displayed.)
|
||||
|
||||
@@ -20,3 +19,4 @@ When you want to test the wolfSSL simple server demo
|
||||
e.g ./example/client/client -h xx.xx.xx
|
||||
|
||||
See the README.md file in the upper level 'examples' directory for more information about examples.
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
menu "Example Configuration"
|
||||
|
||||
config WIFI_SSID
|
||||
string "WiFi SSID"
|
||||
default "myssid"
|
||||
help
|
||||
SSID (network name) for the example to connect to.
|
||||
|
||||
config WIFI_PASSWORD
|
||||
string "WiFi Password"
|
||||
default "mypassword"
|
||||
help
|
||||
WiFi password (WPA or WPA2) for the example to use.
|
||||
|
||||
endmenu
|
||||
@@ -1,6 +1,6 @@
|
||||
/* wifi_connect.h
|
||||
/* wifi_connect.h
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -21,14 +21,9 @@
|
||||
#ifndef _TLS_WIFI_H_
|
||||
#define _TLS_WIFI_H_
|
||||
|
||||
#include "esp_idf_version.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_wifi.h"
|
||||
#if ESP_IDF_VERSION_MAJOR >= 4
|
||||
#include "esp_event.h"
|
||||
#else
|
||||
#include "esp_event_loop.h"
|
||||
#endif
|
||||
|
||||
#define DEFAULT_PORT 11111
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* server-tls-callback.c
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -64,7 +64,7 @@ static void ShowCiphers(void)
|
||||
#include "wolfssl/wolfcrypt/port/atmel/atmel.h"
|
||||
|
||||
/* when you want to use a custom slot allocation */
|
||||
/* enable the definition CUSTOM_SLOT_ALLOCATION. */
|
||||
/* enable the difinition CUSTOM_SLOT_ALLOCATION. */
|
||||
|
||||
#if defined(CUSTOM_SLOT_ALLOCATION)
|
||||
|
||||
@@ -133,7 +133,6 @@ void tls_smp_server_task()
|
||||
size_t len;
|
||||
int shutdown = 0;
|
||||
int ret;
|
||||
const char msg[] = "I hear you fa shizzle!";
|
||||
|
||||
/* declare wolfSSL objects */
|
||||
WOLFSSL_CTX* ctx;
|
||||
@@ -246,7 +245,7 @@ void tls_smp_server_task()
|
||||
}
|
||||
/* Write our reply into buff */
|
||||
memset(buff, 0, sizeof(buff));
|
||||
memcpy(buff, msg, sizeof(msg));
|
||||
memcpy(buff, "I hear ya fa shizzle!", sizeof(buff));
|
||||
len = strnlen(buff, sizeof(buff));
|
||||
/* Reply back to the client */
|
||||
if (wolfSSL_write(ssl, buff, len) != len) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* wifi_connect.c
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -27,15 +27,12 @@
|
||||
#include "lwip/netdb.h"
|
||||
#include "lwip/apps/sntp.h"
|
||||
#include "nvs_flash.h"
|
||||
#if ESP_IDF_VERSION_MAJOR >= 4
|
||||
#include "protocol_examples_common.h"
|
||||
#endif
|
||||
|
||||
const static int CONNECTED_BIT = BIT0;
|
||||
static EventGroupHandle_t wifi_event_group;
|
||||
/* prefix for logging */
|
||||
const static char *TAG = "tls_server";
|
||||
/* proto-type definition */
|
||||
/* proto-type difinition */
|
||||
extern void tls_smp_server_task();
|
||||
static void tls_smp_server_init();
|
||||
|
||||
@@ -48,10 +45,8 @@ static void set_time()
|
||||
time_t now;
|
||||
struct tm timeinfo;
|
||||
char strftime_buf[64];
|
||||
/* please update the time if seeing unknown failure when loading cert. */
|
||||
/* this could cause TLS communication failure due to time expiration */
|
||||
/* incleasing 31536000 seconds is close to spend 356 days. */
|
||||
utctime.tv_sec = 1645797600; /* dummy time: Fri 25 Feb 2022 02:00:00 2022 */
|
||||
|
||||
utctime.tv_sec = 1542008020; /* dummy time: Mon Nov 12 07:33:40 2018 */
|
||||
utctime.tv_usec = 0;
|
||||
tz.tz_minuteswest = 0;
|
||||
tz.tz_dsttime = 0;
|
||||
@@ -64,11 +59,9 @@ static void set_time()
|
||||
strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo);
|
||||
ESP_LOGI(TAG, "The current date/time is: %s", strftime_buf);
|
||||
|
||||
#if ESP_IDF_VERSION_MAJOR < 4
|
||||
/* wait until wifi connect */
|
||||
xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT,
|
||||
false, true, portMAX_DELAY);
|
||||
#endif
|
||||
/* now we start client tasks. */
|
||||
tls_smp_server_init();
|
||||
}
|
||||
@@ -90,7 +83,7 @@ static void tls_smp_server_init(void)
|
||||
ESP_LOGI(TAG, "create thread %s failed", TLS_SMP_SERVER_TASK_NAME);
|
||||
}
|
||||
}
|
||||
/* event handler for wifi events */
|
||||
/* event hander for wifi events */
|
||||
static esp_err_t wifi_event_handler(void *ctx, system_event_t *event)
|
||||
{
|
||||
switch (event->event_id)
|
||||
@@ -99,13 +92,8 @@ static esp_err_t wifi_event_handler(void *ctx, system_event_t *event)
|
||||
esp_wifi_connect();
|
||||
break;
|
||||
case SYSTEM_EVENT_STA_GOT_IP:
|
||||
#if ESP_IDF_VERSION_MAJOR >= 4
|
||||
ESP_LOGI(TAG, "got ip:" IPSTR "\n",
|
||||
IP2STR(&event->event_info.got_ip.ip_info.ip));
|
||||
#else
|
||||
ESP_LOGI(TAG, "got ip:%s",
|
||||
ip4addr_ntoa(&event->event_info.got_ip.ip_info.ip));
|
||||
#endif
|
||||
/* http://esp32.info/docs/esp_idf/html/dd/d08/group__xEventGroupSetBits.html */
|
||||
xEventGroupSetBits(wifi_event_group, CONNECTED_BIT);
|
||||
break;
|
||||
@@ -126,22 +114,9 @@ void app_main(void)
|
||||
|
||||
ESP_LOGI(TAG, "Initialize wifi");
|
||||
/* TCP/IP adapter initialization */
|
||||
#if (ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1) || \
|
||||
(ESP_IDF_VERSION_MAJOR > 5)
|
||||
esp_netif_init();
|
||||
#else
|
||||
tcpip_adapter_init();
|
||||
#endif
|
||||
|
||||
/* */
|
||||
#if ESP_IDF_VERSION_MAJOR >= 4
|
||||
(void) wifi_event_handler;
|
||||
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
||||
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
|
||||
* Read "Establishing Wi-Fi or Ethernet Connection" section in
|
||||
* examples/protocols/README.md for more information about this function.
|
||||
*/
|
||||
ESP_ERROR_CHECK(example_connect());
|
||||
#else
|
||||
wifi_event_group = xEventGroupCreate();
|
||||
ESP_ERROR_CHECK(esp_event_loop_init(wifi_event_handler, NULL));
|
||||
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
|
||||
@@ -163,7 +138,6 @@ void app_main(void)
|
||||
ESP_LOGI(TAG, "wifi_init_sta finished.");
|
||||
ESP_LOGI(TAG, "connect to ap SSID:%s password:%s",
|
||||
TLS_SMP_WIFI_SSID, TLS_SMP_WIFI_PASS);
|
||||
#endif
|
||||
ESP_LOGI(TAG, "Set dummy time...");
|
||||
ESP_LOGI(TAG, "Set Dummy time...");
|
||||
set_time();
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# wolfSSL Crypt Test Example
|
||||
#wolfSSL Example
|
||||
|
||||
The Example contains of wolfSSL test program.
|
||||
|
||||
When you want to run the benchmark program
|
||||
1. `idf.py menuconfig` to configure the program,first
|
||||
2. `idf.py build` to compile and `idf.py -p <PORT> flash` to load the firmware
|
||||
3. `idf.py monitor` to see the message
|
||||
1. "make menuconfig" to configure the program,first
|
||||
2. "make flash" to compile and load the firmware
|
||||
3. "make monitor" to see the message
|
||||
|
||||
See the README.md file in the upper level 'examples' directory for more information about examples.
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
CONFIG_MAIN_TASK_STACK_SIZE=11000
|
||||
CONFIG_MAIN_TASK_STACK_SIZE=9000
|
||||
CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=
|
||||
|
||||
@@ -1,24 +1,6 @@
|
||||
#
|
||||
# Copyright (C) 2006-2022 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
|
||||
#
|
||||
# cmake for wolfssl
|
||||
#
|
||||
#
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS")
|
||||
|
||||
@@ -30,57 +12,26 @@ set(COMPONENT_SRCDIRS "./src/"
|
||||
"./wolfcrypt/src/"
|
||||
"./wolfcrypt/src/port/Espressif/"
|
||||
"./wolfcrypt/src/port/atmel/"
|
||||
# "$ENV{IDF_PATH}/components/soc/esp32s3/include/soc"
|
||||
)
|
||||
|
||||
set(COMPONENT_REQUIRES lwip)
|
||||
|
||||
|
||||
# RTOS_IDF_PATH is typically:
|
||||
# "/Users/{username}/Desktop/esp-idf/components/freertos/include/freertos"
|
||||
# depending on the environment, we may need to swap backslashes with forward slashes
|
||||
string(REPLACE "\\" "/" RTOS_IDF_PATH "$ENV{IDF_PATH}/components/freertos/include/freertos")
|
||||
# ESP-IDF after version 4.4x has a different RTOS directory structure
|
||||
string(REPLACE "\\" "/" RTOS_IDF_PATH5 "$ENV{IDF_PATH}/components/freertos/FreeRTOS-Kernel/include/freertos")
|
||||
|
||||
if(IS_DIRECTORY ${IDF_PATH}/components/freertos/FreeRTOS-Kernel/)
|
||||
set(COMPONENT_ADD_INCLUDEDIRS
|
||||
"."
|
||||
"./include"
|
||||
"${RTOS_IDF_PATH5}"
|
||||
"${WOLFSSL_ROOT}"
|
||||
)
|
||||
else()
|
||||
|
||||
set(COMPONENT_ADD_INCLUDEDIRS
|
||||
"."
|
||||
"./include"
|
||||
"${RTOS_IDF_PATH}"
|
||||
"${WOLFSSL_ROOT}"
|
||||
)
|
||||
endif()
|
||||
set(COMPONENT_ADD_INCLUDEDIRS
|
||||
"."
|
||||
"./include"
|
||||
"../freertos/include/freertos"
|
||||
"${WOLFSSL_ROOT}"
|
||||
)
|
||||
|
||||
if(IS_DIRECTORY ${IDF_PATH}/components/cryptoauthlib)
|
||||
list(APPEND COMPONENT_ADD_INCLUDEDIRS "../cryptoauthlib/lib")
|
||||
endif()
|
||||
|
||||
set(COMPONENT_SRCEXCLUDE
|
||||
"./src/bio.c"
|
||||
"./src/conf.c"
|
||||
"./src/misc.c"
|
||||
"./src/pk.c"
|
||||
"./src/x509.c"
|
||||
"./src/x509_str.c"
|
||||
"./wolfcrypt/src/evp.c"
|
||||
"./wolfcrypt/src/misc.c"
|
||||
"wolfcrypt/src/aes_asm.S"
|
||||
"wolfcrypt/src/evp.c"
|
||||
"wolfcrypt/src/misc.c"
|
||||
"src/bio.c"
|
||||
)
|
||||
|
||||
register_component()
|
||||
|
||||
# check to see if there's both a local copy and EDP-IDF copy of the wolfssl components
|
||||
if( EXISTS "${CMAKE_HOME_DIRECTORY}/components/wolfssl/" AND EXISTS "$ENV{IDF_PATH}/components/wolfssl/" )
|
||||
message(STATUS "")
|
||||
message(STATUS "WARNING: Found components/wolfssl in both local project and IDF_PATH")
|
||||
message(STATUS "")
|
||||
endif()
|
||||
# end multiple component check
|
||||
|
||||
@@ -1,38 +1,17 @@
|
||||
#
|
||||
# Copyright (C) 2006-2022 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
|
||||
#
|
||||
#
|
||||
# Component Makefile
|
||||
#
|
||||
|
||||
COMPONENT_ADD_INCLUDEDIRS := . ./include
|
||||
|
||||
COMPONENT_ADD_INCLUDEDIRS += "$ENV{IDF_PATH}/components/freertos/include/freertos"
|
||||
# COMPONENT_ADD_INCLUDEDIRS += "$ENV{IDF_PATH}/soc/esp32s3/include/soc"
|
||||
|
||||
COMPONENT_SRCDIRS := src wolfcrypt/src
|
||||
COMPONENT_SRCDIRS += wolfcrypt/src/port/Espressif
|
||||
COMPONENT_SRCDIRS += wolfcrypt/src/port/atmel
|
||||
|
||||
CFLAGS +=-DWOLFSSL_USER_SETTINGS
|
||||
|
||||
COMPONENT_OBJEXCLUDE := wolfcrypt/src/aes_asm.o
|
||||
COMPONENT_OBJEXCLUDE += wolfcrypt/src/evp.o
|
||||
COMPONENT_OBJEXCLUDE += wolfcrypt/src/misc.o
|
||||
COMPONENT_OBJEXCLUDE += src/bio.o
|
||||
#
|
||||
# Component Makefile
|
||||
#
|
||||
|
||||
COMPONENT_ADD_INCLUDEDIRS := . ./include
|
||||
COMPONENT_ADD_INCLUDEDIRS += ../freertos/include/freertos/
|
||||
|
||||
COMPONENT_SRCDIRS := src wolfcrypt/src
|
||||
COMPONENT_SRCDIRS += wolfcrypt/src/port/Espressif
|
||||
COMPONENT_SRCDIRS += wolfcrypt/src/port/atmel
|
||||
|
||||
CFLAGS +=-DWOLFSSL_USER_SETTINGS
|
||||
|
||||
COMPONENT_OBJEXCLUDE := wolfcrypt/src/aes_asm.o
|
||||
COMPONENT_OBJEXCLUDE += wolfcrypt/src/evp.o
|
||||
COMPONENT_OBJEXCLUDE += wolfcrypt/src/misc.o
|
||||
COMPONENT_OBJEXCLUDE += src/bio.o
|
||||
|
||||
@@ -22,20 +22,6 @@ BASEDIR=`cd ${BASEDIR} && pwd -P`
|
||||
WOLFSSLLIB_TRG_DIR=${IDF_PATH}/components/wolfssl
|
||||
WOLFSSLEXP_TRG_DIR=${IDF_PATH}/examples/protocols
|
||||
|
||||
if [ "$1" == "--verbose" ]; then
|
||||
WOLFSSL_SETUP_VERBOSE=true
|
||||
fi
|
||||
|
||||
if [ "${WOLFSSL_SETUP_VERBOSE}" == "true" ]; then
|
||||
echo Verbose mode on!
|
||||
echo BASEDIR=${BASEDIR}
|
||||
echo SCRIPTDIR=${SCRIPTDIR}
|
||||
echo WOLFSSL_ESPIDFDIR=${WOLFSSL_ESPIDFDIR}
|
||||
echo WOLFSSLLIB_TRG_DIR=${WOLFSSLLIB_TRG_DIR}
|
||||
echo WOLFSSLEXP_TRG_DIR=${WOLFSSLEXP_TRG_DIR}
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if [ ! -d $IDF_PATH ]; then
|
||||
echo "ESP-IDF Development Framework doesn't exist.: $IDF_PATH"
|
||||
exit 1
|
||||
@@ -45,12 +31,7 @@ fi
|
||||
pushd $IDF_PATH > /dev/null
|
||||
|
||||
echo "Copy files into $IDF_PATH"
|
||||
|
||||
# Remove/Create directories
|
||||
if [ "${WOLFSSL_SETUP_VERBOSE}" == "true" ]; then
|
||||
echo "Remove/Create directories..."
|
||||
fi
|
||||
|
||||
${RMDCMD} ${WOLFSSLLIB_TRG_DIR}/
|
||||
${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/
|
||||
|
||||
@@ -58,7 +39,6 @@ ${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/src
|
||||
${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/wolfcrypt
|
||||
${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/wolfcrypt/src
|
||||
${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/wolfssl
|
||||
${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/wolfssl/openssl
|
||||
${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/test
|
||||
${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/include
|
||||
|
||||
@@ -66,32 +46,18 @@ popd > /dev/null # $WOLFSSL_ESPIDFDIR
|
||||
pushd ${BASEDIR} > /dev/null # WOLFSSL TOP DIR
|
||||
|
||||
# copying ... files in src/ into $WOLFSSLLIB_TRG_DIR/src
|
||||
|
||||
if [ "${WOLFSSL_SETUP_VERBOSE}" == "true" ]; then
|
||||
echo "Copying ... files in src/ into \$WOLFSSLLIB_TRG_DIR/srcs ..."
|
||||
fi
|
||||
|
||||
${CPDCMD} ./src/*.c ${WOLFSSLLIB_TRG_DIR}/src/
|
||||
|
||||
|
||||
${CPDCMD} -r ./wolfcrypt/src/*.{c,i} ${WOLFSSLLIB_TRG_DIR}/wolfcrypt/src/
|
||||
${CPDCMD} -r ./wolfcrypt/src/port ${WOLFSSLLIB_TRG_DIR}/wolfcrypt/src/port/
|
||||
${CPDCMD} -r ./wolfcrypt/test ${WOLFSSLLIB_TRG_DIR}/wolfcrypt/
|
||||
# Copy dummy test_paths.h to handle the case configure hasn't yet executed
|
||||
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/dummy_test_paths.h ${WOLFSSLLIB_TRG_DIR}/wolfcrypt/test/test_paths.h
|
||||
${CPDCMD} -r ./wolfcrypt/benchmark ${WOLFSSLLIB_TRG_DIR}/wolfcrypt/
|
||||
|
||||
${CPDCMD} -r ./wolfssl/*.h ${WOLFSSLLIB_TRG_DIR}/wolfssl/
|
||||
${CPDCMD} -r ./wolfssl/openssl/*.h ${WOLFSSLLIB_TRG_DIR}/wolfssl/openssl/
|
||||
${CPDCMD} -r ./wolfssl/wolfcrypt ${WOLFSSLLIB_TRG_DIR}/wolfssl/
|
||||
|
||||
# user_settings.h
|
||||
if [ "${WOLFSSL_SETUP_VERBOSE}" == "true" ]; then
|
||||
echo "Copying user_settings.h to ${WOLFSSLLIB_TRG_DIR}/include/"
|
||||
fi
|
||||
|
||||
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/user_settings.h ${WOLFSSLLIB_TRG_DIR}/include/
|
||||
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/dummy_config_h ${WOLFSSLLIB_TRG_DIR}/include/config.h
|
||||
|
||||
# unit test app
|
||||
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/test/* ${WOLFSSLLIB_TRG_DIR}/test/
|
||||
@@ -104,24 +70,15 @@ ${CPDCMD} ./libs/component.mk ${WOLFSSLLIB_TRG_DIR}/
|
||||
pushd ${BASEDIR} > /dev/null # WOLFSSL TOP DIR
|
||||
|
||||
# Benchmark program
|
||||
if [ "${WOLFSSL_SETUP_VERBOSE}" == "true" ]; then
|
||||
echo ""
|
||||
fi
|
||||
${RMDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_benchmark/
|
||||
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_benchmark/
|
||||
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_benchmark/main/
|
||||
|
||||
${CPDCMD} ${BASEDIR}/wolfcrypt/benchmark/benchmark.h ${BASEDIR}/IDE/Espressif/ESP-IDF/examples/wolfssl_benchmark/main/benchmark.h
|
||||
${CPDCMD} ${BASEDIR}/wolfcrypt/benchmark/benchmark.c ${BASEDIR}/IDE/Espressif/ESP-IDF/examples/wolfssl_benchmark/main/benchmark.c
|
||||
|
||||
${CPDCMD} -r ./wolfcrypt/benchmark/benchmark.c ${WOLFSSLEXP_TRG_DIR}/wolfssl_benchmark/main/
|
||||
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_benchmark/* ${WOLFSSLEXP_TRG_DIR}/wolfssl_benchmark/
|
||||
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_benchmark/main/* ${WOLFSSLEXP_TRG_DIR}/wolfssl_benchmark/main/
|
||||
|
||||
# Crypt Test program
|
||||
if [ "${WOLFSSL_SETUP_VERBOSE}" == "true" ]; then
|
||||
echo "Copying wolfssl_test to ${WOLFSSLEXP_TRG_DIR}/wolfssl_test/main/"
|
||||
fi
|
||||
${RMDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_test/
|
||||
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_test/
|
||||
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_test/main/
|
||||
@@ -131,9 +88,6 @@ ${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_test/* ${WOLFSSLEXP_TRG_DIR}/
|
||||
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_test/main/* ${WOLFSSLEXP_TRG_DIR}/wolfssl_test/main/
|
||||
|
||||
# TLS Client program
|
||||
if [ "${WOLFSSL_SETUP_VERBOSE}" == "true" ]; then
|
||||
echo "Copying TLS Client program to ${WOLFSSLEXP_TRG_DIR}/wolfssl_client/..."
|
||||
fi
|
||||
${RMDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_client/
|
||||
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_client/
|
||||
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_client/main/
|
||||
@@ -144,9 +98,6 @@ ${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_client/main/* ${WOLFSSLEXP_TR
|
||||
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_client/main/include/* ${WOLFSSLEXP_TRG_DIR}/wolfssl_client/main/include/
|
||||
|
||||
# TLS Server program
|
||||
if [ "${WOLFSSL_SETUP_VERBOSE}" == "true" ]; then
|
||||
echo "Copying TLS Server program to ${WOLFSSLEXP_TRG_DIR}/wolfssl_server/..."
|
||||
fi
|
||||
${RMDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_server/
|
||||
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_server/
|
||||
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_server/main/
|
||||
@@ -158,8 +109,4 @@ ${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_server/main/include/* ${WOLFS
|
||||
|
||||
popd > /dev/null #
|
||||
|
||||
if [ "${WOLFSSL_SETUP_VERBOSE}" == "true" ]; then
|
||||
echo "Copy complete!"
|
||||
fi
|
||||
|
||||
exit 1
|
||||
|
||||
@@ -1,398 +0,0 @@
|
||||
@echo off
|
||||
REM Expect the script at /path/to/wolfssl/IDE/Espressif/ESP-IDF/
|
||||
|
||||
::******************************************************************************************************
|
||||
::******************************************************************************************************
|
||||
echo;
|
||||
echo wolfSSL Windows Setup. Version 1.0a
|
||||
echo;
|
||||
echo This utility will copy a static snapshot of wolfSSL files to the ESP32-IDF component directory.
|
||||
echo;
|
||||
echo If you wish to keep your component library fresh with git pull, consider hard link with mklink.
|
||||
echo;
|
||||
echo "mklink [[/d] | [/h] | [/j]] <link> <target>"
|
||||
echo;
|
||||
::******************************************************************************************************
|
||||
::******************************************************************************************************
|
||||
SET COPYERROR=false
|
||||
|
||||
:: if there's a setup.sh, we are probably starting in the right place.
|
||||
if NOT EXIST "setup.sh" (
|
||||
echo Please run this script at /path/to/wolfssl/IDE/Espressif/ESP-IDF/
|
||||
goto :ERR
|
||||
)
|
||||
|
||||
:: if there's also a default user_settings.h, we are very likely starting in the right place.
|
||||
if NOT EXIST "user_settings.h" (
|
||||
echo Please run this script at /path/to/wolfssl/IDE/Espressif/ESP-IDF/
|
||||
goto :ERR
|
||||
)
|
||||
|
||||
:: see if there was a parameter passed for a specific EDP-IDF directory
|
||||
:: this may be different than the standard ESP-IDF environment (e.g. VisualGDB)
|
||||
if not "%1" == "" (
|
||||
if not exist "%1" (
|
||||
echo "ERROR: optional directory was specified, but not found: %1"
|
||||
goto :ERR
|
||||
)
|
||||
|
||||
SET IDF_PATH=%1
|
||||
echo Using specified IDF_PATH: %IDF_PATH%
|
||||
)
|
||||
|
||||
:: if no IDF_PATH is found, we don't know what to do. Go exit with error.
|
||||
if "%IDF_PATH%" == "" (
|
||||
echo Please launch the script from ESP-IDF command prompt,
|
||||
echo or set your desired IDF_PATH environment variable,
|
||||
echo or pass a parameter to your directory, such as for VisualGDB with ESP-IDF 4.4:
|
||||
echo;
|
||||
echo .\setup_win.bat C:\SysGCC\esp32\esp-idf\v4.4
|
||||
echo;
|
||||
goto :ERR
|
||||
)
|
||||
|
||||
:: Here we go!
|
||||
:: setup some path variables
|
||||
echo;
|
||||
|
||||
set SCRIPTDIR=%CD%
|
||||
set BASEDIR=%SCRIPTDIR%\..\..\..
|
||||
set WOLFSSL_ESPIDFDIR=%BASEDIR%\IDE\Espressif\ESP-IDF
|
||||
set WOLFSSLLIB_TRG_DIR=%IDF_PATH%\components\wolfssl
|
||||
set WOLFSSLEXP_TRG_DIR=%IDF_PATH%\examples\protocols
|
||||
|
||||
echo Using SCRIPTDIR = %SCRIPTDIR%
|
||||
echo Using BASEDIR = %BASEDIR%
|
||||
echo Using WOLFSSL_ESPIDFDIR = %WOLFSSL_ESPIDFDIR%
|
||||
echo Using WOLFSSLLIB_TRG_DIR = %WOLFSSLLIB_TRG_DIR%
|
||||
echo Using WOLFSSLEXP_TRG_DIR = %WOLFSSLEXP_TRG_DIR%
|
||||
|
||||
echo;
|
||||
echo Equivalalent destination path:
|
||||
dir %WOLFSSL_ESPIDFDIR%\*.xyzzy 2> nul | findstr \
|
||||
|
||||
echo;
|
||||
echo Equivalalent source directory paths:
|
||||
:: show the path of the equivalent %VALUE% (search for files that don't exist, supress error, and look for string with "\")
|
||||
dir %BASEDIR%\*.xyzzy 2> nul | findstr \
|
||||
dir %WOLFSSLLIB_TRG_DIR%\*.xyzzy 2> nul | findstr \
|
||||
dir %WOLFSSLEXP_TRG_DIR%\*.xyzzy 2> nul | findstr \
|
||||
|
||||
:: set the FileStamp variable to the current date: YYMMYY_HHMMSS
|
||||
:: the simplest method, to use existing TIME ad DATE variables:
|
||||
:: date = Thu 09/17/2015
|
||||
:: time = 11:13:15.47
|
||||
:: 012345678901234567890
|
||||
::
|
||||
:: There is no leading zero for single digit hours (e.g. 9:00am), so we need to manually include the zero
|
||||
:: here |
|
||||
if "%TIME:~0,1%" == " " set FileStamp=%DATE:~12,2%%DATE:~7,2%%DATE:~4,2%_0%TIME:~1,1%%TIME:~3,2%%TIME:~6,2%
|
||||
|
||||
:: otherwise, if a space not found before the digit, it is a 2 digit hour, so no extract zero is needed
|
||||
if NOT "%TIME:~0,1%" == " " set FileStamp=%DATE:~12,2%%DATE:~7,2%%DATE:~4,2%_%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%
|
||||
|
||||
:: Backup existing user settings
|
||||
if exist %WOLFSSLLIB_TRG_DIR%\include\config.h (
|
||||
echo;
|
||||
echo Saving: %WOLFSSLLIB_TRG_DIR%\include\config.h
|
||||
echo to: %SCRIPTDIR%\config_h_%FileStamp%.bak
|
||||
copy %WOLFSSLLIB_TRG_DIR%\include\config.h %SCRIPTDIR%\config_h_%FileStamp%.bak
|
||||
echo;
|
||||
)
|
||||
|
||||
if exist %WOLFSSL_ESPIDFDIR%\user_settings.h (
|
||||
echo Saving: %WOLFSSLLIB_TRG_DIR%\include\user_settings.h
|
||||
echo to: %SCRIPTDIR%\user_settings_h_%FileStamp%.bak
|
||||
copy %WOLFSSLLIB_TRG_DIR%\include\user_settings.h %SCRIPTDIR%\user_settings_h_%FileStamp%.bak
|
||||
echo;
|
||||
)
|
||||
|
||||
|
||||
::******************************************************************************************************
|
||||
:: check if there's already an existing %WOLFSSLLIB_TRG_DIR% and confirm removal
|
||||
::******************************************************************************************************
|
||||
if exist %WOLFSSLLIB_TRG_DIR% (
|
||||
echo;
|
||||
echo WARNING: Existing files found in %WOLFSSLLIB_TRG_DIR%
|
||||
echo;
|
||||
|
||||
:: clear any prior errorlevel
|
||||
call;
|
||||
choice /c YN /m "Delete files and proceed with install in %WOLFSSLLIB_TRG_DIR% "
|
||||
if errorlevel 2 GOTO :NODELETE
|
||||
GOTO :PURGE
|
||||
|
||||
|
||||
echo;
|
||||
echo Ready to copy files into %IDF_PATH%
|
||||
|
||||
|
||||
::******************************************************************************************************
|
||||
:NODELETE
|
||||
::******************************************************************************************************
|
||||
:: clear any prior errorlevel
|
||||
echo;
|
||||
call;
|
||||
choice /c YN /m "Refresh files %WOLFSSLLIB_TRG_DIR% (there will be a prompt to keep or overwrite user_settings and config) "
|
||||
if errorlevel 2 GOTO :NOCOPY
|
||||
GOTO :REFRESH
|
||||
)
|
||||
|
||||
|
||||
::******************************************************************************************************
|
||||
:PURGE
|
||||
::******************************************************************************************************
|
||||
:: purge existing directory
|
||||
|
||||
if exist %WOLFSSLLIB_TRG_DIR% (
|
||||
echo;
|
||||
echo Removing %WOLFSSLLIB_TRG_DIR%
|
||||
rmdir %WOLFSSLLIB_TRG_DIR% /S /Q
|
||||
if exist %WOLFSSLLIB_TRG_DIR% (
|
||||
SET COPYERROR=true
|
||||
echo;
|
||||
echo WARNING: Failed to remove %WOLFSSLLIB_TRG_DIR%
|
||||
echo;
|
||||
echo Check permissions, open files, read-only attributes, etc.
|
||||
echo;
|
||||
)
|
||||
echo;
|
||||
) else (
|
||||
echo;
|
||||
echo Prior %WOLFSSLLIB_TRG_DIR% not found, installing fresh.
|
||||
echo;
|
||||
)
|
||||
|
||||
::******************************************************************************************************
|
||||
:REFRESH
|
||||
::******************************************************************************************************
|
||||
if not exist %WOLFSSLLIB_TRG_DIR% mkdir %WOLFSSLLIB_TRG_DIR%
|
||||
if not exist %WOLFSSLLIB_TRG_DIR%\src mkdir %WOLFSSLLIB_TRG_DIR%\src
|
||||
if not exist %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src mkdir %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src
|
||||
if not exist %WOLFSSLLIB_TRG_DIR%\wolfssl mkdir %WOLFSSLLIB_TRG_DIR%\wolfssl
|
||||
if not exist %WOLFSSLLIB_TRG_DIR%\wolfssl\openssl mkdir %WOLFSSLLIB_TRG_DIR%\wolfssl\openssl
|
||||
if not exist %WOLFSSLLIB_TRG_DIR%\test mkdir %WOLFSSLLIB_TRG_DIR%\test
|
||||
if not exist %WOLFSSLLIB_TRG_DIR%\include mkdir %WOLFSSLLIB_TRG_DIR%\include
|
||||
|
||||
|
||||
rem copying ... files in src/ into $WOLFSSLLIB_TRG_DIR%/src
|
||||
echo;
|
||||
echo Copying files to %WOLFSSLLIB_TRG_DIR%\src\
|
||||
xcopy %BASEDIR%\src\*.c %WOLFSSLLIB_TRG_DIR%\src\ /S /E /Q /Y
|
||||
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||
|
||||
echo;
|
||||
echo Copying src\*.c files to %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src
|
||||
xcopy %BASEDIR%\wolfcrypt\src\*.c %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src /S /E /Q /Y
|
||||
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||
|
||||
echo;
|
||||
echo Copying src\*.i files to %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src
|
||||
xcopy %BASEDIR%\wolfcrypt\src\*.i %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src /S /E /Q /Y
|
||||
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||
|
||||
echo;
|
||||
echo Copying files to %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src\port\
|
||||
xcopy %BASEDIR%\wolfcrypt\src\port %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src\port\ /S /E /Q /Y
|
||||
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||
|
||||
echo;
|
||||
echo Copying files to %WOLFSSLLIB_TRG_DIR%\wolfcrypt\test\
|
||||
xcopy %BASEDIR%\wolfcrypt\test %WOLFSSLLIB_TRG_DIR%\wolfcrypt\test\ /S /E /Q /Y
|
||||
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||
|
||||
:: Copy dummy test_paths.h to handle the case configure hasn't yet executed
|
||||
echo;
|
||||
echo Copying dummy_test_paths.h to %WOLFSSLLIB_TRG_DIR%\wolfcrypt\test\test_paths.h
|
||||
echo new config > %WOLFSSLLIB_TRG_DIR%\wolfcrypt\test\test_paths.h
|
||||
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||
xcopy %WOLFSSL_ESPIDFDIR%\dummy_test_paths.h %WOLFSSLLIB_TRG_DIR%\wolfcrypt\test\test_paths.h /S /E /Y
|
||||
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||
|
||||
echo;
|
||||
echo Copying files to %WOLFSSLLIB_TRG_DIR%\wolfcrypt\benchmark\
|
||||
xcopy %BASEDIR%\wolfcrypt\benchmark %WOLFSSLLIB_TRG_DIR%\wolfcrypt\benchmark\ /S /E /Q /Y
|
||||
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||
|
||||
echo;
|
||||
echo Copying files to %WOLFSSLLIB_TRG_DIR%\wolfssl\
|
||||
xcopy %BASEDIR%\wolfssl\*.h %WOLFSSLLIB_TRG_DIR%\wolfssl\ /S /E /Q /Y
|
||||
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||
|
||||
echo;
|
||||
echo Copying files to%WOLFSSLLIB_TRG_DIR%\wolfssl\openssl\
|
||||
xcopy %BASEDIR%\wolfssl\openssl\*.h %WOLFSSLLIB_TRG_DIR%\wolfssl\openssl\ /S /E /Q /Y
|
||||
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||
|
||||
echo;
|
||||
echo Copying files to %WOLFSSLLIB_TRG_DIR%\wolfssl\wolfcrypt\
|
||||
xcopy %BASEDIR%\wolfssl\wolfcrypt %WOLFSSLLIB_TRG_DIR%\wolfssl\wolfcrypt\ /S /E /Q /Y
|
||||
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||
|
||||
|
||||
::******************************************************************************************************
|
||||
:: user_settings and config defaults
|
||||
::******************************************************************************************************
|
||||
:: user_settings.h (default, may be overwritten by prior file)
|
||||
echo;
|
||||
echo Copying default user_settings.h to %WOLFSSLLIB_TRG_DIR%\include\
|
||||
xcopy %WOLFSSL_ESPIDFDIR%\user_settings.h %WOLFSSLLIB_TRG_DIR%\include\ /F
|
||||
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||
|
||||
:: echo Creating new config file: %WOLFSSLLIB_TRG_DIR%\include\config.h (default, may be overwritten by prior file)
|
||||
echo new config > %WOLFSSLLIB_TRG_DIR%\include\config.h
|
||||
xcopy %WOLFSSL_ESPIDFDIR%\dummy_config_h. %WOLFSSLLIB_TRG_DIR%\include\config.h /F /Y
|
||||
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||
|
||||
|
||||
:: Check if operator wants to keep prior config.h
|
||||
if EXIST config_h_%FileStamp%.bak (
|
||||
echo;
|
||||
:: clear any prior errorlevel
|
||||
call;
|
||||
choice /c YN /m "Use your prior config.h "
|
||||
if errorlevel 2 GOTO :NO_CONFIG_RESTORE
|
||||
xcopy config_h_%FileStamp%.bak %WOLFSSLLIB_TRG_DIR%\include\config.h /Y
|
||||
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||
|
||||
) else (
|
||||
echo;
|
||||
echo Prior config.h not found. Using default file.
|
||||
)
|
||||
::******************************************************************************************************
|
||||
:NO_CONFIG_RESTORE
|
||||
::******************************************************************************************************
|
||||
|
||||
:: Check if operator wants to keep prior config.h
|
||||
if EXIST user_settings_h_%FileStamp%.bak (
|
||||
echo;
|
||||
:: clear any prior errorlevel
|
||||
call;
|
||||
choice /c YN /m "User your prior user_settings.h "
|
||||
if errorlevel 2 GOTO :NO_USER_SETTINGS_RESTORE
|
||||
xcopy user_settings_h_%FileStamp%.bak %WOLFSSLLIB_TRG_DIR%\include\user_settings.h /Y
|
||||
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||
|
||||
) else (
|
||||
echo;
|
||||
echo Prior user_settings.h not found. Using default file.
|
||||
)
|
||||
|
||||
::******************************************************************************************************
|
||||
:NO_USER_SETTINGS_RESTORE
|
||||
::******************************************************************************************************
|
||||
|
||||
|
||||
:: unit test app
|
||||
echo;
|
||||
echo Copying unit files to %WOLFSSLLIB_TRG_DIR%\test\
|
||||
xcopy %WOLFSSL_ESPIDFDIR%\test %WOLFSSLLIB_TRG_DIR%\test\ /S /E /Q /Y
|
||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
||||
|
||||
echo;
|
||||
echo Copying CMakeLists.txt to %WOLFSSLLIB_TRG_DIR%\
|
||||
xcopy %WOLFSSL_ESPIDFDIR%\libs\CMakeLists.txt %WOLFSSLLIB_TRG_DIR%\ /F
|
||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
||||
|
||||
echo;
|
||||
echo Copying component.mk to %WOLFSSLLIB_TRG_DIR%\
|
||||
xcopy %WOLFSSL_ESPIDFDIR%\libs\component.mk %WOLFSSLLIB_TRG_DIR%\ /F
|
||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
||||
|
||||
:: Benchmark program
|
||||
echo;
|
||||
echo Removing %WOLFSSLEXP_TRG_DIR%\wolfssl_benchmark\
|
||||
rmdir %WOLFSSLEXP_TRG_DIR%\wolfssl_benchmark\ /S /Q
|
||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
||||
|
||||
echo;
|
||||
echo Copying %WOLFSSLEXP_TRG_DIR%\wolfssl_benchmark\main\
|
||||
mkdir %WOLFSSLEXP_TRG_DIR%\wolfssl_benchmark\main\
|
||||
xcopy %BASEDIR%\wolfcrypt\benchmark\benchmark.h %BASEDIR%\IDE\Espressif\ESP-IDF\examples\wolfssl_benchmark\main\benchmark.h /F /Y
|
||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
||||
|
||||
xcopy %BASEDIR%\wolfcrypt\benchmark\benchmark.c %BASEDIR%\IDE\Espressif\ESP-IDF\examples\wolfssl_benchmark\main\benchmark.c /F /Y
|
||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
||||
|
||||
xcopy %BASEDIR%\wolfcrypt\benchmark\benchmark.c %WOLFSSLEXP_TRG_DIR%\wolfssl_benchmark\main\ /F /Y
|
||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
||||
|
||||
xcopy %WOLFSSL_ESPIDFDIR%\examples\wolfssl_benchmark %WOLFSSLEXP_TRG_DIR%\wolfssl_benchmark\ /Q /Y
|
||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
||||
|
||||
:: Crypt Test program
|
||||
echo;
|
||||
echo Copying %WOLFSSLEXP_TRG_DIR%\wolfssl_test\
|
||||
rmdir %WOLFSSLEXP_TRG_DIR%\wolfssl_test\ /S /Q
|
||||
mkdir %WOLFSSLEXP_TRG_DIR%\wolfssl_test\main\
|
||||
|
||||
xcopy %BASEDIR%\wolfcrypt\test\test.c %WOLFSSLEXP_TRG_DIR%\wolfssl_test\main\ /S /E /Q /Y
|
||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
||||
|
||||
xcopy %WOLFSSL_ESPIDFDIR%\examples\wolfssl_test %WOLFSSLEXP_TRG_DIR%\wolfssl_test\ /S /E /Q /Y
|
||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
||||
|
||||
:: TLS Client program
|
||||
echo;
|
||||
echo Copying %WOLFSSLEXP_TRG_DIR%\wolfssl_client\
|
||||
rmdir %WOLFSSLEXP_TRG_DIR%\wolfssl_client\ /S /Q
|
||||
mkdir %WOLFSSLEXP_TRG_DIR%\wolfssl_client\main\
|
||||
|
||||
xcopy %WOLFSSL_ESPIDFDIR%\examples\wolfssl_client %WOLFSSLEXP_TRG_DIR%\wolfssl_client\ /S /E /Q /Y
|
||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
||||
|
||||
:: TLS Server program
|
||||
echo;
|
||||
echo Copying %WOLFSSLEXP_TRG_DIR%\wolfssl_server\
|
||||
rmdir %WOLFSSLEXP_TRG_DIR%\wolfssl_server\ /S /Q
|
||||
mkdir %WOLFSSLEXP_TRG_DIR%\wolfssl_server\main\
|
||||
|
||||
xcopy %WOLFSSL_ESPIDFDIR%\examples\wolfssl_server %WOLFSSLEXP_TRG_DIR%\wolfssl_server\ /S /E /Q /Y
|
||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
||||
|
||||
goto :DONE
|
||||
|
||||
:: error during copy encountered
|
||||
::******************************************************************************************************
|
||||
:COPYERR
|
||||
::******************************************************************************************************
|
||||
echo;
|
||||
echo Error during copy.
|
||||
echo
|
||||
echo Please ensure none of the target files are flagged as read-only, open, etc.
|
||||
goto :ERR
|
||||
|
||||
:: abort at user request
|
||||
::******************************************************************************************************
|
||||
:NOCOPY
|
||||
::******************************************************************************************************
|
||||
echo;
|
||||
echo Setup did not copy any files.
|
||||
goto :ERR
|
||||
|
||||
:: ERROR
|
||||
::******************************************************************************************************
|
||||
:ERR
|
||||
::******************************************************************************************************
|
||||
exit /B 1
|
||||
|
||||
:: Success
|
||||
::******************************************************************************************************
|
||||
:DONE
|
||||
::******************************************************************************************************
|
||||
echo;
|
||||
echo;
|
||||
echo Edit config file in "%WOLFSSLLIB_TRG_DIR%\include\user_settings.h" before trying to compile.
|
||||
echo;
|
||||
echo See Component files for wolfSSL in %WOLFSSLLIB_TRG_DIR%
|
||||
echo;
|
||||
echo See additional examples at https://github.com/wolfSSL/wolfssl-examples
|
||||
echo;
|
||||
echo REMINDER: Ensure any wolfSSL #include definitions occur BEFORE include files in your source code.
|
||||
echo;
|
||||
if "%COPYERROR%" == "true" (
|
||||
echo;
|
||||
echo WARNING: Copy completed with errors! Check for files in use, permissions, symbolic links, etc.
|
||||
echo;
|
||||
)
|
||||
echo setup_win.bat for ESP-IDF completed.
|
||||
@@ -1,6 +1,4 @@
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNO_MAIN_DRIVER -DWOLFSSL_USER_SETTINGS")
|
||||
|
||||
set(COMPONENT_SRCS "test_wolfssl.c" "../wolfcrypt/test/test.c")
|
||||
set(COMPONENT_SRCDIRS ".")
|
||||
set(COMPONENT_ADD_INCLUDEDIRS ".")
|
||||
|
||||
set(COMPONENT_REQUIRES unity test_utils wolfssl)
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
The test contains of wolfSSL unit-test app on Unity.
|
||||
|
||||
When you want to run the app
|
||||
1. Go to /esp-idf/tools/unit-test-app/ folder
|
||||
2. `idf.py menuconfig` to configure unit test app.
|
||||
3. `idf.py -T wolfssl build` to build wolfssl unit test app.
|
||||
1. Copy *test.c* file at /path/to/esp-idf/components/wolfssl/wolfcrypt/test/ folder to the wolfssl/test folder
|
||||
2. Go to /esp-idf/tools/unit-test-app/ folder
|
||||
3. "make menuconfig" to configure unit test app.
|
||||
4. "make TEST_COMPONENTS=wolfssl" to build wolfssl unit test app.
|
||||
|
||||
See [https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/unit-tests.html] for more information about unit test app.
|
||||
|
||||
@@ -171,7 +171,7 @@ static void tskAes256_Test(void *pvParam)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (!defined(NO_RSA) || defined(HAVE_ECC)) && !defined(WC_NO_RNG)
|
||||
#if !defined(NO_RSA) || defined(HAVE_ECC)
|
||||
|
||||
int mp_performance_check(int mul, int mulmod, int exptmod)
|
||||
{
|
||||
@@ -280,13 +280,13 @@ int mp_performance_check(int mul, int mulmod, int exptmod)
|
||||
printf("(%d,%d) Xbits = %d, Ybits = %d Pbits = %d",
|
||||
i , j, Xbits, Ybits, Pbits);
|
||||
if(mul) {
|
||||
printf(" mul = %llu (us)", (unsigned long long)elapsedTime1);
|
||||
printf(" mul = %llu (us)", elapsedTime1);
|
||||
}
|
||||
if(mulmod) {
|
||||
printf(" mulmod = %llu (us)\n", (unsigned long long)elapsedTime2);
|
||||
printf(" mulmod = %llu (us)\n", elapsedTime2);
|
||||
}
|
||||
if(exptmod) {
|
||||
printf(" exptmod = %llu (ms)\n", (unsigned long long)elapsedTime3);
|
||||
printf(" exptmod = %llu (ms)\n", elapsedTime3);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -308,8 +308,8 @@ int mp_performance_check(int mul, int mulmod, int exptmod)
|
||||
int mp_unitest_mul(const char* strZ, const char* strX, const char* strY, int verbose)
|
||||
{
|
||||
int ret = 0;
|
||||
char* buf = NULL;
|
||||
char* bufZ = NULL;
|
||||
char* buf;
|
||||
char* bufZ;
|
||||
int radixX_size;
|
||||
int radixZ_size;
|
||||
int radixY_size;
|
||||
@@ -335,10 +335,10 @@ int mp_unitest_mul(const char* strZ, const char* strX, const char* strY, int ver
|
||||
}
|
||||
|
||||
mp_radix_size(&z, 16, &radixZ_size);
|
||||
bufZ = (char*)XMALLOC(radixZ_size, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
bufZ = (char*)XMALLOC(radixZ_size + 1, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
if(bufZ != NULL) {
|
||||
mp_toradix(&z, bufZ, 16);
|
||||
bufZ[radixZ_size-1] ='\0';
|
||||
bufZ[radixZ_size] ='\0';
|
||||
}
|
||||
|
||||
if(verbose) {
|
||||
@@ -350,14 +350,14 @@ int mp_unitest_mul(const char* strZ, const char* strX, const char* strY, int ver
|
||||
mp_radix_size(&y, 16, &radixY_size);
|
||||
radixX_size = max(radixX_size, radixY_size);
|
||||
|
||||
buf = (char*)XMALLOC(radixX_size, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
buf = (char*)XMALLOC(radixX_size + 1, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
if(buf != NULL) {
|
||||
mp_toradix(&x, buf, 16);
|
||||
buf[radixX_size-1] ='\0';
|
||||
buf[radixX_size] ='\0';
|
||||
printf("X : %s ", buf);
|
||||
|
||||
mp_toradix(&y, buf, 16);
|
||||
buf[radixY_size-1] ='\0';
|
||||
buf[radixY_size] ='\0';
|
||||
printf("Y : %s ", buf);
|
||||
}
|
||||
if(bufZ != NULL) {
|
||||
@@ -410,10 +410,10 @@ int mp_unitest_mulmod(const char* strZ, const char* strX, const char* strY,
|
||||
}
|
||||
|
||||
mp_radix_size(&z, 16, &radixZ_size);
|
||||
bufZ = (char*)XMALLOC(radixZ_size, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
bufZ = (char*)XMALLOC(radixZ_size + 1, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
if(bufZ != NULL) {
|
||||
mp_toradix(&z, bufZ, 16);
|
||||
bufZ[radixZ_size-1] ='\0';
|
||||
bufZ[radixZ_size] ='\0';
|
||||
}
|
||||
|
||||
if(verbose) {
|
||||
@@ -427,18 +427,18 @@ int mp_unitest_mulmod(const char* strZ, const char* strX, const char* strY,
|
||||
mp_radix_size(&m, 16, &radixM_size);
|
||||
radixX_size = max(radixX_size, max(radixY_size, radixM_size));
|
||||
|
||||
buf = (char*)XMALLOC(radixX_size, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
buf = (char*)XMALLOC(radixX_size + 1, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
if(buf != NULL) {
|
||||
mp_toradix(&x, buf, 16);
|
||||
buf[radixX_size-1] ='\0';
|
||||
buf[radixX_size] ='\0';
|
||||
printf("X : %s ", buf);
|
||||
|
||||
mp_toradix(&y, buf, 16);
|
||||
buf[radixY_size-1] ='\0';
|
||||
buf[radixY_size] ='\0';
|
||||
printf("Y : %s ", buf);
|
||||
|
||||
mp_toradix(&m, buf, 16);
|
||||
buf[radixM_size-1] ='\0';
|
||||
buf[radixM_size] ='\0';
|
||||
printf("M : %s ", buf);
|
||||
}
|
||||
if(bufZ != NULL) {
|
||||
@@ -459,8 +459,8 @@ int mp_unitest_exptmod(const char* strZ, const char* strX, const char* strY,
|
||||
const char* strM, int verbose)
|
||||
{
|
||||
int ret = 0;
|
||||
char* buf = NULL;
|
||||
char* bufZ = NULL;
|
||||
char* buf;
|
||||
char* bufZ;
|
||||
int radixX_size;
|
||||
int radixZ_size;
|
||||
int radixY_size;
|
||||
@@ -491,10 +491,10 @@ int mp_unitest_exptmod(const char* strZ, const char* strX, const char* strY,
|
||||
}
|
||||
|
||||
mp_radix_size(&z, 16, &radixZ_size);
|
||||
bufZ = (char*)XMALLOC(radixZ_size, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
bufZ = (char*)XMALLOC(radixZ_size + 1, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
if(bufZ != NULL) {
|
||||
mp_toradix(&z, bufZ, 16);
|
||||
bufZ[radixZ_size-1] ='\0';
|
||||
bufZ[radixZ_size] ='\0';
|
||||
}
|
||||
|
||||
if(verbose) {
|
||||
@@ -508,18 +508,18 @@ int mp_unitest_exptmod(const char* strZ, const char* strX, const char* strY,
|
||||
mp_radix_size(&m, 16, &radixM_size);
|
||||
radixX_size = max(radixX_size, max(radixY_size, radixM_size));
|
||||
|
||||
buf = (char*)XMALLOC(radixX_size, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
buf = (char*)XMALLOC(radixX_size + 1, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
if(buf != NULL) {
|
||||
mp_toradix(&x, buf, 16);
|
||||
buf[radixX_size-1] ='\0';
|
||||
buf[radixX_size] ='\0';
|
||||
printf("X : %s ", buf);
|
||||
|
||||
mp_toradix(&y, buf, 16);
|
||||
buf[radixY_size-1] ='\0';
|
||||
buf[radixY_size] ='\0';
|
||||
printf("Y : %s ", buf);
|
||||
|
||||
mp_toradix(&m, buf, 16);
|
||||
buf[radixM_size-1] ='\0';
|
||||
buf[radixM_size] ='\0';
|
||||
printf("M : %s ", buf);
|
||||
}
|
||||
if(bufZ != NULL) {
|
||||
@@ -539,20 +539,20 @@ int mp_unitest_exptmod(const char* strZ, const char* strX, const char* strY,
|
||||
TEST_CASE("wolfssl mp exptmod test" , "[wolfssl]")
|
||||
{
|
||||
ESP_LOGI(TAG, "mp test");
|
||||
int verbose = 1;
|
||||
int verbose = 0;
|
||||
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("02", "5", "1", "3", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("01", "-5", "1", "3", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("2", "5", "1", "3", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("1", "-5", "1", "3", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("CE331E6D30A77A57", "1234", "A",
|
||||
"FFFFFFFFFFFFFFFF", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("01000000", "1000", "2", "FFFFFFF", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("01000000", "2", "128",
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("1000000", "1000", "2", "FFFFFFF", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("1000000", "2", "128",
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("014B5A90", "1234", "2", "FFFFFFF", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("01234321", "1111", "2", "FFFFFFFF", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("02", "5", "1", "3", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("14B5A90", "1234", "2", "FFFFFFF", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("1234321", "1111", "2", "FFFFFFFF", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("2", "5", "1", "3", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("22", "55", "1", "33", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("0222", "555", "1", "333", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("222", "555", "1", "333", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("2222", "5555", "1", "3333", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("11", "5555", "1", "33", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("55", "1111", "1", "77", verbose));
|
||||
@@ -562,16 +562,16 @@ TEST_CASE("wolfssl mp exptmod test" , "[wolfssl]")
|
||||
TEST_CASE("wolfssl mp mulmod test" , "[wolfssl]")
|
||||
{
|
||||
ESP_LOGI(TAG, "mp test");
|
||||
int verbose = 1;
|
||||
int verbose = 0;
|
||||
/* Z X Y M */
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("02", "5", "1", "3", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("01", "-5", "1", "3", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("02", "-64", "A", "3", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("2", "5", "1", "3", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("1", "-5", "1", "3", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("2", "-64", "A", "3", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("74C3AC", "123456", "55555", "AAAAA1", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("73A068", "123456", "55555", "AAAAA3", verbose));
|
||||
|
||||
mp_unitest_mulmod(
|
||||
"010C530243ADE5EA7C557E9A2FF5B4573195665A89CB921F573267B15CD2BCB6467E925235AA752CC2D08B07D31497B497744CA3685A46E76247439826628589DD814AC9EEE9EF8B4B44BEE2DB6065BE3C51B788E4ECFF39FB28C3D8EBE10FC9989D97CDC6624E32EBD222E222A2E93085FC2D05E4EB73375F7FC7B11E9B3024",
|
||||
"10C530243ADE5EA7C557E9A2FF5B4573195665A89CB921F573267B15CD2BCB6467E925235AA752CC2D08B07D31497B497744CA3685A46E76247439826628589DD814AC9EEE9EF8B4B44BEE2DB6065BE3C51B788E4ECFF39FB28C3D8EBE10FC9989D97CDC6624E32EBD222E222A2E93085FC2D05E4EB73375F7FC7B11E9B3024",
|
||||
"A4F780E83C3FAC34878787D4876BA7582E48C7637A26C6E720974FC7416150A3865D44F6D08E3DA38EB4296928C564D9A0008D8A0D63E0B8EF54D14D54FBEAB540E43D2ED6BE54806D9150C1944437CC3D8B2486A1FB932A6691B529E0E2A46524CB0825BA4F4E1B9C24554DB1913169E5373173A3B7CBBF77C3403C8C7AE86A",
|
||||
"6520379E44C1A2C359342010E1038F8C3644D9A47A9346A80C92B48A6986872D74C3BDDB49B2D93C554B588D4A4448614FADBC066CC10F3EB20A2422EA857B7DD0BF60C9CB7D733B12761BD785BCD122D97ECA0A8F1D0F705BC094B66EE5C96712AE3B14B5AA6AD9E50C6A3020BA01DA4FB94E3934527ADCDB3DE51C368B37C2",
|
||||
"BE7070B80418E528FE66D89088E0F1B7C3D0D23EE64B9474B0FFB0F763A5AB7EAFB62BB738161A50BFF1CA873AD5B0DAF8437A15B97EEA2A80D251B035AF07F3F25D243A4B8756481B3C249ADA7080BD3C8B034A0C8371DEE30370A2B760091B5EC73DA06460E3A9068DD3FF42BB0A94272D57420DB02DE0BA182560921192F3",
|
||||
@@ -602,13 +602,13 @@ TEST_CASE("wolfssl mp mulmod test" , "[wolfssl]")
|
||||
TEST_CASE("wolfssl mp mul test" , "[wolfssl]")
|
||||
{
|
||||
ESP_LOGI(TAG, "mp test");
|
||||
int verbose = 1;
|
||||
int verbose = 0;
|
||||
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_mul("0A", "5", "2", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_mul("-0A", "-5", "2", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_mul("0A", "-5", "-2", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_mul("06260060", "1234", "5678", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_mul("038E83", "123", "321", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_mul("A", "5", "2", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_mul("-A", "-5", "2", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_mul("A", "-5", "-2", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_mul("6260060", "1234", "5678", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_mul("38E83", "123", "321", verbose));
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_mul("75CD7FCBBC", "123456", "6789A", verbose));
|
||||
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_mul(
|
||||
@@ -618,7 +618,7 @@ TEST_CASE("wolfssl mp mul test" , "[wolfssl]")
|
||||
verbose));
|
||||
|
||||
TEST_ASSERT_EQUAL(0, mp_unitest_mul(
|
||||
"033676FE7B625BF0759F7E8932B6B50D5F45E16E1C670AD20F1CDA5DFFA433685937CA8422A9CB916CC8",
|
||||
"33676FE7B625BF0759F7E8932B6B50D5F45E16E1C670AD20F1CDA5DFFA433685937CA8422A9CB916CC8",
|
||||
"165196BA298CD54975DC483C4D21A51EA0A146783CFB41522E76E50C",
|
||||
"24D9D5CA7D9CCC06F5E70F1963E6",
|
||||
verbose));
|
||||
@@ -636,7 +636,7 @@ TEST_CASE("wolfssl mp mul performance test" , "[wolfssl]")
|
||||
|
||||
TEST_ASSERT_EQUAL(0, mp_performance_check(mul, mulmod, exptmod));
|
||||
}
|
||||
#endif/* (!NO_RSA || HAVE_ECC) && !WC_NO_RNG */
|
||||
#endif/* !NO_RSA || HAVE_ECC */
|
||||
|
||||
TEST_CASE("wolfssl aes test" , "[wolfssl]")
|
||||
{
|
||||
@@ -666,7 +666,7 @@ TEST_CASE("wolfssl sha crypt-test", "[wolfssl]")
|
||||
ESP_LOGI(TAG, "sha256_test()");
|
||||
TEST_ASSERT_EQUAL(0, sha256_test());
|
||||
#endif
|
||||
#ifdef WOLFSSL_SHA384
|
||||
#ifdef WOLSSL_SHA384
|
||||
ESP_LOGI(TAG, "sha384_test()");
|
||||
TEST_ASSERT_EQUAL(0, sha384_test());
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* user_settings.h
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -18,25 +18,6 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
*/
|
||||
#undef WOLFSSL_ESPIDF
|
||||
#undef WOLFSSL_ESPWROOM32
|
||||
#undef WOLFSSL_ESPWROOM32SE
|
||||
#undef WOLFSSL_ESPWROOM32
|
||||
#undef WOLFSSL_ESP8266
|
||||
|
||||
#define WOLFSSL_ESPIDF
|
||||
|
||||
/*
|
||||
* choose ONE of these Espressif chips to define:
|
||||
*
|
||||
* WOLFSSL_ESPWROOM32
|
||||
* WOLFSSL_ESPWROOM32SE
|
||||
* WOLFSSL_ESP8266
|
||||
*/
|
||||
|
||||
#define WOLFSSL_ESPWROOM32
|
||||
|
||||
/* #define DEBUG_WOLFSSL_VERBOSE */
|
||||
|
||||
#define BENCH_EMBEDDED
|
||||
#define USE_CERT_BUFFERS_2048
|
||||
@@ -62,19 +43,6 @@
|
||||
#define CURVE25519_SMALL
|
||||
#define HAVE_ED25519
|
||||
|
||||
/* when you want to use pkcs7 */
|
||||
/* #define HAVE_PKCS7 */
|
||||
|
||||
#if defined(HAVE_PKCS7)
|
||||
#define HAVE_AES_KEYWRAP
|
||||
#define HAVE_X963_KDF
|
||||
#define WOLFSSL_AES_DIRECT
|
||||
#endif
|
||||
|
||||
/* when you want to use aes counter mode */
|
||||
/* #define WOLFSSL_AES_DIRECT */
|
||||
/* #define WOLFSSL_AES_COUNTER */
|
||||
|
||||
/* esp32-wroom-32se specific definition */
|
||||
#if defined(WOLFSSL_ESPWROOM32SE)
|
||||
#define WOLFSSL_ATECC508A
|
||||
@@ -90,7 +58,7 @@
|
||||
/* Define USE_FAST_MATH and SMALL_STACK */
|
||||
#define ESP32_USE_RSA_PRIMITIVE
|
||||
/* threshold for performance adjustment for hw primitive use */
|
||||
/* X bits of G^X mod P greater than */
|
||||
/* X bits of G^X mod P greater than */
|
||||
#define EPS_RSA_EXPT_XBTIS 36
|
||||
/* X and Y of X * Y mod P greater than */
|
||||
#define ESP_RSA_MULM_BITS 2000
|
||||
@@ -112,6 +80,3 @@
|
||||
/* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH*/
|
||||
/* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES */
|
||||
/* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI */
|
||||
|
||||
/* adjust wait-timeout count if you see timeout in rsa hw acceleration */
|
||||
#define ESP_RSA_TIMEOUT_CNT 0x249F00
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* user_settings.h
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -70,15 +70,13 @@ extern "C" {
|
||||
#define WOLFSSL_HAVE_SP_RSA
|
||||
#define WOLFSSL_HAVE_SP_DH
|
||||
#define WOLFSSL_HAVE_SP_ECC
|
||||
//#define WOLFSSL_SP_CACHE_RESISTANT
|
||||
#define WOLFSSL_SP_MATH /* only SP math - eliminates fast math code */
|
||||
#define WOLFSSL_SP_CACHE_RESISTANT
|
||||
//#define WOLFSSL_SP_MATH /* only SP math - eliminates fast math code */
|
||||
|
||||
/* SP Assembly Speedups */
|
||||
#define WOLFSSL_SP_ASM /* required if using the ASM versions */
|
||||
/* 64 or 32 bit version */
|
||||
//#define WOLFSSL_SP_ASM /* required if using the ASM versions */
|
||||
//#define WOLFSSL_SP_ARM32_ASM
|
||||
//#define WOLFSSL_SP_ARM64_ASM
|
||||
//#define WOLFSSL_SP_ARM_THUMB_ASM
|
||||
#define WOLFSSL_SP_ARM_CORTEX_M_ASM
|
||||
#endif
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
@@ -173,15 +171,16 @@ extern "C" {
|
||||
#undef ECC_TIMING_RESISTANT
|
||||
#define ECC_TIMING_RESISTANT
|
||||
|
||||
/* Enable cofactor support */
|
||||
#ifdef HAVE_FIPS
|
||||
#undef HAVE_ECC_CDH
|
||||
#define HAVE_ECC_CDH /* Enable cofactor support */
|
||||
|
||||
#undef NO_STRICT_ECDSA_LEN
|
||||
#define NO_STRICT_ECDSA_LEN /* Do not force fixed len w/ FIPS */
|
||||
#define HAVE_ECC_CDH
|
||||
#endif
|
||||
|
||||
/* Validate import */
|
||||
#ifdef HAVE_FIPS
|
||||
#undef WOLFSSL_VALIDATE_ECC_IMPORT
|
||||
#define WOLFSSL_VALIDATE_ECC_IMPORT /* Validate import */
|
||||
#define WOLFSSL_VALIDATE_ECC_IMPORT
|
||||
#endif
|
||||
|
||||
/* Compressed Key Support */
|
||||
@@ -190,17 +189,14 @@ extern "C" {
|
||||
|
||||
/* Use alternate ECC size for ECC math */
|
||||
#ifdef USE_FAST_MATH
|
||||
/* MAX ECC BITS = ROUND8(MAX ECC) * 2 */
|
||||
#ifdef NO_RSA
|
||||
/* Custom fastmath size if not using RSA */
|
||||
/* MAX = ROUND32(ECC BITS 256) + SIZE_OF_MP_DIGIT(32) */
|
||||
#undef FP_MAX_BITS
|
||||
#define FP_MAX_BITS (256 * 2)
|
||||
#define FP_MAX_BITS (256 + 32)
|
||||
#else
|
||||
#undef ALT_ECC_SIZE
|
||||
#define ALT_ECC_SIZE
|
||||
/* wolfSSL will compute the FP_MAX_BITS_ECC, but it can be overriden */
|
||||
//#undef FP_MAX_BITS_ECC
|
||||
//#define FP_MAX_BITS_ECC (256 * 2)
|
||||
#endif
|
||||
|
||||
/* Speedups specific to curve */
|
||||
@@ -610,6 +606,12 @@ extern unsigned int my_rng_seed_gen(void);
|
||||
#undef NO_OLD_TLS
|
||||
#define NO_OLD_TLS
|
||||
|
||||
#undef NO_HC128
|
||||
#define NO_HC128
|
||||
|
||||
#undef NO_RABBIT
|
||||
#define NO_RABBIT
|
||||
|
||||
#undef NO_PSK
|
||||
#define NO_PSK
|
||||
|
||||
@@ -631,10 +633,6 @@ extern unsigned int my_rng_seed_gen(void);
|
||||
#undef NO_SIG_WRAPPER
|
||||
//#define NO_SIG_WRAPPER
|
||||
|
||||
#undef WOLFSSL_IGNORE_FILE_WARN
|
||||
#define WOLFSSL_IGNORE_FILE_WARN
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
BUILD_DIR = ./Build
|
||||
|
||||
all: WolfSSLStaticLib WolfCryptTest WolfCryptBench WolfSSLClient WolfSSLServer
|
||||
all: WolfSSLStaticLib WolfCryptTest WolfCryptBench WolfSSLClient
|
||||
|
||||
WolfCryptTest:
|
||||
$(MAKE) -f Makefile.test
|
||||
@@ -8,8 +8,6 @@ WolfCryptBench:
|
||||
$(MAKE) -f Makefile.bench
|
||||
WolfSSLClient:
|
||||
$(MAKE) -f Makefile.client
|
||||
WolfSSLServer:
|
||||
$(MAKE) -f Makefile.server
|
||||
WolfSSLStaticLib:
|
||||
$(MAKE) -f Makefile.static
|
||||
|
||||
|
||||
@@ -6,39 +6,36 @@ BUILD_DIR = ./Build
|
||||
|
||||
# Toolchain location and prefix
|
||||
#TOOLCHAIN =
|
||||
TOOLCHAIN ?= /opt/gcc-arm-none-eabi/bin/arm-none-eabi-
|
||||
TOOLCHAIN = /opt/gcc-arm-none-eabi/bin/arm-none-eabi-
|
||||
|
||||
# Tools selection
|
||||
CC = $(TOOLCHAIN)gcc
|
||||
AS = $(CC)
|
||||
LD = $(CC)
|
||||
AS = $(TOOLCHAIN)gcc
|
||||
LD = $(TOOLCHAIN)gcc
|
||||
AR = $(TOOLCHAIN)ar
|
||||
NM = $(TOOLCHAIN)nm
|
||||
OBJCOPY ?= $(TOOLCHAIN)objcopy
|
||||
OBJDUMP ?= $(TOOLCHAIN)objdump
|
||||
SIZE ?= $(TOOLCHAIN)size
|
||||
OBJCOPY = $(TOOLCHAIN)objcopy
|
||||
OBJDUMP = $(TOOLCHAIN)objdump
|
||||
SIZE = $(TOOLCHAIN)size
|
||||
|
||||
# Includes
|
||||
USER_SETTINGS_DIR ?= ./Header
|
||||
INC = -I$(USER_SETTINGS_DIR) \
|
||||
-I../..
|
||||
INC = -I./Header \
|
||||
-I./Source \
|
||||
-I../..
|
||||
|
||||
# Defines
|
||||
DEF = -DWOLFSSL_USER_SETTINGS
|
||||
|
||||
# Architecture
|
||||
ARCHFLAGS ?= -mcpu=cortex-m4 -mthumb -mabi=aapcs -DUSE_WOLF_ARM_STARTUP
|
||||
#ARCHFLAGS = -mcpu=cortex-m0 -mthumb -mabi=aapcs -DUSE_WOLF_ARM_STARTUP
|
||||
ARCHFLAGS = -mcpu=cortex-m0 -mthumb -mabi=aapcs -DUSE_WOLF_ARM_STARTUP
|
||||
#ARCHFLAGS = -mcpu=cortex-r5 -mthumb -mabi=aapcs
|
||||
#ARCHFLAGS = -mcpu=cortex-a53 -mthumb -mabi=aapcs
|
||||
|
||||
# Compiler and linker flags
|
||||
ASFLAGS ?= $(ARCHFLAGS)
|
||||
CFLAGS_EXTRA ?= -Wno-cpp
|
||||
CFLAGS ?= $(ARCHFLAGS) -std=gnu99 -Wall $(CFLAGS_EXTRA)
|
||||
LDFLAGS ?= $(ARCHFLAGS)
|
||||
ASFLAGS = $(ARCHFLAGS)
|
||||
CFLAGS = $(ARCHFLAGS) -std=gnu99 -Wall -Wno-cpp
|
||||
LDFLAGS = $(ARCHFLAGS)
|
||||
|
||||
FIPS?=1
|
||||
# LD: Link with nosys
|
||||
LDFLAGS += --specs=nosys.specs
|
||||
|
||||
@@ -72,15 +69,12 @@ LDFLAGS += $(DBGFLAGS)
|
||||
# FILES
|
||||
|
||||
# Port and Test/Benchmark
|
||||
ifndef NO_EXAMPLES
|
||||
SRC_C += ./Source/wolf_main.c
|
||||
SRC_C += ./Source/armtarget.c
|
||||
SRC_C += ../../wolfcrypt/test/test.c
|
||||
SRC_C += ../../wolfcrypt/benchmark/benchmark.c
|
||||
endif
|
||||
|
||||
# WOLFSSL TLS FILES
|
||||
SRC_C += ../../src/bio.c
|
||||
SRC_C += ../../src/crl.c
|
||||
SRC_C += ../../src/internal.c
|
||||
SRC_C += ../../src/keys.c
|
||||
@@ -92,9 +86,7 @@ SRC_C += ../../src/tls13.c
|
||||
SRC_C += ../../src/wolfio.c
|
||||
|
||||
# wolfCrypt Core (FIPS)
|
||||
ifeq "$(FIPS)" "1"
|
||||
SRC_C += ../../wolfcrypt/src/wolfcrypt_first.c
|
||||
endif
|
||||
SRC_C += ../../wolfcrypt/src/aes.c
|
||||
SRC_C += ../../wolfcrypt/src/cmac.c
|
||||
SRC_C += ../../wolfcrypt/src/des3.c
|
||||
@@ -107,38 +99,26 @@ SRC_C += ../../wolfcrypt/src/sha.c
|
||||
SRC_C += ../../wolfcrypt/src/sha256.c
|
||||
SRC_C += ../../wolfcrypt/src/sha512.c
|
||||
SRC_C += ../../wolfcrypt/src/sha3.c
|
||||
ifeq "$(FIPS)" "1"
|
||||
SRC_C += ../../wolfcrypt/src/fips.c
|
||||
SRC_C += ../../wolfcrypt/src/fips_test.c
|
||||
SRC_C += ../../wolfcrypt/src/wolfcrypt_last.c
|
||||
endif
|
||||
|
||||
# wolfCrypt Additional
|
||||
SRC_C += ../../wolfcrypt/src/asm.c
|
||||
SRC_C += ../../wolfcrypt/src/asn.c
|
||||
SRC_C += ../../wolfcrypt/src/blake2s.c
|
||||
SRC_C += ../../wolfcrypt/src/chacha.c
|
||||
SRC_C += ../../wolfcrypt/src/chacha20_poly1305.c
|
||||
SRC_C += ../../wolfcrypt/src/cmac.c
|
||||
SRC_C += ../../wolfcrypt/src/coding.c
|
||||
SRC_C += ../../wolfcrypt/src/compress.c
|
||||
SRC_C += ../../wolfcrypt/src/cpuid.c
|
||||
SRC_C += ../../wolfcrypt/src/cryptocb.c
|
||||
SRC_C += ../../wolfcrypt/src/curve25519.c
|
||||
SRC_C += ../../wolfcrypt/src/curve448.c
|
||||
SRC_C += ../../wolfcrypt/src/ecc_fp.c
|
||||
SRC_C += ../../wolfcrypt/src/eccsi.c
|
||||
SRC_C += ../../wolfcrypt/src/ed25519.c
|
||||
SRC_C += ../../wolfcrypt/src/ed448.c
|
||||
SRC_C += ../../wolfcrypt/src/error.c
|
||||
SRC_C += ../../wolfcrypt/src/evp.c
|
||||
SRC_C += ../../wolfcrypt/src/fe_448.c
|
||||
SRC_C += ../../wolfcrypt/src/fe_low_mem.c
|
||||
SRC_C += ../../wolfcrypt/src/fe_operations.c
|
||||
SRC_C += ../../wolfcrypt/src/ge_448.c
|
||||
SRC_C += ../../wolfcrypt/src/ge_low_mem.c
|
||||
SRC_C += ../../wolfcrypt/src/ge_operations.c
|
||||
SRC_C += ../../wolfcrypt/src/hash.c
|
||||
SRC_C += ../../wolfcrypt/src/kdf.c
|
||||
SRC_C += ../../wolfcrypt/src/integer.c
|
||||
SRC_C += ../../wolfcrypt/src/logging.c
|
||||
SRC_C += ../../wolfcrypt/src/md5.c
|
||||
@@ -148,42 +128,28 @@ SRC_C += ../../wolfcrypt/src/pkcs12.c
|
||||
SRC_C += ../../wolfcrypt/src/pkcs7.c
|
||||
SRC_C += ../../wolfcrypt/src/poly1305.c
|
||||
SRC_C += ../../wolfcrypt/src/pwdbased.c
|
||||
SRC_C += ../../wolfcrypt/src/rc2.c
|
||||
SRC_C += ../../wolfcrypt/src/sakke.c
|
||||
SRC_C += ../../wolfcrypt/src/signature.c
|
||||
SRC_C += ../../wolfcrypt/src/srp.c
|
||||
SRC_C += ../../wolfcrypt/src/sp_arm32.c
|
||||
SRC_C += ../../wolfcrypt/src/sp_arm64.c
|
||||
SRC_C += ../../wolfcrypt/src/sp_armthumb.c
|
||||
SRC_C += ../../wolfcrypt/src/sp_c32.c
|
||||
SRC_C += ../../wolfcrypt/src/sp_c64.c
|
||||
SRC_C += ../../wolfcrypt/src/sp_cortexm.c
|
||||
SRC_C += ../../wolfcrypt/src/sp_dsp32.c
|
||||
SRC_C += ../../wolfcrypt/src/sp_int.c
|
||||
SRC_C += ../../wolfcrypt/src/sp_x86_64.c
|
||||
SRC_C += ../../wolfcrypt/src/tfm.c
|
||||
SRC_C += ../../wolfcrypt/src/wc_dsp.c
|
||||
SRC_C += ../../wolfcrypt/src/wc_encrypt.c
|
||||
SRC_C += ../../wolfcrypt/src/wc_pkcs11.c
|
||||
SRC_C += ../../wolfcrypt/src/wc_port.c
|
||||
SRC_C += ../../wolfcrypt/src/wolfevent.c
|
||||
SRC_C += ../../wolfcrypt/src/wolfmath.c
|
||||
|
||||
ifeq "$(ASYNC)" "1"
|
||||
SRC_C += ../../wolfcrypt/src/async.c
|
||||
endif
|
||||
|
||||
ifeq "$(SELFTEST)" "1"
|
||||
SRC_C += ../../wolfcrypt/src/selftest.c
|
||||
endif
|
||||
|
||||
# wolfCrypt non-standard algorithms (disabled by default)
|
||||
SRC_C += ../../wolfcrypt/src/arc4.c
|
||||
SRC_C += ../../wolfcrypt/src/blake2b.c
|
||||
SRC_C += ../../wolfcrypt/src/camellia.c
|
||||
SRC_C += ../../wolfcrypt/src/dsa.c
|
||||
SRC_C += ../../wolfcrypt/src/hc128.c
|
||||
SRC_C += ../../wolfcrypt/src/idea.c
|
||||
SRC_C += ../../wolfcrypt/src/md2.c
|
||||
SRC_C += ../../wolfcrypt/src/md4.c
|
||||
SRC_C += ../../wolfcrypt/src/rabbit.c
|
||||
SRC_C += ../../wolfcrypt/src/ripemd.c
|
||||
|
||||
|
||||
@@ -195,11 +161,11 @@ vpath %.c $(dir $(SRC_C))
|
||||
|
||||
build_hex: $(BUILD_DIR) $(BUILD_DIR)/$(BIN).hex
|
||||
@echo ""
|
||||
$(CMD_ECHO) $(SIZE) $(BUILD_DIR)/$(BIN).elf
|
||||
$(CMD_ECHO) @$(SIZE) $(BUILD_DIR)/$(BIN).elf
|
||||
|
||||
build_static: $(BUILD_DIR) $(BUILD_DIR)/$(BIN).a
|
||||
@echo ""
|
||||
$(CMD_ECHO) $(SIZE) $(BUILD_DIR)/$(BIN).a
|
||||
$(CMD_ECHO) @$(SIZE) $(BUILD_DIR)/$(BIN).a
|
||||
|
||||
$(BUILD_DIR):
|
||||
$(CMD_ECHO) mkdir -p $(BUILD_DIR)
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
# Project name
|
||||
BIN = WolfSSLServer
|
||||
SRC_C = ./Source/tls_server.c
|
||||
|
||||
all: build_hex
|
||||
|
||||
include Makefile.common
|
||||
@@ -120,6 +120,6 @@ These settings are located in `Header/user_settings.h`.
|
||||
* `USE_SLOW_SHA512`: Over twice as small, but 50% slower
|
||||
* `USE_CERT_BUFFERS_1024` or `USE_CERT_BUFFERS_2048`: Size of RSA certs / keys to test with.
|
||||
* `BENCH_EMBEDDED`: Define this if using the wolfCrypt test/benchmark and using a low memory target.
|
||||
* `ECC_USER_CURVES`: Allows user to define curve sizes to enable. Default is 256-bit on. To enable others use `HAVE_ECC192`, `HAVE_ECC224`, etc....
|
||||
* `ECC_USER_CURVES`: Allows user to defines curve sizes to enable. Default is 256-bit on. To enable others use `HAVE_ECC192`, `HAVE_ECC224`, etc....
|
||||
* `TFM_ARM`, `TFM_SSE2`, `TFM_AVR32`, `TFM_PPC32`, `TFM_MIPS`, `TFM_X86` or `TFM_X86_64`: These are assembly optimizations available with USE_FAST_MATH.
|
||||
* Single Precision Math for ARM: See `WOLFSSL_SP`. Optimized math for ARM performance of specific RSA, DH and ECC algorithms.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* armtarget.c
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -71,7 +71,7 @@ void reset_handler(void)
|
||||
|
||||
/* Init heap */
|
||||
__heap_start__[0] = 0;
|
||||
__heap_start__[1] = ((uintptr_t)__heap_end__ - (uintptr_t)__heap_start__);
|
||||
__heap_start__[1] = ((uint32_t)__heap_end__ - (uint32_t)__heap_start__);
|
||||
#endif /* USE_WOLF_ARM_STARTUP */
|
||||
|
||||
/* Start main */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* benchmark_main.c
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* test_main.c
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* tls_client.c
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
#include <wolfssl/wolfcrypt/error-crypt.h>
|
||||
|
||||
#if !defined(WOLFCRYPT_ONLY) && !defined(NO_WOLFSSL_CLIENT)
|
||||
#ifndef WOLFCRYPT_ONLY
|
||||
|
||||
#include <wolfssl/ssl.h>
|
||||
#include <wolfssl/wolfcrypt/logging.h>
|
||||
@@ -100,11 +100,11 @@ static int tls_client(void)
|
||||
/*---------------------*/
|
||||
/* for no peer auth: */
|
||||
/*---------------------*/
|
||||
wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_NONE, NULL);
|
||||
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
|
||||
/*---------------------*/
|
||||
/* end peer auth option*/
|
||||
/*---------------------*/
|
||||
if ((ret = wolfSSL_CTX_set_cipher_list(ctx, "ECDHE-ECDSA-AES128-SHA256")) != WOLFSSL_SUCCESS) {
|
||||
if ((ret = wolfSSL_CTX_set_cipher_list(ctx, "ECDHE-ECDSA-AES128-SHA256")) != SSL_SUCCESS) {
|
||||
wolfSSL_CTX_free(ctx);
|
||||
printf("CTXset_cipher_list failed, error: %d\n", ret);
|
||||
goto fail;
|
||||
@@ -123,14 +123,14 @@ static int tls_client(void)
|
||||
}
|
||||
|
||||
/* non blocking accept and connect */
|
||||
ret = WOLFSSL_FAILURE;
|
||||
ret = SSL_FAILURE;
|
||||
|
||||
while (ret != WOLFSSL_SUCCESS) {
|
||||
while (ret != SSL_SUCCESS) {
|
||||
/* client connect */
|
||||
ret = wolfSSL_connect(ssl);
|
||||
error = wolfSSL_get_error(ssl, 0);
|
||||
if (ret != WOLFSSL_SUCCESS) {
|
||||
if (error != WOLFSSL_ERROR_WANT_READ && error != WOLFSSL_ERROR_WANT_WRITE) {
|
||||
if (ret != SSL_SUCCESS) {
|
||||
if (error != SSL_ERROR_WANT_READ && error != SSL_ERROR_WANT_WRITE) {
|
||||
/* Fail */
|
||||
printf("wolfSSL connect failed with return code %d\n", error);
|
||||
goto fail;
|
||||
@@ -146,7 +146,7 @@ static int tls_client(void)
|
||||
ret = wolfSSL_write(ssl, msg, msgSz);
|
||||
error = wolfSSL_get_error(ssl, 0);
|
||||
if (ret != msgSz) {
|
||||
if (error != WOLFSSL_ERROR_WANT_READ && error != WOLFSSL_ERROR_WANT_WRITE) {
|
||||
if (error != SSL_ERROR_WANT_READ && error != SSL_ERROR_WANT_WRITE) {
|
||||
/* Write failed */
|
||||
goto fail;
|
||||
}
|
||||
@@ -159,7 +159,7 @@ static int tls_client(void)
|
||||
ret = wolfSSL_read(ssl, reply, sizeof(reply) - 1);
|
||||
error = wolfSSL_get_error(ssl, 0);
|
||||
if (ret < 0) {
|
||||
if (error != WOLFSSL_ERROR_WANT_READ && error != WOLFSSL_ERROR_WANT_WRITE) {
|
||||
if (error != SSL_ERROR_WANT_READ && error != SSL_ERROR_WANT_WRITE) {
|
||||
/* Can put print here, the server enters a loop waiting to read
|
||||
* a confirmation message at this point */
|
||||
// printf("client read failed\n");
|
||||
@@ -186,14 +186,14 @@ fail:
|
||||
|
||||
return -1;
|
||||
}
|
||||
#endif /* !WOLFCRYPT_ONLY && !NO_WOLFSSL_CLIENT */
|
||||
#endif
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
#if !defined(WOLFCRYPT_ONLY) && !defined(NO_WOLFSSL_CLIENT)
|
||||
#ifndef WOLFCRYPT_ONLY
|
||||
wolfSSL_Init();
|
||||
|
||||
ret = tls_client();
|
||||
|
||||
@@ -1,206 +0,0 @@
|
||||
/* tls_server.c
|
||||
*
|
||||
* Copyright (C) 2006-2022 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>
|
||||
#include <wolfssl/wolfcrypt/error-crypt.h>
|
||||
|
||||
#if !defined(WOLFCRYPT_ONLY) && !defined(NO_WOLFSSL_SERVER)
|
||||
|
||||
#include <wolfssl/ssl.h>
|
||||
#include <wolfssl/wolfcrypt/logging.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define MAXSZ 1024
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
/* TLS SERVER */
|
||||
/*------------------------------------------------------------------------*/
|
||||
static int CbIORecv(WOLFSSL *ssl, char *buf, int sz, void *ctx)
|
||||
{
|
||||
int ret = WOLFSSL_CBIO_ERR_GENERAL;
|
||||
|
||||
(void)ssl;
|
||||
(void)ctx;
|
||||
|
||||
/* TODO: Exchange data over your own transport */
|
||||
#warning TODO: Implement your own recv data transport
|
||||
#if 0
|
||||
ret = usart_read_buffer_wait(&cdc_uart_module, buf, sz);
|
||||
if (ret == STATUS_ERR_TIMEOUT)
|
||||
return WOLFSSL_CBIO_ERR_WANT_READ;
|
||||
|
||||
return (ret == STATUS_OK) ? sz : WOLFSSL_CBIO_ERR_GENERAL;
|
||||
#else
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
static int CbIOSend(WOLFSSL *ssl, char *buf, int sz, void *ctx)
|
||||
{
|
||||
int ret = WOLFSSL_CBIO_ERR_GENERAL;
|
||||
|
||||
(void)ssl;
|
||||
(void)ctx;
|
||||
|
||||
/* TODO: Exchange data over your own transport */
|
||||
#warning TODO: Implement your own send data transport
|
||||
#if 0
|
||||
ret = usart_write_buffer_wait(&cdc_uart_module, buf, sz);
|
||||
if (ret == STATUS_ERR_TIMEOUT)
|
||||
return WOLFSSL_CBIO_ERR_WANT_WRITE;
|
||||
|
||||
return (ret == STATUS_OK) ? sz : WOLFSSL_CBIO_ERR_GENERAL;
|
||||
#else
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
static int tls_server(void)
|
||||
{
|
||||
char reply[MAXSZ];
|
||||
int ret, error;
|
||||
WOLFSSL* ssl = NULL;
|
||||
WOLFSSL_CTX* ctx = NULL;
|
||||
|
||||
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_2_server_method())) == NULL) {
|
||||
printf("CTXnew failed.\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
/* ECDHE-ECDSA */
|
||||
/*------------------------------------------------------------------------*/
|
||||
/*--------------------*/
|
||||
/* for peer auth use: */
|
||||
/*--------------------*/
|
||||
// wolfSSL_CTX_load_verify_buffer(ctx, rsa_key_der_1024,
|
||||
// sizeof_rsa_key_der_1024, SSL_FILETYPE_ASN1);
|
||||
// wolfSSL_CTX_load_verify_buffer(ctx, server_cert_der_1024,
|
||||
// sizeof_server_cert_der_1024, SSL_FILETYPE_ASN1);
|
||||
/*---------------------*/
|
||||
/* for no peer auth: */
|
||||
/*---------------------*/
|
||||
wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_NONE, NULL);
|
||||
/*---------------------*/
|
||||
/* end peer auth option*/
|
||||
/*---------------------*/
|
||||
if ((ret = wolfSSL_CTX_set_cipher_list(ctx, "ECDHE-ECDSA-AES128-SHA256")) != WOLFSSL_SUCCESS) {
|
||||
wolfSSL_CTX_free(ctx);
|
||||
printf("CTXset_cipher_list failed, error: %d\n", ret);
|
||||
goto fail;
|
||||
}
|
||||
/*------------------------------------------------------------------------*/
|
||||
/* END CIPHER SUITE OPTIONS */
|
||||
/*------------------------------------------------------------------------*/
|
||||
wolfSSL_CTX_SetIORecv(ctx, CbIORecv);
|
||||
wolfSSL_CTX_SetIOSend(ctx, CbIOSend);
|
||||
|
||||
if ((ssl = wolfSSL_new(ctx)) == NULL) {
|
||||
error = wolfSSL_get_error(ssl, 0);
|
||||
printf("wolfSSL_new failed %d\n", error);
|
||||
wolfSSL_CTX_free(ctx);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* non blocking accept and connect */
|
||||
ret = WOLFSSL_FAILURE;
|
||||
|
||||
while (ret != WOLFSSL_SUCCESS) {
|
||||
/* server accept */
|
||||
ret = wolfSSL_accept(ssl);
|
||||
error = wolfSSL_get_error(ssl, 0);
|
||||
if (ret != WOLFSSL_SUCCESS) {
|
||||
if (error != WOLFSSL_ERROR_WANT_READ && error != WOLFSSL_ERROR_WANT_WRITE) {
|
||||
/* Fail */
|
||||
printf("wolfSSL accept failed with return code %d\n", error);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
/* Success */
|
||||
}
|
||||
|
||||
/* read and write */
|
||||
while (1) {
|
||||
/* server read */
|
||||
ret = wolfSSL_read(ssl, reply, sizeof(reply) - 1);
|
||||
error = wolfSSL_get_error(ssl, 0);
|
||||
if (ret < 0) {
|
||||
if (error != WOLFSSL_ERROR_WANT_READ && error != WOLFSSL_ERROR_WANT_WRITE) {
|
||||
/* Can put print here, the server enters a loop waiting to read
|
||||
* a confirmation message at this point */
|
||||
// printf("server read failed\n");
|
||||
goto fail;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
/* Can put print here, the server enters a loop waiting to read
|
||||
* a confirmation message at this point */
|
||||
reply[ret] = '\0';
|
||||
// printf("Server Received Reply: %s\n", reply);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
while (1) {
|
||||
/* server write / echo */
|
||||
ret = wolfSSL_write(ssl, reply, XSTRLEN(reply));
|
||||
error = wolfSSL_get_error(ssl, 0);
|
||||
if (ret != XSTRLEN(reply)) {
|
||||
if (error != WOLFSSL_ERROR_WANT_READ && error != WOLFSSL_ERROR_WANT_WRITE) {
|
||||
/* Write failed */
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
/* Write succeeded */
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
wolfSSL_shutdown(ssl);
|
||||
wolfSSL_free(ssl);
|
||||
wolfSSL_CTX_free(ctx);
|
||||
|
||||
return -1;
|
||||
}
|
||||
#endif /* !WOLFCRYPT_ONLY && !NO_WOLFSSL_SERVER */
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
#if !defined(WOLFCRYPT_ONLY) && !defined(NO_WOLFSSL_SERVER)
|
||||
wolfSSL_Init();
|
||||
|
||||
ret = tls_server();
|
||||
|
||||
wolfSSL_Cleanup();
|
||||
#else
|
||||
ret = NOT_COMPILED_IN;
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/* wolf_main.c
|
||||
*
|
||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2019 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -59,12 +59,12 @@ unsigned int LowResTimer(void)
|
||||
/* This is used by wolfCrypt benchmark tool only */
|
||||
double current_time(int reset)
|
||||
{
|
||||
double timeNow;
|
||||
int timeMs = gTimeMs;
|
||||
double time;
|
||||
int timeMs = gTimeMs;
|
||||
(void)reset;
|
||||
timeNow = (timeMs / 1000); // sec
|
||||
timeNow += (double)(timeMs % 1000) / 1000; // ms
|
||||
return timeNow;
|
||||
time = (timeMs / 1000); // sec
|
||||
time += (double)(timeMs % 1000) / 1000; // ms
|
||||
return time;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -8,13 +8,10 @@ EXTRA_DIST+= IDE/GCC-ARM/Source/wolf_main.c
|
||||
EXTRA_DIST+= IDE/GCC-ARM/Source/benchmark_main.c
|
||||
EXTRA_DIST+= IDE/GCC-ARM/Source/test_main.c
|
||||
EXTRA_DIST+= IDE/GCC-ARM/Source/tls_client.c
|
||||
EXTRA_DIST+= IDE/GCC-ARM/Source/tls_server.c
|
||||
EXTRA_DIST+= IDE/GCC-ARM/linker.ld
|
||||
EXTRA_DIST+= IDE/GCC-ARM/linker_fips.ld
|
||||
EXTRA_DIST+= IDE/GCC-ARM/Makefile
|
||||
EXTRA_DIST+= IDE/GCC-ARM/Makefile.bench
|
||||
EXTRA_DIST+= IDE/GCC-ARM/Makefile.client
|
||||
EXTRA_DIST+= IDE/GCC-ARM/Makefile.server
|
||||
EXTRA_DIST+= IDE/GCC-ARM/Makefile.common
|
||||
EXTRA_DIST+= IDE/GCC-ARM/Makefile.test
|
||||
EXTRA_DIST+= IDE/GCC-ARM/Makefile.static
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
MEMORY
|
||||
{
|
||||
FLASH (wx) : ORIGIN = 0x00000000, LENGTH = 256K
|
||||
RAM (wx) : ORIGIN = 0x20000000, LENGTH = 64K
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
__vectors_start__ = .;
|
||||
.vectors : { *(.vectors) } > FLASH
|
||||
__vectors_end__ = __vectors_start__ + 0x400;
|
||||
|
||||
/* Custom section for wolfCrypt FIPS module */
|
||||
.wolfCryptFIPSModule_text :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
KEEP(wolfcrypt_first.o (.text .text* ))
|
||||
KEEP(aes.o(.text .text* ))
|
||||
KEEP(cmac.o (.text .text* ))
|
||||
KEEP(des3.o (.text .text* ))
|
||||
KEEP(dh.o (.text .text* ))
|
||||
KEEP(ecc.o (.text .text* ))
|
||||
KEEP(fips.o (.text .text* ))
|
||||
KEEP(fips_test.o (.text .text* ))
|
||||
KEEP(hmac.o (.text .text* ))
|
||||
KEEP(random.o(.text .text* ))
|
||||
KEEP(rsa.o (.text .text* ))
|
||||
KEEP(sha.o (.text .text* ))
|
||||
KEEP(sha256.o (.text .text* ))
|
||||
KEEP(sha3.o (.text .text* ))
|
||||
KEEP(sha512.o (.text .text* ))
|
||||
KEEP(wolfcrypt_last.o(.text .text*))
|
||||
. = ALIGN(4);
|
||||
} > FLASH
|
||||
.wolfCryptFIPSModule_rodata :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
KEEP(wolfcrypt_first.o (.rodata .rodata*))
|
||||
KEEP(aes.o(.rodata .rodata*))
|
||||
KEEP(cmac.o(.rodata .rodata*))
|
||||
KEEP(des3.o(.rodata .rodata*))
|
||||
KEEP(dh.o(.rodata .rodata*))
|
||||
KEEP(ecc.o(.rodata .rodata*))
|
||||
KEEP(fips.o(.rodata .rodata*))
|
||||
KEEP(fips_test.o(.rodata .rodata*))
|
||||
KEEP(hmac.o(.rodata .rodata*))
|
||||
KEEP(random.o(.rodata .rodata*))
|
||||
KEEP(rsa.o(.rodata .rodata*))
|
||||
KEEP(sha.o(.rodata .rodata*))
|
||||
KEEP(sha256.o(.rodata .rodata*))
|
||||
KEEP(sha3.o(.rodata .rodata*))
|
||||
KEEP(sha512.o(.rodata .rodata*))
|
||||
KEEP(wolfcrypt_last.o(.rodata .rodata*))
|
||||
. = ALIGN(4);
|
||||
} > FLASH
|
||||
|
||||
/* Custom section for wolfCrypt and LibC to prevent FIPS hash from changing
|
||||
when application code changes are made */
|
||||
.wolfCryptNonFIPS_text :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
KEEP(*wolf*src*.o(.text .text*))
|
||||
lib_a* ( .text .text*)
|
||||
. = ALIGN(4);
|
||||
} > FLASH
|
||||
.wolfCryptNonFIPS_rodata :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
KEEP(*wolf*src*.o(.rodata .rodata*))
|
||||
lib_a* (.rodata .rodata*)
|
||||
. = ALIGN(4);
|
||||
} > FLASH
|
||||
|
||||
.sys : { *(.sys*) } > FLASH
|
||||
.text : { *(.text*) } > FLASH
|
||||
.rodata : { *(.text*) } > FLASH
|
||||
|
||||
__data_load_start__ = .;
|
||||
__data_start__ = .;
|
||||
.data : { *(.data*) } > RAM
|
||||
__data_end__ = __data_start__ + SIZEOF(.data);
|
||||
|
||||
__bss_start__ = .;
|
||||
.bss : { *(.bss*) } > RAM
|
||||
__bss_end__ = __bss_start__ + SIZEOF(.bss);
|
||||
|
||||
__heap_start__ = .;
|
||||
.heap : { *(.heap*) } > RAM
|
||||
__heap_end__ = __heap_start__ + SIZEOF(.heap);
|
||||
|
||||
end = .;
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
# Makefile
|
||||
#
|
||||
# Copyright (C) 2006-2022 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
|
||||
|
||||
ENVI=hexagon
|
||||
|
||||
# default to hexagon v65 Release build
|
||||
ifndef V
|
||||
V=hexagon_Release_dynamic_toolv83_v65
|
||||
endif
|
||||
|
||||
SUPPORTED_VS = $(default_VS)
|
||||
|
||||
DEPENDENCIES = \
|
||||
ATOMIC \
|
||||
RPCMEM \
|
||||
TEST_MAIN \
|
||||
TEST_UTIL
|
||||
ATOMIC_DIR = $(HEXAGON_SDK_ROOT)/libs/common/atomic
|
||||
RPCMEM_DIR = $(HEXAGON_SDK_ROOT)/libs/common/rpcmem
|
||||
TEST_MAIN_DIR = $(HEXAGON_SDK_ROOT)/test/common/test_main
|
||||
TEST_UTIL_DIR = $(HEXAGON_SDK_ROOT)/test/common/test_util
|
||||
|
||||
include $(HEXAGON_SDK_ROOT)/build/make.d/$(ENVI)_vs.min
|
||||
include $(HEXAGON_SDK_ROOT)/build/defines.min
|
||||
|
||||
QURT = $(HEXAGON_SDK_ROOT)/libs/common/qurt
|
||||
QAIC_FLAGS += -I../../../
|
||||
CC_FLAGS += -I../../../
|
||||
CC_FLAGS += -I $(QURT)/computev65/include/posix/
|
||||
CC_FLAGS += -I $(QURT)/computev65/include/qurt/
|
||||
CC_FLAGS += -I../
|
||||
CC_FLAGS += -DWOLFSSL_USER_SETTINGS
|
||||
CC_FLAGS += -DWOLFSSL_DSP_BUILD
|
||||
CC_FLAGS += -DWC_NO_RNG
|
||||
#CC_FLAGS += -O3
|
||||
|
||||
C_FLAGS += $(MHVX_DOUBLE_FLAG) -mllvm -hexagon-eif=0
|
||||
CC_FLAGS += $(MHVX_DOUBLE_FLAG) -mllvm -hexagon-eif=0
|
||||
|
||||
# stub library
|
||||
BUILD_LIBS += libwolfssl_dsp_skel
|
||||
ifeq (1,$(V_dynamic))
|
||||
BUILD_DLLS += libwolfssl_dsp_skel
|
||||
endif
|
||||
libwolfssl_dsp_skel_QAICIDLS += wolfssl_dsp
|
||||
libwolfssl_dsp_skel_C_SRCS += $V/wolfSSL_skel
|
||||
libwolfssl_dsp_skel.C_SRCS += ../../../wolfcrypt/src/sp_dsp32.c
|
||||
libwolfssl_dsp_skel.C_SRCS += ../../../wolfcrypt/src/sp_int.c
|
||||
libwolfssl_dsp_skel.C_SRCS += ../../../wolfcrypt/src/wc_port.c
|
||||
libwolfssl_dsp_skel.C_SRCS += ../../../wolfcrypt/src/logging.c
|
||||
libwolfssl_dsp_skel.C_SRCS += ../../../wolfcrypt/src/memory.c
|
||||
libwolfssl_dsp_skel.C_SRCS += ../../../wolfcrypt/src/wolfmath.c
|
||||
#libsp_dsp_skel_DLLS += libdspCV_skel
|
||||
|
||||
# quality test
|
||||
#BUILD_QEXES += eccverify_q
|
||||
#eccverify_q_QAICIDLS = wolfssl_dsp
|
||||
#eccverify_q_C_SRCS = ../ecc-verify
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/wc_dsp.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/sp_dsp32.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/sp_int.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/wc_port.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/wc_encrypt.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/pwdbased.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/hash.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/arc4.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/hmac.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/md5.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/coding.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/aes.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/des3.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/random.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/logging.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/ecc.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/memory.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/sha256.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/sha.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/asn.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/wolfmath.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/sp_c32.c
|
||||
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/sp_c64.c
|
||||
#eccverify_q_LIBS = rtld rpcmem test_util atomic test_main
|
||||
|
||||
BUILD_COPIES = \
|
||||
$(DLLS) \
|
||||
$(EXES) \
|
||||
$(LIBS) \
|
||||
$(SHIP_DIR)/ ;
|
||||
|
||||
|
||||
include $(RULES_MIN)
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#ifndef WOLFSSL_DSP_INC
|
||||
#define WOLFSSL_DSP_INC
|
||||
|
||||
#include "AEEStdDef.idl"
|
||||
#include "remote.idl"
|
||||
|
||||
interface wolfSSL: remote_handle64{
|
||||
|
||||
/* ecc operations */
|
||||
long DSP_ECC_Verify_256(inrout sequence<int32> hash, inrout sequence<int32> pX, inrout sequence<int32> pY,
|
||||
inrout sequence<int32> pZ, inrout sequence<int32> r, inrout sequence<int32> sm, inrout long res);
|
||||
};
|
||||
#endif
|
||||
@@ -1,186 +0,0 @@
|
||||
# Makefile
|
||||
#
|
||||
# Copyright (C) 2006-2022 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
|
||||
|
||||
ENVI=UbuntuARM
|
||||
|
||||
# default to Ubuntu Release build
|
||||
ifndef V
|
||||
V=UbuntuARM_Release_aarch64
|
||||
endif
|
||||
|
||||
SUPPORTED_VS = $(default_VS)
|
||||
include $(HEXAGON_SDK_ROOT)/build/make.d/$(ENVI)_vs.min
|
||||
include $(HEXAGON_SDK_ROOT)/build/defines.min
|
||||
|
||||
ifeq ($(CDSP_FLAG), 1)
|
||||
LIB_DSPRPC = libcdsprpc
|
||||
else ifeq ($(MDSP_FLAG), 1)
|
||||
LIB_DSPRPC = libmdsprpc
|
||||
else ifeq ($(SLPI_FLAG), 1)
|
||||
LIB_DSPRPC = libsdsprpc
|
||||
else
|
||||
LIB_DSPRPC = libadsprpc
|
||||
endif
|
||||
$(info ************ LIB=$(LIB_DSPRPC) ************)
|
||||
# include files
|
||||
CC_FLAGS += -I../../
|
||||
CC_FLAGS += -I./
|
||||
CC_FLAGS += -DWOLFSSL_USER_SETTINGS
|
||||
CC_FLAGS += -mcpu=generic+crypto
|
||||
#CC_FLAGS += -O3
|
||||
|
||||
DEPENDENCIES = \
|
||||
ATOMIC \
|
||||
RPCMEM
|
||||
ATOMIC_DIR = $(HEXAGON_SDK_ROOT)/libs/common/atomic
|
||||
RPCMEM_DIR = $(HEXAGON_SDK_ROOT)/libs/common/rpcmem
|
||||
|
||||
# stub library
|
||||
BUILD_DLLS += libwolfssl
|
||||
libwolfssl_QAICIDLS += DSP/wolfssl_dsp
|
||||
libwolfssl_C_SRCS += $V/wolfSSL_stub
|
||||
libwolfssl_DLLS += $(LIB_DSPRPC)
|
||||
libwolfssl_C_SRCS += ../../wolfcrypt/src/wc_dsp
|
||||
libwolfssl_LIBS += rpcmem
|
||||
libwolfssl_LD_FLAGS += -ldl
|
||||
|
||||
# wolfSSL crypto source files
|
||||
libwolfssl_C_SRCS += \
|
||||
../../wolfcrypt/src/aes \
|
||||
../../wolfcrypt/src/md2 \
|
||||
../../wolfcrypt/src/arc4 \
|
||||
../../wolfcrypt/src/md4 \
|
||||
../../wolfcrypt/src/asm \
|
||||
../../wolfcrypt/src/md5 \
|
||||
../../wolfcrypt/src/asn \
|
||||
../../wolfcrypt/src/memory \
|
||||
../../wolfcrypt/src/async \
|
||||
../../wolfcrypt/src/blake2b \
|
||||
../../wolfcrypt/src/pkcs12 \
|
||||
../../wolfcrypt/src/blake2s \
|
||||
../../wolfcrypt/src/pkcs7 \
|
||||
../../wolfcrypt/src/camellia \
|
||||
../../wolfcrypt/src/poly1305 \
|
||||
../../wolfcrypt/src/chacha20_poly1305 \
|
||||
../../wolfcrypt/src/pwdbased \
|
||||
../../wolfcrypt/src/chacha \
|
||||
../../wolfcrypt/src/cmac \
|
||||
../../wolfcrypt/src/random \
|
||||
../../wolfcrypt/src/coding \
|
||||
../../wolfcrypt/src/ripemd \
|
||||
../../wolfcrypt/src/compress \
|
||||
../../wolfcrypt/src/rsa \
|
||||
../../wolfcrypt/src/cpuid \
|
||||
../../wolfcrypt/src/selftest \
|
||||
../../wolfcrypt/src/cryptocb \
|
||||
../../wolfcrypt/src/sha256 \
|
||||
../../wolfcrypt/src/curve25519 \
|
||||
../../wolfcrypt/src/sha3 \
|
||||
../../wolfcrypt/src/des3 \
|
||||
../../wolfcrypt/src/sha512 \
|
||||
../../wolfcrypt/src/dh \
|
||||
../../wolfcrypt/src/sha \
|
||||
../../wolfcrypt/src/signature \
|
||||
../../wolfcrypt/src/ecc \
|
||||
../../wolfcrypt/src/ecc_fp \
|
||||
../../wolfcrypt/src/ed25519 \
|
||||
../../wolfcrypt/src/sp_armthumb \
|
||||
../../wolfcrypt/src/error \
|
||||
../../wolfcrypt/src/sp_int \
|
||||
../../wolfcrypt/src/fe_low_mem \
|
||||
../../wolfcrypt/src/sp_cortexm \
|
||||
../../wolfcrypt/src/fe_operations \
|
||||
../../wolfcrypt/src/fips \
|
||||
../../wolfcrypt/src/sp_x86_64 \
|
||||
../../wolfcrypt/src/fips_test \
|
||||
../../wolfcrypt/src/srp \
|
||||
../../wolfcrypt/src/ge_low_mem \
|
||||
../../wolfcrypt/src/ge_operations \
|
||||
../../wolfcrypt/src/wc_encrypt \
|
||||
../../wolfcrypt/src/hash \
|
||||
../../wolfcrypt/src/wc_pkcs11 \
|
||||
../../wolfcrypt/src/wc_port \
|
||||
../../wolfcrypt/src/hmac \
|
||||
../../wolfcrypt/src/wolfcrypt_first \
|
||||
../../wolfcrypt/src/wolfcrypt_last \
|
||||
../../wolfcrypt/src/wolfevent \
|
||||
../../wolfcrypt/src/logging \
|
||||
../../wolfcrypt/src/sp_c32 \
|
||||
../../wolfcrypt/src/sp_c64 \
|
||||
../../wolfcrypt/src/sp_arm32 \
|
||||
../../wolfcrypt/src/sp_arm64 \
|
||||
../../wolfcrypt/src/wolfmath
|
||||
|
||||
|
||||
# wolfSSL TLS source files
|
||||
libwolfssl_C_SRCS += \
|
||||
../../src/ocsp \
|
||||
../../src/tls \
|
||||
../../src/crl \
|
||||
../../src/sniffer \
|
||||
../../src/wolfio \
|
||||
../../src/internal \
|
||||
../../src/ssl \
|
||||
../../src/keys \
|
||||
../../src/tls13
|
||||
|
||||
# build benchmark app
|
||||
BUILD_EXES += benchmark
|
||||
benchmark_C_SRCS += ../../wolfcrypt/benchmark/benchmark
|
||||
benchmark_LD_FLAGS += -ldl
|
||||
benchmark_LD_FLAGS += -lpthread
|
||||
benchmark_DLLS += libwolfssl
|
||||
benchmark_LIBS += rpcmem
|
||||
benchmark_DLLS += $(LIB_DSPRPC)
|
||||
|
||||
# build test app
|
||||
BUILD_EXES += testwolfcrypt
|
||||
testwolfcrypt_C_SRCS += ../../wolfcrypt/test/test
|
||||
testwolfcrypt_DLLS += libwolfssl
|
||||
testwolfcrypt_LD_FLAGS += -ldl
|
||||
testwolfcrypt_LIBS += rpcmem
|
||||
testwolfcrypt_DLLS += $(LIB_DSPRPC)
|
||||
|
||||
# build ecc verify test app
|
||||
BUILD_EXES += eccverify
|
||||
eccverify_C_SRCS += ecc-verify
|
||||
eccverify_DLLS += libwolfssl
|
||||
eccverify_LD_FLAGS += -ldl
|
||||
eccverify_LIBS += rpcmem
|
||||
eccverify_DLLS += $(LIB_DSPRPC)
|
||||
|
||||
# build ecc verify test app
|
||||
BUILD_EXES += eccbenchmark
|
||||
eccbenchmark_C_SRCS += ecc-verify-benchmark
|
||||
eccbenchmark_DLLS += libwolfssl
|
||||
eccbenchmark_LD_FLAGS += -lpthread
|
||||
eccbenchmark_LD_FLAGS += -ldl
|
||||
eccbenchmark_LIBS += rpcmem
|
||||
eccbenchmark_DLLS += $(LIB_DSPRPC)
|
||||
|
||||
BUILD_COPIES = \
|
||||
$(DLLS) \
|
||||
$(EXES) \
|
||||
$(LIBS) \
|
||||
$(SHIP_DIR)/ ;
|
||||
|
||||
|
||||
include $(RULES_MIN)
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
# Building wolfSSL with DSP Use
|
||||
|
||||
## Intro
|
||||
This directory is to help with building wolfSSL for use with DSP. It assumes that the Hexagon SDK has been setup on the machine and that the environment variables have been set by calling (source ~/Qualcomm/Hexagon_SDK/3.4.3/setup_sdk_env.source). Currently offloading ECC 256 verify operations to the DSP is supported. When WOLFSSL_DSP is defined ECC verify operations are offloaded to the aDSP by default. When not in SINGLE_THREADED mode a call back function must be set for getting the handle or a handle must be set in the ecc_key structure for the operation to make use of multiple threads when offloading to the DSP. This is because creating new handles for new threads must be done.
|
||||
|
||||
|
||||
## Building
|
||||
The directory is divided up into a build for the CPU portion in IDE/HEXAGON and a build for use on the DSP located in IDE/HEXAGON/DSP. Each section has their own Makefile. The Makefile default to an Ubuntu + hexagon v65 release build but can be changed by using V=<build type>. An example of building both would be:
|
||||
|
||||
```
|
||||
cd IDE/HEXAGON
|
||||
make V=UbuntuARM_Release_aarch64
|
||||
cd DSP
|
||||
make V=hexagon_Release_dynamic_toolv83_v65
|
||||
```
|
||||
|
||||
The results from each build will be placed into the ship directories of each, for example ./UbuntuARM_Release_aarch64/ship/* and ./DSP/hexagon_Release_dynamic_toolv83_v65/ship/*.
|
||||
The Makefile creates a DSP library libwolfssl_dsp_skel.so, library libwolfssl.so, executable benchmark, example ecc-verify, example ecc-verify-benchmark and executable testwolfcrypt.
|
||||
These then need pushed to the device in order to run. An example of pushing the results to the device would be:
|
||||
|
||||
```
|
||||
cd IDE/HEXAGON
|
||||
adb push DSP/hexagon_Release_dynamic_toolv83_v65/ship/libwolfssl_dsp_skel.so /data/rfsa/adsp/
|
||||
adb push UbuntuARM_Release_aarch64/ship/libwolfssl.so /data/
|
||||
adb push UbuntuARM_Release_aarch64/ship/benchmark /data/
|
||||
adb push UbuntuARM_Release_aarch64/ship/eccverify /data/
|
||||
adb push UbuntuARM_Release_aarch64/ship/eccbenchmark /data/
|
||||
```
|
||||
|
||||
To change the settings wolfSSL is built with macros can be set in IDE/HEXAGON/user_settings.h. It contains a default setting at this point that was used for collecting benchmark values. The macro necessary to turn on use of the DSP is WOLFSSL_DSP.
|
||||
|
||||
|
||||
The script IDE/HEXAGON/build.sh was added to help speed up building and testing. An example of using the script would be:
|
||||
|
||||
```
|
||||
cd IDE/HEXAGON
|
||||
./build.sh Release
|
||||
```
|
||||
|
||||
This will delete the previous build and rebuild for Release mode. Then it will try to push the resulting library and some of the executables to the device.
|
||||
|
||||
|
||||
For increased performance uncomment the -O3 flag in IDE/HEXAGON/Makefile and IDE/HEXAGON/DSP/Makefile.
|
||||
|
||||
## Use
|
||||
|
||||
A default handle is created with the call to wolfCrypt_Init() and is set to use the aDSP. A default mutex is locked for each use of the handle to make the library stable when multiple threads are calling to DSP supported operations.
|
||||
To use wolfSSL with a user created handle it can be done by calling wc_ecc_set_handle or by setting a callback function using wolfSSL_SetHandleCb(). This should be set in the case of multithreaded applications to account for having a handle for each thread being used.
|
||||
|
||||
|
||||
#### wolfSSL_SetHandleCb
|
||||
The API wolfSSL_SetHandleCb takes a function pointer of type "int (*wolfSSL_DSP_Handle_cb)(remote_handle64 *handle, int finished void *ctx);". This callback is executed right before the operation is handed off to the DSP (finished set to 0) and right after done with the handle (finished set to 1). With ECC this would be after the ECC verify function has been called but before the information is passed on to the DSP and once again with the finished flag set after the result is returned.
|
||||
|
||||
The callback set should return 0 on successfully setting the input handle. The ctx argument is for future custom context to be passed in and is currently not used.
|
||||
|
||||
#### Expected Performance
|
||||
This is the expected results from running ./eccbenchmark using the -O3 flag
|
||||
|
||||
benchmarking using default (locks on handle for aDSP)
|
||||
5000 verifies on 1 threads took 17.481616 seconds
|
||||
10000 verifies on 2 threads took 35.324308 seconds
|
||||
|
||||
benchmarking using software (+NEON if built in)
|
||||
5000 verifies on 1 threads took 1.398336 seconds
|
||||
10000 verifies on 2 threads took 1.383992 seconds
|
||||
|
||||
benchmarking using threads on aDSP
|
||||
5000 verifies on 1 threads took 17.616811 seconds
|
||||
10000 verifies on 2 threads took 19.215413 seconds
|
||||
15000 verifies on 3 threads took 20.410200 seconds
|
||||
20000 verifies on 4 threads took 23.261446 seconds
|
||||
|
||||
benchmarking 1 thread on cDSP
|
||||
5000 verifies on 1 threads took 18.560995 seconds
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/bin/bash
|
||||
if [ -z $1 ]; then
|
||||
echo "./build <Debug | Release>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf "Erasing previous hexagon_$1_dynamic_toolv83_v65 and UbuntuARM_$1_aarch64\n"
|
||||
rm -rf hexagon_$1_dynamic_toolv83_v65 &> /dev/null
|
||||
rm -rf UbuntuARM_$1_aarch64 &> /dev/null
|
||||
cd ./DSP &> /dev/null
|
||||
rm -rf hexagon_$1_dynamic_toolv83_v65 &> /dev/null
|
||||
|
||||
printf "Building hexagon_$1_dynamic_toolv83_v65 ..."
|
||||
make V=hexagon_$1_dynamic_toolv83_v65 &> /dev/null
|
||||
if [ $? != 0 ]; then
|
||||
printf "failed\n"
|
||||
else
|
||||
printf "done\n"
|
||||
fi
|
||||
|
||||
cd ../ &> /dev/null
|
||||
printf "Building UbuntuARM_$1_aarch64 ..."
|
||||
make V=UbuntuARM_$1_aarch64 &> /dev/null
|
||||
if [ $? != 0 ]; then
|
||||
printf "failed\n"
|
||||
else
|
||||
printf "done\n"
|
||||
fi
|
||||
|
||||
printf "Trying to push libwolfssl_Dsp_skel.so, libwolfssl.so, benchmark, eccverify, eccbenchmark\n"
|
||||
adb push DSP/hexagon_$1_dynamic_toolv83_v65/ship/libwolfssl_dsp_skel.so /data/rfsa/adsp/
|
||||
adb push UbuntuARM_$1_aarch64/ship/libwolfssl.so /data/
|
||||
adb push UbuntuARM_$1_aarch64/ship/benchmark /data/
|
||||
adb push UbuntuARM_$1_aarch64/ship/eccverify /data/
|
||||
adb push UbuntuARM_$1_aarch64/ship/eccbenchmark /data/
|
||||
#adb push UbuntuARM_$1_aarch64/ship/testwolfcrypt /data/wolfcrypt/test/
|
||||
printf "done\n"
|
||||
exit 0
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user