wolfPSA is a PSA Crypto engine that implements the PSA Crypto API on
top of wolfCrypt. It is meant to be used by PSA clients (e.g. wolfSSL compiled with WOLFSSL_HAVE_PSA,
or the Arm PSA Architecture Test Suite).
- PSA Crypto API entry points implemented in C.
- wolfCrypt as the backend crypto provider.
- The default make target creates a static library (
libwolfpsa.a) built directly from wolfPSA sources plus the required wolfCrypt objects. - TF-PSA-Crypto's
mbedtls/pk.hfor private keys:mbedtls_pk_init,free,parse_key,parse_keyfileandcan_do_psa. The context has the key's DER and type. RSA and EC keys, PEM or DER, traditional or PKCS #8. Encrypted keys and EC keys with a compressed public key are not supported.
src/: wolfPSA implementation sources.wolfpsa/: public headers.user_settings.h: configuration header.Makefile: build forlibwolfpsa.a.
wolfPSA follows wolfSSL version numbering: wolfPSA v5.9.4 is tested against
wolfSSL v5.9.4-stable. To build against the matching release:
git clone --branch v5.9.4-stable https://github.com/wolfSSL/wolfssl
CI also tests against wolfSSL master.
The build system assumes that wolfSSL is available in a sibling directory under the same path as this repository, e.g:
.
├── wolfPSA/
├── wolfssl/
If this is not the case, provide the path to wolfSSL sources via:
export WOLFSSL_PATH=../wolfssl
Default build:
make
AddressSanitizer build:
make ASAN=1
Thread-safe build, as Mbed TLS with MBEDTLS_THREADING_C: wolfCrypt without
SINGLE_THREADED, a mutex around the key store (WOLFPSA_THREAD_SAFE, see
src/psa_lock.h) and the TF-PSA-Crypto threading API in
mbedtls/threading.h, on pthreads:
make MBEDTLS_THREADING_C=1
Applications define MBEDTLS_THREADING_C too, as in their Mbed TLS
configuration, and link with -pthread.
You can override the wolfSSL source location:
make wolfPSA WOLFSSL_PATH=~/src/wolfssl
The build generates the PSA_WANT_* macros from the wolfCrypt configuration
into $(BUILD_DIR)/include/crypto_config_generated.h (build/include by
default), using python3. Set PYTHON to use another interpreter. Code that
includes <psa/crypto.h> needs that directory on its include path next to
wolfpsa/, and builds only after make has generated the header.
See test-psa-api/README.md for instructions on how to run the tests.
************ Crypto Suite Report ************
TOTAL TESTS : 78
TOTAL PASSED : 65
TOTAL SIM ERROR : 0
TOTAL FAILED : 0
TOTAL SKIPPED : 13
******************************************
See COPYING.
See CHANGELOG.md.