wolfPSA

wolfPSA implements the PSA Crypto API on wolfCrypt and serves wolfTrust guests from a TrustZone Secure image. I added tests and fixes, and trimmed it to fit.

Role: contributor C, PSA Crypto, wolfCrypt, TrustZone wolfSSL/wolfPSA
01 / What I built

Main changes

02 / Design

One design choice

One-shot GCM through the GCM stream is opt-in, because ports that run GCM as one whole message cannot support it. Those ports stop the build with an #error when the option is set, so the failure is loud instead of silent.

03 / Debugging

A bug I fixed

The TLS 1.2 PRF code passed a hash enum to wc_PRF_TLS, which expects a MAC enum, so SHA-256 picked the wrong hash. I added a mapping function that accepts only SHA-256, SHA-384 and SHA-512, and fixed the tests' reference calls. (#24)

04 / Verification

How it was checked

PREvidence
#24test_tls12_prf compares output with wc_PRF_TLS(sha256_mac); found by PSA-Arch dev_apis on M33MU.
#63New secure-set CI build under -Werror and ASAN rejects six malformed ECC keys.
#74Measured 1,636 B saved on STM32L562 and 1,604 B on STM32H563, RAM unchanged.
05 / Limits

What is not done yet

The GCM stream option is off by default and only helps builds using software GCM. Size numbers come from wolfTrust Secure images on STM32L562 and STM32H563.

All my merged pull requests 5 in wolfSSL/wolfPSA
  • #81Trim the Secure PSA build with shared AEAD paths and narrower gates
  • #74Share duplicated cipher, AEAD, signing and key storage paths
  • #63Shrink wolfPSA for a Secure image and restore ECC import checks without XMSS
  • #24Fix TLS 1.2 PRF KDFs to pass a MAC algorithm id to wc_PRF_TLS
  • #9Add Testing Validation and Fixes for wolfPSA

all work view the repository