Skip to content

Commit 5ed1a48

Browse files
committed
driver: crypto: add NXP S32 CRYPTO HSE driver
Add device tree node for MU instances that will be used by HSE and RTU for s32z270. Add support hash crypto for NXP S32 with Algo 2: SHA224, SHA256, SHA384 and SHA512. Add support cipher crypto with ECB, CBC and CTR mode by using ram key catalog. Add support 128/256 bits ram key length. Signed-off-by: Ha Duong Quang <[email protected]>
1 parent 8c264d3 commit 5ed1a48

File tree

7 files changed

+769
-2
lines changed

7 files changed

+769
-2
lines changed

drivers/crypto/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# SPDX-License-Identifier: Apache-2.0
22

33
zephyr_library()
4-
54
zephyr_library_link_libraries_ifdef(CONFIG_MBEDTLS mbedTLS)
65

76
# zephyr-keep-sorted-start
@@ -18,6 +17,7 @@ zephyr_library_sources_ifdef(CONFIG_CRYPTO_MCHP_XEC_SYMCR crypto_mchp_xec_symcr.
1817
zephyr_library_sources_ifdef(CONFIG_CRYPTO_MCUX_DCP crypto_mcux_dcp.c)
1918
zephyr_library_sources_ifdef(CONFIG_CRYPTO_NPCX_SHA crypto_npcx_sha.c)
2019
zephyr_library_sources_ifdef(CONFIG_CRYPTO_NRF_ECB crypto_nrf_ecb.c)
20+
zephyr_library_sources_ifdef(CONFIG_CRYPTO_NXP_S32_HSE crypto_nxp_s32_hse.c)
2121
zephyr_library_sources_ifdef(CONFIG_CRYPTO_RTS5912_SHA crypto_rts5912_sha.c)
2222
zephyr_library_sources_ifdef(CONFIG_CRYPTO_SI32 crypto_si32.c)
2323
zephyr_library_sources_ifdef(CONFIG_CRYPTO_SMARTBOND crypto_smartbond.c)

drivers/crypto/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ source "drivers/crypto/Kconfig.it8xxx2"
6060
source "drivers/crypto/Kconfig.mcux_dcp"
6161
source "drivers/crypto/Kconfig.npcx"
6262
source "drivers/crypto/Kconfig.nrf_ecb"
63+
source "drivers/crypto/Kconfig.nxp_s32_hse"
6364
source "drivers/crypto/Kconfig.rts5912"
6465
source "drivers/crypto/Kconfig.si32"
6566
source "drivers/crypto/Kconfig.smartbond"

drivers/crypto/Kconfig.nxp_s32_hse

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
menuconfig CRYPTO_NXP_S32_HSE
5+
bool "NXP S32 HSE crypto driver"
6+
default y
7+
depends on DT_HAS_NXP_S32_CRYPTO_HSE_MU_ENABLED
8+
help
9+
Enable NXP HSE crypto driver.
10+
11+
if CRYPTO_NXP_S32_HSE
12+
13+
config CRYPTO_NXP_S32_HSE_OUTPUT_BUFFER_SIZE
14+
int "HSE crypto service output buffer size in bytes"
15+
default 128
16+
help
17+
The output buffer size for storing the output data of HSE crypto service, measured in bytes.
18+
19+
config CRYPTO_NXP_S32_HSE_AES_KEY_SIZE
20+
int "Key size in bits"
21+
default 128
22+
help
23+
The size of the key used in cryptographic algorithms, measured in bits.
24+
Only support for 128 bits or 256 bits.
25+
26+
config CRYPTO_NXP_S32_HSE_AES_KEY_GROUP_ID
27+
int "The AES Key Group ID within RAM Key Catalog."
28+
range 0 255
29+
default 0
30+
help
31+
The AES Key Group ID within RAM Key Catalog.
32+
33+
endif #CRYPTO_NXP_S32_HSE

0 commit comments

Comments
 (0)