Skip to content

Commit

Permalink
RipeMd and Sha224 added to unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarske authored and jrblixt committed May 18, 2017
1 parent a40a3cb commit 4edcbc7
Show file tree
Hide file tree
Showing 215 changed files with 63,617 additions and 26,408 deletions.
2 changes: 1 addition & 1 deletion .cproject
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="wolfcrypt/src/misc.c|IDE/LPCXPRESSO/wolf_example|tirtos|testsuite|tests|swig|support|sslSniffer|scripts|rpm|mqx|mplabx|mcapi|m4|IDE/WORKBENCH|IDE/WIN|IDE/ROWLEY-CROSSWORKS-ARM|IDE/MYSQL|IDE/MDK-ARM|IDE/MDK5-ARM|IDE/LPCXPRESSO/wolf_demo|IDE/LPCXPRESSO/lpc_chip_18xx|IDE/LPCXPRESSO/lpc_board_nxp_lpcxpresso_1837|IDE/iOS|IDE/IAR-EWARM|examples|Debug|certs|build-aux|Backup|autom4te.cache|wolfcrypt/src/aes_asm.s|wolfcrypt/src/aes_asm.asm|wolfcrypt/user-crypto" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<entry excluding="src/bio.c|wolfcrypt/src/evp.c|wolfcrypt/src/misc.c|IDE/LPCXPRESSO/wolf_example|tirtos|testsuite|tests|swig|support|sslSniffer|scripts|rpm|mqx|mplabx|mcapi|m4|IDE/WORKBENCH|IDE/WIN|IDE/ROWLEY-CROSSWORKS-ARM|IDE/MYSQL|IDE/MDK-ARM|IDE/MDK5-ARM|IDE/LPCXPRESSO/wolf_demo|IDE/LPCXPRESSO/lpc_chip_18xx|IDE/LPCXPRESSO/lpc_board_nxp_lpcxpresso_1837|IDE/iOS|IDE/IAR-EWARM|examples|Debug|certs|build-aux|Backup|autom4te.cache|wolfcrypt/src/aes_asm.s|wolfcrypt/src/aes_asm.asm|wolfcrypt/user-crypto" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
Expand Down
30 changes: 28 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ src/async.c
wolfssl/async.h
wolfcrypt/src/async.c
wolfssl/wolfcrypt/async.h
wolfcrypt/src/port/intel/quickassist.c
wolfcrypt/src/port/intel/quickassist_mem.c
wolfcrypt/src/port/cavium/cavium_nitrox.c
wolfssl/wolfcrypt/port/intel/quickassist.h
wolfssl/wolfcrypt/port/intel/quickassist_mem.h
wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h
ctaocrypt/benchmark/benchmark
ctaocrypt/test/testctaocrypt
wolfcrypt/benchmark/benchmark
Expand All @@ -64,6 +70,7 @@ testsuite/testsuite
tests/unit
testsuite/testsuite.test
tests/unit.test
tests/bio_write_test.txt
testsuite/*.der
testsuite/*.pem
testsuite/*.raw
Expand All @@ -84,7 +91,18 @@ ecc-key.pem
certreq.der
certreq.pem
pkcs7cert.der
pkcs7signedData.der
pkcs7signedData_RSA_SHA.der
pkcs7signedData_RSA_SHA_noattr.der
pkcs7signedData_RSA_SHA224.der
pkcs7signedData_RSA_SHA256.der
pkcs7signedData_RSA_SHA384.der
pkcs7signedData_RSA_SHA512.der
pkcs7signedData_ECDSA_SHA.der
pkcs7signedData_ECDSA_SHA_noattr.der
pkcs7signedData_ECDSA_SHA224.der
pkcs7signedData_ECDSA_SHA256.der
pkcs7signedData_ECDSA_SHA384.der
pkcs7signedData_ECDSA_SHA512.der
pkcs7envelopedDataDES3.der
pkcs7envelopedDataAES128CBC.der
pkcs7envelopedDataAES192CBC.der
Expand Down Expand Up @@ -188,4 +206,12 @@ wolfcrypt/user-crypto/lib/libusercrypto.*
wrapper/CSharp/x64/

# Visual Studio Code Workspace Files
*.vscode
*.vscode

IDE/INTIME-RTOS/Debug_*

# Hexiwear
IDE/HEXIWEAR/wolfSSL_HW/Debug

# Binaries
wolfcrypt/src/port/intel/qat_test
11 changes: 11 additions & 0 deletions IDE/ARDUINO/wolfssl-arduino.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,14 @@ if [ "$DIR" = "ARDUINO" ]; then
else
echo "ERROR: You must be in the IDE/ARDUINO directory to run this script"
fi

#UPDATED: 19 Apr 2017 to remove bio.c and evp.c from the root directory since
# they are included inline and should not be compiled directly

ARDUINO_DIR=${PWD}
cd ../../
rm bio.c
rm evp.c
cd $ARDUINO_DIR
# end script in the origin directory for any future functionality that may be added.
#End UPDATE: 19 Apr 2017
143 changes: 143 additions & 0 deletions IDE/HEXIWEAR/wolfSSL_HW/.cproject

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions IDE/HEXIWEAR/wolfSSL_HW/.cwGeneratedFileSetLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Sources/main.c
Project_Settings/Linker_Files/MK64FN1M0xxx12_flash.ld
SDK/platform/CMSIS/Include/core_cmSimd.h
SDK/platform/devices/MK64F12/include/MK64F12.h
SDK/platform/CMSIS/Include/arm_common_tables.h
SDK/platform/CMSIS/Include/arm_const_structs.h
SDK/platform/devices/MK64F12/include/MK64F12_features.h
SDK/platform/CMSIS/Include/core_cm4.h
SDK/platform/CMSIS/Include/core_cmFunc.h
SDK/platform/CMSIS/Include/core_cmInstr.h
SDK/platform/devices/fsl_device_registers.h
SDK/platform/devices/MK64F12/include/fsl_bitaccess.h
SDK/platform/CMSIS/Include/arm_math.h
SDK/platform/devices/MK64F12/include/MK64F12_extension.h
Project_Settings/Startup_Code/startup.c
Project_Settings/Startup_Code/system_MK64F12.c
Project_Settings/Startup_Code/startup.h
Project_Settings/Startup_Code/startup_MK64F12.S
Project_Settings/Startup_Code/system_MK64F12.h
50 changes: 50 additions & 0 deletions IDE/HEXIWEAR/wolfSSL_HW/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>wolfSSL_HW</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
<linkedResources>
<link>
<name>src</name>
<type>2</type>
<locationURI>$%7BPARENT-3-PROJECT_LOC%7D/src</locationURI>
</link>
<link>
<name>wolfcrypt</name>
<type>2</type>
<locationURI>$%7BPARENT-3-PROJECT_LOC%7D/wolfcrypt</locationURI>
</link>
<link>
<name>wolfssl</name>
<type>2</type>
<locationURI>$%7BPARENT-3-PROJECT_LOC%7D/wolfssl</locationURI>
</link>
</linkedResources>
<variableList>
<variable>
<name>PROJECT_KSDK_PATH</name>
<value>file:/.KSDK_1.3.0</value>
</variable>
</variableList>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
versionGenerated/versionGenerated=1.0.0.RT7_b1550-0615
6 changes: 6 additions & 0 deletions IDE/HEXIWEAR/wolfSSL_HW/user_settings.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#define FREESCALE_KSDK_BM
#define FREESCALE_KSDK_1_3
#define FSL_HW_CRYPTO_MANUAL_SELECTION
#define NO_MAIN_DRIVER
#define USE_CERT_BUFFERS_1024
#define ECC_USER_CURVES
6 changes: 6 additions & 0 deletions IDE/IAR-EWARM/Projects/lib/wolfSSL-Lib.ewp
Original file line number Diff line number Diff line change
Expand Up @@ -2040,6 +2040,12 @@
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\wc_port.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\wolfmath.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\wolfevent.c</name>
</file>
</group>
<group>
<name>wolfSSL</name>
Expand Down
1 change: 1 addition & 0 deletions IDE/IAR-EWARM/Projects/user_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#define NO_DEV_RANDOM
#define USE_CERT_BUFFERS_2048
#define WOLFSSL_USER_CURRTIME
#define SIZEOF_LONG_LONG 8

#define CUSTOM_RAND_GENERATE custom_rand_generate
/* warning "write a real random seed!!!!, just for testing now" */
Expand Down
158 changes: 158 additions & 0 deletions IDE/INTIME-RTOS/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
# tenAsys INtime RTOS Port

## Overview

This port is for the tenAsys INtime RTOS available [here](http://www.tenasys.com/intime).

To enable use the define `INTIME_RTOS`.

## Usage

The wolfExamples.sln is a Visual Studio 2015 project. You must have the INtime SDK installed and an INtime RTOS agent running.

The default configuration is set inside the `IDE/INTIME-RTOS/user_settings.h` file.

The example application provides a simple menu interface to select difference application functions to test.

```
wolfExamples started
wolfExamples finished initialization
MENU
t. WolfCrypt Test
b. WolfCrypt Benchmark
c. WolfSSL Client Example
s. WolfSSL Server Example
l. WolfSSL Localhost Client/Server Example
Please select one of the above options:
```

### `t`wolfCrypt Test

Performs testing of all crypto algorithms.

```
Crypt Test
error test passed!
base64 test passed!
base64 test passed!
MD5 test passed!
SHA test passed!
SHA-256 test passed!
SHA-384 test passed!
SHA-512 test passed!
Hash test passed!
HMAC-MD5 test passed!
HMAC-SHA test passed!
HMAC-SHA256 test passed!
HMAC-SHA384 test passed!
HMAC-SHA512 test passed!
HMAC-KDF test passed!
X963-KDF test passed!
GMAC test passed!
Chacha test passed!
POLY1305 test passed!
ChaCha20-Poly1305 AEAD test passed!
DES test passed!
DES3 test passed!
AES test passed!
AES-GCM test passed!
AES-CCM test passed!
AES Key Wrap test passed!
RANDOM test passed!
RSA test passed!
DH test passed!
DSA test passed!
SRP test passed!
PWDBASED test passed!
openSSL extra test
OPENSSL test passed!
ECC test passed!
ECC Enc test passed!
ECC buffer test passed!
CURVE25519 test passed!
ED25519 test passed!
CMAC test passed!
PKCS7enveloped test passed!
PKCS7signed test passed!
PKCS7encrypted test passed!
mutex test passed!
memcb test passed!
Crypt Test: Return code 0
```

### `b` wolfCrypt Benchmark

Performs benchmark of crypto algorithms.

```
Benchmark Test
RNG 25 kB took 0.002 seconds, 11.017 MB/s
AES enc 25 kB took 0.002 seconds, 15.090 MB/s
AES dec 25 kB took 0.002 seconds, 15.119 MB/s
AES-GCM 25 kB took 0.003 seconds, 9.433 MB/s
AES-CTR 25 kB took 0.001 seconds, 22.378 MB/s
AES-CCM 25 kB took 0.002 seconds, 15.306 MB/s
CHACHA 25 kB took 0.002 seconds, 16.063 MB/s
CHA-POLY 25 kB took 0.001 seconds, 20.447 MB/s
3DES 25 kB took 0.002 seconds, 10.717 MB/s
MD5 25 kB took 0.00 seconds, 31.576 MB/s
POLY1305 25 kB took 0.000 seconds, 201.575 MB/s
SHA 25 kB took 0.00 seconds, 43.761 MB/s
SHA-256 25 kB took 0.001 seconds, 19.299 MB/s
SHA-384 25 kB took 0.002 seconds, 14.577 MB/s
SHA-512 25 kB took 0.001 seconds, 21.718 MB/s
AES-CMAC 25 kB took 0.00 seconds, 34.925 MB/s
RSA 2048 public 2.445 milliseconds, avg over 1 iterations
RSA 2048 private 64.711 milliseconds, avg over 1 iterations
RSA 1024 key generation 318.755 milliseconds, avg over 5 iterations
RSA 2048 key generation 22648.396 milliseconds, avg over 5 iterations
DH 2048 key generation 23.119 milliseconds, avg over 1 iterations
DH 2048 key agreement 26.756 milliseconds, avg over 1 iterations
ECC 256 key generation 2.984 milliseconds, avg over 5 iterations
EC-DHE key agreement 2.967 milliseconds, avg over 5 iterations
EC-DSA sign time 1.448 milliseconds, avg over 5 iterations
EC-DSA verify time 3.304 milliseconds, avg over 5 iterations
ECC encrypt 5.860 milliseconds, avg over 1 iterations
ECC decrypt 6.360 milliseconds, avg over 1 iterations
CURVE25519 256 key generation 1.416 milliseconds, avg over 5 iterations
CURVE25519 key agreement 1.332 milliseconds, avg over 5 iterations
ED25519 key generation 0.320 milliseconds, avg over 5 iterations
ED25519 sign time 0.595 milliseconds, avg over 5 iterations
ED25519 verify time 1.310 milliseconds, avg over 5 iterations
Benchmark Test: Return code 0
```

### `c` wolfSSL Client

To configure the host address and port modify the `TLS_HOST_REMOTE` and `TLS_PORT` macros at top of `wolfExamples.c`. This example uses TLS 1.2 to connect to a remote host.

### `s` wolfSSL Server

To configure the port to listen on modify `TLS_PORT` at top of `wolfExamples.c`.

### `l` wolfSSL Localhost Server/Client

Starts a TLS server thread listening on localhost. Starts the TLS client and performs connect, exchanges some data and disconnects.

```
Waiting for a connection...
Client connected successfully
Using Non-Blocking I/O: 0
Message for server: Client:
Received: I hear ya fa shizzle!
The client has closed the connection.
```

## References

For more information please contact [email protected].
13 changes: 13 additions & 0 deletions IDE/INTIME-RTOS/include.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root

EXTRA_DIST += \
IDE/INTIME-RTOS/README.md \
IDE/INTIME-RTOS/user_settings.h \
IDE/INTIME-RTOS/libwolfssl.c \
IDE/INTIME-RTOS/libwolfssl.vcxproj \
IDE/INTIME-RTOS/wolfExamples.c \
IDE/INTIME-RTOS/wolfExamples.h \
IDE/INTIME-RTOS/wolfExamples.vcxproj \
IDE/INTIME-RTOS/wolfExamples.sln
20 changes: 20 additions & 0 deletions IDE/INTIME-RTOS/libwolfssl.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// libwolfssl.c
// Defines the entry point for the DLL application

#include <rt.h>

BOOLEAN __stdcall RslMain( RTHANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call) {
case RSL_PROCESS_ATTACH:
case RSL_THREAD_ATTACH:
case RSL_THREAD_DETACH:
case RSL_PROCESS_DETACH:
break;
}

return TRUE;
}
Loading

0 comments on commit 4edcbc7

Please sign in to comment.