Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Espressif Examples and Libraries #7392

Merged

Conversation

gojimmypi
Copy link
Contributor

@gojimmypi gojimmypi commented Apr 3, 2024

Description

This is primarily an update to the Espressif test and benchmark examples.

The updates to the client and server will be addressed in a separate PR.

I don't consider the examples "done", but I had to come up with a stopping point someplace, so here it is.

General

  • Updates copyright year
  • Spelling corrections, line length adjustment to less than 80 chars, variable initialization.

Post Quantum KEM PQ Support

  • Adds optional Kyber KEM support to Espressif examples. See each project's user_settings.h. Disabled by default.

wolfCrypt settings

  • Adds Espressif-specific XMALLOC conditional wc_debug_pvPortMalloc() to print the number of bytes attempted to allocate at failure time.

Benchmark updates

  • Improves support for ESP8266 (Tensilica). Timing is based on RTOS ticks, as CPU counter not available.
  • Forces compile error if CONFIG_NEWLIB_NANO_FORMAT=1 (enabling this causes needed 64bit support to not be available, resulting in no numeric output).
  • Polish debugging code for Espressif timing & counter metrics.
  • Updated some integer types
  • Document WOLFSSL_BENCHMARK_TIMER_DEBUG

TLS Client/Server Examples

  • Add optional Kyber support. Disabled by default; see ./components/wolfssl/include/user_settings.h.
  • Implement more robust shutdown example (see /examples/client)
  • Expand Read/Write loop for WOLFSSL_ERROR_WANT_READ and WOLFSSL_ERROR_WANT_WRITE

Espressif Utilities

  • Adds programmatic ability to turn off watchdog.
  • Polish function types (return esp_err_t instead of int), add debug messages.
  • Adds new esp_sdk_mem_lib for memory related functions and debugging tools.
  • Adds new esp_sdk_time_lib to pull time functions into common library rather than separate code in each example.
  • Adds new esp_sdk_wifi_lib to pull WiFi functions into common library rather than separate code in each example.

The Espressif TLS client and server applications have not been updated to use the new time and wifi libraries at this time.

Espressif Examples

  • Updates template ESP32 example VisualGDB project to use new ESP-IDF v5.2 by default.
  • Checks if IDF_PATH is missing, causing a more clear error when using cmake.
  • Add support for ESP8266 make and cmake support to wolfssl_benchmark and wolfssl_test.
  • Updates sdkconfig defaults for various memory optimization settings. Note app may still use RTOS stack / tasks.
  • Modify ESP8266 heap allocation to no longer use IRAM by default.
  • Adds testAll.sh and testMonitor.sh scripts to aid in running wolfcrypt tests on multiple Espressif devices.
  • Expands scope of testing in wolfssl_test Espressif example, with known problems (e.g. insufficient default memory) flagged in user_settings.h.
  • Various improvements to local wolfSSL component CMake file, in particular for setting or finding wolfssl source.
  • Performance improvements using [file(GLOB EXCLUDE...] instead of [file(GLOB_RECURSE EXCLUDE...] during build.
  • Adds cmake VERBOSE_COMPONENT_MESSAGES (off be default) to print fewer messages.
  • Initialize UART in main.c. Important for ESP8266 targets to output console.
  • Correction that RTOS task parameters are bytes, not words. See TLS_SMP_SERVER_TASK_WORDS vs TLS_SMP_SERVER_TASK_BYTES macro.

Fixes zd# n/a

Testing

How did you test?

Tested on 9 different Espressif SoC devices. Minimal testing on non-Espressif builds. Used the new 'testAll.sh' and 'testMonitor.sh' scripts.

Although disabled by default, there was extensive testing of ESP32 and ESP8266 PQ PEM from Espressif client to Espressif server, from Espressif client to Linux server, and from Linux client to Espressif listening TLS server. Linux versions used the 5.7.0 master release to ensure these Espressif examples work with that latest release.

Here are the 9x test results from my test jig

image

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@gojimmypi gojimmypi self-assigned this Apr 3, 2024
@dgarske dgarske removed their assignment Apr 3, 2024
@dgarske dgarske removed their request for review April 3, 2024 18:30
@JacobBarthelmeh JacobBarthelmeh merged commit 081731b into wolfSSL:master May 3, 2024
114 checks passed
jefferyq2 pushed a commit to jefferyq2/wolfssl that referenced this pull request Jun 9, 2024
…-test

Update Espressif Examples and Libraries
@gojimmypi gojimmypi deleted the PR-Espressif-wolfcrypt-test branch October 9, 2024 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants