Skip to content

Add TF-PSA-Crypto pk and threading API - #49

Draft
padelsbach wants to merge 6 commits into
wolfSSL:masterfrom
padelsbach:pk-threading
Draft

padelsbach wants to merge 6 commits into
wolfSSL:masterfrom
padelsbach:pk-threading

Conversation

@padelsbach

Copy link
Copy Markdown
Contributor

Merge #40 first.

Adds two parts of the TF-PSA api and header files.

Copilot AI balanced review requested due to automatic review settings November 4, 2026 22:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Absolute BUILD_DIR paths break test compilation and the sibling wolfSSL rebuild, while Ed448-only builds underestimate the private-key export buffer size, causing psa_export_key() to fail.

2 open issues
What changed in this PR

Adds TF-PSA-Crypto private-key and pthread compatibility APIs to wolfPSA. Building on #40, it also generates feature macros from the active wolfCrypt configuration for standalone and Zephyr builds.

Changes:

  • Adds RSA/EC private-key parsing, capability checks, mutexes, and condition variables.
  • Shares feature-configuration generation across builds and expands advertised algorithms and buffer sizes.
  • Adds API and feature-surface tests, CI coverage, and build documentation.
File Description
zephyr/​gen/​gen-crypto-config.py Removes the Zephyr-specific generator.
zephyr/​CMakeLists.txt Uses shared generation tools and updated probe flags.
wolfpsa/​tf-psa-crypto/​build_info.h Exposes PK and pthread feature macros.
wolfpsa/​psa/​crypto.h Includes TF-PSA build information.
wolfpsa/​psa/​crypto_sizes.h Extends Edwards and post-quantum buffer sizing.
wolfpsa/​psa/​crypto_extra.h Clarifies callback cleanup documentation.
wolfpsa/​psa/​crypto_config.h Loads generated standalone configuration.
wolfpsa/​mbedtls/​threading.h Declares mutex and condition-variable APIs.
wolfpsa/​mbedtls/​pk.h Declares private-key compatibility APIs.
wolfpsa.map Exports new compatibility symbols.
user_settings.h Enables thread safety with MBEDTLS_THREADING_C.
tools/​psa_want_probe.c Expands feature detection and emitted options.
tools/​gen-crypto-config.py Adds a shared configuration-header generator.
test/​wolfcrypt-benchmark/​Makefile Includes generated configuration headers.
test/​psa_server/​psa_want_surface_test.c Checks advertised features and maximum buffer sizes.
test/​psa_server/​psa_tf_psa_threading_test.c Tests threading APIs and concurrent key access.
test/​psa_server/​psa_tf_psa_pk_test.c Tests key parsing and capability checks.
test/​Makefile Integrates new tests and threaded library variants.
test-psa-api/​psa-crypto-tests.sh Adds the generated-header include directory.
src/​psa_tf_psa.c Implements PK and pthread compatibility APIs.
src/​psa_key_storage.c Guards an RSA-only error helper.
README.md Documents PK support, threading, and generated headers.
Makefile Adds configuration generation and threading build support.
.gitignore Ignores new test and tooling artifacts.
.github/​workflows/​test-psa-api.yml Runs feature-surface checks for ECC variants.
.github/​workflows/​build-config-matrix.yml Expands configuration variants and surface checks.

Review effort: Balanced

Comment thread test/Makefile
CPPFLAGS += -I$(WOLFSSL_BUILD_DIR)
endif
CPPFLAGS += -I$(WOLFPSA_PATH) -I$(WOLFPSA_PATH)/wolfpsa
CPPFLAGS += -I$(WOLFPSA_PATH)/$(BUILD_DIR)/include
#define PSA_EXPORT_KEY_PAIR_MAX_SIZE \
PSA_KEY_EXPORT_FFDH_KEY_PAIR_MAX_SIZE(PSA_VENDOR_FFDH_MAX_KEY_BITS)
#endif
/* ML-KEM and ML-DSA key pairs export as their 64 and 32 byte seeds */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants