Update code to v1.0.14 (10)

This commit is contained in:
Caten
2024-02-29 19:35:00 +08:00
parent c2ee3b694c
commit a956d26f6d
3188 changed files with 2317293 additions and 146 deletions

View File

@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.13.1)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(wolfssl_benchmark)
target_sources(app PRIVATE ${ZEPHYR_WOLFSSL_MODULE_DIR}/wolfcrypt/benchmark/benchmark.c)
target_include_directories(app PRIVATE ${ZEPHYR_WOLFSSL_MODULE_DIR}/wolfcrypt/benchmark)
target_sources(app PRIVATE ${app_sources})
add_definitions(-DWOLFSSL_USER_SETTINGS)

View File

@@ -0,0 +1,12 @@
wolfSSL (formerly known as CyaSSL) and wolfCrypt are either licensed for use
under the GPLv2 or a standard commercial license. For our users who cannot use
wolfSSL under GPLv2, a commercial license to wolfSSL and wolfCrypt is available.
Please contact wolfSSL Inc. directly at:
Email: licensing@wolfssl.com
Phone: +1 425 245-8247
More information can be found on the wolfSSL website at www.wolfssl.com.

View File

@@ -0,0 +1,22 @@
# Set user_settings.h file to be used for native wolfSSL build settings
CONFIG_WOLFSSL_SETTINGS_FILE="nrf5340dk_nrf5340_user_settings.h"
##### PSA and CC3XX #####
# Enable Nordic Security Module
CONFIG_NRF_SECURITY=y
CONFIG_ENTROPY_DEVICE_RANDOM_GENERATOR=y
# Enable PSA API support (comes from mbedTLS)
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
# Enable/configure mbedTLS heap
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=8192
# Disable nrf_oberon crypto library PSA backend
CONFIG_PSA_CRYPTO_DRIVER_OBERON=n
# Enable ARM CryptoCell cc3xx driver PSA backend
CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y
##### Logging #####
CONFIG_USE_SEGGER_RTT=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=15360

View File

@@ -0,0 +1,25 @@
CONFIG_BUILD_WITH_TFM=y
CONFIG_TFM_PROFILE_TYPE_NOT_SET=y
# Set user_settings.h file to be used for native wolfSSL build settings
CONFIG_WOLFSSL_SETTINGS_FILE="nrf5340dk_nrf5340_user_settings.h"
##### PSA and CC3XX #####
# Enable Nordic Security Module
CONFIG_NRF_SECURITY=y
CONFIG_ENTROPY_DEVICE_RANDOM_GENERATOR=y
# Enable PSA API support (comes from mbedTLS)
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
# Enable/configure mbedTLS heap
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=8192
# Disable nrf_oberon crypto library PSA backend
CONFIG_PSA_CRYPTO_DRIVER_OBERON=n
# Enable ARM CryptoCell cc3xx driver PSA backend
CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y
##### Logging #####
CONFIG_USE_SEGGER_RTT=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=15360

View File

@@ -0,0 +1,49 @@
#!/bin/sh
WOLFSSL_SRC_DIR=../../..
if [ ! -d $WOLFSSL_SRC_DIR ]; then
echo "Directory does not exist: $WOLFSSL_SRC_DIR"
exit 1
fi
if [ ! -f $WOLFSSL_SRC_DIR/wolfcrypt/benchmark/benchmark.c ]; then
echo "Missing source file: $WOLFSSL_SRC_DIR/wolfcrypt/benchmark/benchmark.h"
exit 1
fi
ZEPHYR_DIR=
if [ $# -ne 1 ]; then
echo "Need location of zephyr project as a command line argument"
exit 1
else
ZEPHYR_DIR=$1
fi
if [ ! -d $ZEPHR_DIR ]; then
echo "Zephyr project directory does not exist: $ZEPHYR_DIR"
exit 1
fi
ZEPHYR_SAMPLES_DIR=$ZEPHYR_DIR/zephyr/samples/modules
if [ ! -d $ZEPHYR_SAMPLES_DIR ]; then
echo "Zephyr samples/modules directory does not exist: $ZEPHYR_SAMPLES_DIR"
exit 1
fi
ZEPHYR_WOLFSSL_DIR=$ZEPHYR_SAMPLES_DIR/wolfssl_benchmark
echo "wolfSSL directory:"
echo " $ZEPHYR_WOLFSSL_DIR"
rm -rf $ZEPHYR_WOLFSSL_DIR
mkdir $ZEPHYR_WOLFSSL_DIR
echo "Copy in Build files ..."
cp -r * $ZEPHYR_WOLFSSL_DIR/
rm $ZEPHYR_WOLFSSL_DIR/$0
echo "Copy Source Code ..."
rm -rf $ZEPHYR_WOLFSSL_DIR/src
mkdir $ZEPHYR_WOLFSSL_DIR/src
cp -rf ${WOLFSSL_SRC_DIR}/wolfcrypt/benchmark/benchmark.c $ZEPHYR_WOLFSSL_DIR/src/
cp -rf ${WOLFSSL_SRC_DIR}/wolfcrypt/benchmark/benchmark.h $ZEPHYR_WOLFSSL_DIR/src/
echo "Done"

View File

@@ -0,0 +1,29 @@
# Configure stack and heap sizes
CONFIG_MAIN_STACK_SIZE=32768
CONFIG_MINIMAL_LIBC_MALLOC_ARENA_SIZE=16384
# Clock for time()
CONFIG_POSIX_CLOCK=y
# TLS configuration
CONFIG_WOLFSSL=y
CONFIG_WOLFSSL_BUILTIN=y
# Floating Point
CONFIG_FPU=y
# Logging
CONFIG_PRINTK=y
CONFIG_CBPRINTF_LIBC_SUBSTS=y
CONFIG_CBPRINTF_FP_SUPPORT=y
CONFIG_CONSOLE=y
CONFIG_LOG=y
CONFIG_LOG_BACKEND_UART=y
CONFIG_LOG_BUFFER_SIZE=15360
#CONFIG_WOLFSSL_DEBUG=y
# Entropy
CONFIG_ENTROPY_GENERATOR=y
CONFIG_ENTROPY_DEVICE_RANDOM_GENERATOR=y

View File

@@ -0,0 +1,10 @@
sample:
description: wolfCrypt benchmark sample app
name: wolfCrypt benchmark
common:
min_flash: 65
min_ram: 36
tags: crypto wolfssl userspace random
tests:
crypto.wolfssl_benchmark:
platform_allow: qemu_x86 nrf5340dk_nrf5340_cpuapp_ns nrf5340dk_nrf5340_cpuapp