Skip to content

Commit

Permalink
driver: crypto: add NXP S32 CRYPTO HSE driver
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Ha Duong Quang <[email protected]>
  • Loading branch information
haduongquang committed Oct 28, 2024
1 parent 9f93ded commit ec5ab83
Show file tree
Hide file tree
Showing 7 changed files with 769 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ zephyr_library_sources_ifdef(CONFIG_CRYPTO_IT8XXX2_SHA crypto_it8xxx2_sha.c)
zephyr_library_sources_ifdef(CONFIG_CRYPTO_IT8XXX2_SHA_V2 crypto_it8xxx2_sha_v2.c)
zephyr_library_sources_ifdef(CONFIG_CRYPTO_MCUX_DCP crypto_mcux_dcp.c)
zephyr_library_sources_ifdef(CONFIG_CRYPTO_SI32 crypto_si32.c)
zephyr_library_sources_ifdef(CONFIG_CRYPTO_NXP_S32_HSE crypto_nxp_s32_hse.c)
zephyr_library_link_libraries_ifdef(CONFIG_MBEDTLS mbedTLS)
1 change: 1 addition & 0 deletions drivers/crypto/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,6 @@ source "drivers/crypto/Kconfig.it8xxx2"
source "drivers/crypto/Kconfig.mcux_dcp"
source "drivers/crypto/Kconfig.si32"
source "drivers/crypto/Kconfig.smartbond"
source "drivers/crypto/Kconfig.nxp_s32_hse"

endif # CRYPTO
33 changes: 33 additions & 0 deletions drivers/crypto/Kconfig.nxp_s32_hse
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2024 NXP
# SPDX-License-Identifier: Apache-2.0

menuconfig CRYPTO_NXP_S32_HSE
bool "NXP S32 HSE crypto driver"
default y
depends on DT_HAS_NXP_S32_CRYPTO_HSE_MU_ENABLED
help
Enable NXP HSE crypto driver.

if CRYPTO_NXP_S32_HSE

config CRYPTO_NXP_S32_HSE_OUTPUT_BUFFER_SIZE
int "The output buffer size for storing the output data of HSE crypto service"
default 128
help
The output buffer size for storing the output data of HSE crypto service.

config CRYPTO_NXP_S32_HSE_AES_KEY_SIZE
int "The size of the key used in cryptographic algorithms, measured in bits."
default 128
help
The size of the key used in cryptographic algorithms, measured in bits.
Only support for 128 bits or 256 bits.

config CRYPTO_NXP_S32_HSE_AES_KEY_GROUP_ID
int "The AES Key Group ID within RAM Key Catalog."
range 0 255
default 0
help
The AES Key Group ID within RAM Key Catalog.

endif #CRYPTO_NXP_S32_HSE
Loading

0 comments on commit ec5ab83

Please sign in to comment.