Skip to content

soc: realtek: bee: add CRYPTO_BEE_PSA_ACCELERATOR Kconfig - #303

Open
ZhiyuanTang17 wants to merge 3 commits into
rtkconnectivity:realtek-main-v4.4from
ZhiyuanTang17:tzy/bee-psa-crypto-accelerator
Open

ZhiyuanTang17 wants to merge 3 commits into
rtkconnectivity:realtek-main-v4.4from
ZhiyuanTang17:tzy/bee-psa-crypto-accelerator

Conversation

@ZhiyuanTang17

Copy link
Copy Markdown

Add a Kconfig option CRYPTO_BEE_PSA_ACCELERATOR that announces
the Realtek Bee hardware crypto engine as a PSA accelerator.
Selecting this option enables the PSA algorithm and key-type
symbols the hardware engine supports (AES-ECB/CBC/CFB/OFB/CTR,
SHA-256, HMAC, CCM, and ECDH/ECDSA for the RTL87X2G series).

Wire the option to the mbedtls TF-PSA-Crypto configuration header
so that PSA_CRYPTO_DRIVER_REALTEK_BEE is defined when the
accelerator is enabled.

Extend tests/crypto/mbedtls_psa to cover the new algorithms and
add timing measurements so hardware vs. software performance can
be compared at runtime.

🤖 Generated with Claude Code

ZhiyuanTang17 and others added 3 commits August 18, 2026 16:36
Add a Kconfig option CRYPTO_BEE_PSA_ACCELERATOR that announces
the Realtek Bee hardware crypto engine as a PSA accelerator.
Selecting this option enables the PSA algorithm and key-type
symbols the hardware engine supports (AES-ECB/CBC/CFB/OFB/CTR,
SHA-256, HMAC, CCM, and ECDH/ECDSA for the RTL87X2G series).

Wire the option to the mbedtls TF-PSA-Crypto configuration header
so that PSA_CRYPTO_DRIVER_REALTEK_BEE is defined when the
accelerator is enabled.

Extend tests/crypto/mbedtls_psa to cover the new algorithms and
add timing measurements so hardware vs. software performance can
be compared at runtime.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Zhiyuan Tang <zhiyuan_tang@realsil.com.cn>
Select PSA_WANT_ALG_SHA_224 when CONFIG_SOC_SERIES_RTL87X2J is active
so that the hardware SHA-224 engine is exposed through the PSA API.

Update the Kconfig help text to clarify per-series acceleration scope:
RTL87x2J accelerates AES, SHA-224, and SHA-256; other supported Bee
SoC series accelerate AES and SHA-256. Composite algorithms such as
CCM and HMAC-SHA-256 are also covered.

Co-Authored-By: Claude <noreply@anthropic.com>
Add three ZTEST_USER tests to the test_mbedtls_psa suite that exercise
the PSA hash multipart API (psa_hash_operation_t) with SHA-256:

- test_sha256_multipart: psa_hash_setup -> psa_hash_update x3 ->
  psa_hash_finish.  Uses the NIST FIPS 180-4 448-bit test vector
  ("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 56 B),
  split into 16 + 16 + 24 byte chunks.

- test_sha256_multipart_verify: same vector split 28 + 28 bytes,
  finalised via psa_hash_verify instead of psa_hash_finish.

- test_sha256_multipart_clone: feeds 32 bytes, clones the in-progress
  operation with psa_hash_clone, then drives both branches
  independently to completion and verifies both yield the reference
  digest.

Each test reports elapsed time (ns / cycles) via TC_PRINT.  Wire
suite-level setup and teardown into ZTEST_SUITE so the total wall time
across all test_mbedtls_psa tests is printed on teardown.

Co-Authored-By: Claude <noreply@anthropic.com>
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.

1 participant