Skip to content

Commit

Permalink
A few tweaks to the readme for wolfSSL
Browse files Browse the repository at this point in the history
  • Loading branch information
petertorelli authored Jul 27, 2021
1 parent bd0b0bc commit 27a075b
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions examples/selfhosted/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ This is to help verify the primitive SDK implementation is was done correctly.

# Compile and run

The `cmake` list file will build one of three options, depending on the following
variables:

`SELFHOSTED` - Builds a reference mbedTLS executable (mbedTLS source included)
`WOLFSSL` - Builds a reference wolfSSL executable (wolfSSL must be installed)
default - Compiles and builds a library with the un-implemented functions

## Default `SELFHOSTED`: mbedTLS (2.4.2)

This example uses `cmake`. The option `SELFHOSTED` enables the `EE_CFG_SELFHOSTED`
flag in the code, and links in the local `profile/th_api` implementation (as
well as `main.c`).
Expand All @@ -46,8 +55,6 @@ well as `main.c`).
% cd build
% cmake -DSELFHOSTED=1 ..
% make
:
:
% ./sec-tls
Running each primitive for at least 1s or 10 iterations.
Component #00 ips= 1286609.125 crc=0xc7b0 expected_crc=0xc7b0
Expand All @@ -69,19 +76,29 @@ SecureMark-TLS Score is 112677.812 marks
```

To compile the SecureMark-TLS benchmark on Windows using Visual Studio open
the Visual Studio project file at `visualc/sec-tls/sec-tls.vcxproj`.
the Visual Studio project file at `visualc/sec-tls/sec-tls.vcxproj`.

## `WOLFSSL` self-hosted

To build with using wolfSSL for crypto (https://github.com/wolfssl/wolfssl)
install wolfSSL version 4.8.0 or later on the system. On the host a good configure option to use when
building wolfSSL is "./configure CFLAGS="-DWOLFSSL_AES_DIRECT -DHAVE_AES_ECB -DWOLFSSL_ECDSA_DETERMINISTIC_K" --enable-ecc --enable-keygen --enable-aesccm --enable-sp --enable-sp-asm"

Then run
building wolfSSL is:

```Bash
% autogen.sh
% ./configure CFLAGS="-DWOLFSSL_AES_DIRECT -DHAVE_AES_ECB -DWOLFSSL_ECDSA_DETERMINISTIC_K" \
--enable-ecc --enable-keygen --enable-aesccm --enable-sp --enable-sp-asm
% make install
```

Then run `cmake` for SecureMark from this `examples/selfhosted` directory, and execute the benchmark:

```Bash
% mkdir build
% cd build
% cmake -DWOLFSSL=1 ..
% make
% ./sec-tls
```

# Scoring
Expand Down

0 comments on commit 27a075b

Please sign in to comment.