Repository navigation
Add TF-PSA-Crypto pk and threading API - #49
Draft
padelsbach wants to merge 6 commits into
Draft
padelsbach wants to merge 6 commits into
padelsbach wants to merge 6 commits into
Conversation
…A_WANT_ALG_RSA_PSS_ANY_SALT to probe
There was a problem hiding this comment.
🟡 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
| 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 */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Merge #40 first.
Adds two parts of the TF-PSA api and header files.