From be13db01f67bbfb3fc8d6f92ea81418e56cc93e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag=20Erik=20Gj=C3=B8rvad?= Date: Mon, 24 Feb 2025 10:25:55 +0100 Subject: [PATCH] samples: crypto: Add board files for 54l09 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added board files to all crypto samples for 54l09 Signed-off-by: Dag Erik Gjørvad --- .../boards/nrf54l09pdk_nrf54l09_cpuapp.conf | 11 + .../boards/nrf54l09pdk_nrf54l09_cpuapp.conf | 11 + .../boards/nrf54l09pdk_nrf54l09_cpuapp.conf | 11 + .../boards/nrf54l09pdk_nrf54l09_cpuapp.conf | 11 + .../boards/nrf54l09pdk_nrf54l09_cpuapp.conf | 11 + .../boards/nrf54l09pdk_nrf54l09_cpuapp.conf | 11 + .../boards/nrf54l09pdk_nrf54l09_cpuapp.conf | 11 + .../boards/nrf54l09pdk_nrf54l09_cpuapp.conf | 11 + samples/crypto/ed25519ph/CMakeLists.txt | 14 + samples/crypto/ed25519ph/README.rst | 59 +++ .../ed25519ph/boards/nrf52840dk_nrf52840.conf | 12 + .../boards/nrf5340dk_nrf5340_cpuapp.conf | 12 + .../boards/nrf5340dk_nrf5340_cpuapp_ns.conf | 9 + .../boards/nrf5340dk_nrf5340_cpunet.conf | 14 + .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 19 + .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 21 + .../boards/nrf54l15dk_nrf54l05_cpuapp.conf | 11 + .../boards/nrf54l15dk_nrf54l10_cpuapp.conf | 11 + .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 11 + .../ed25519ph/boards/nrf9151dk_nrf9151.conf | 12 + .../boards/nrf9151dk_nrf9151_ns.conf | 9 + .../ed25519ph/boards/nrf9160dk_nrf9160.conf | 12 + .../boards/nrf9160dk_nrf9160_ns.conf | 9 + .../ed25519ph/boards/nrf9161dk_nrf9161.conf | 12 + .../boards/nrf9161dk_nrf9161_ns.conf | 9 + samples/crypto/ed25519ph/prj.conf | 28 ++ samples/crypto/ed25519ph/sample.yaml | 69 ++++ samples/crypto/ed25519ph/src/main.c | 377 ++++++++++++++++++ .../boards/nrf54l09pdk_nrf54l09_cpuapp.conf | 11 + .../boards/nrf54l09pdk_nrf54l09_cpuapp.conf | 11 + .../boards/nrf54l09pdk_nrf54l09_cpuapp.conf | 11 + .../boards/nrf54l09pdk_nrf54l09_cpuapp.conf | 11 + .../boards/nrf54l09dk_nrf54l09_cpuapp.conf | 21 + .../boards/nrf54l09pdk_nrf54l09_cpuapp.conf | 11 + .../boards/nrf54l09pdk_nrf54l09_cpuapp.conf | 11 + .../boards/nrf54l09pdk_nrf54l09_cpuapp.conf | 11 + 36 files changed, 916 insertions(+) create mode 100644 samples/crypto/aes_cbc/boards/nrf54l09pdk_nrf54l09_cpuapp.conf create mode 100644 samples/crypto/aes_ccm/boards/nrf54l09pdk_nrf54l09_cpuapp.conf create mode 100644 samples/crypto/aes_ctr/boards/nrf54l09pdk_nrf54l09_cpuapp.conf create mode 100644 samples/crypto/aes_gcm/boards/nrf54l09pdk_nrf54l09_cpuapp.conf create mode 100644 samples/crypto/chachapoly/boards/nrf54l09pdk_nrf54l09_cpuapp.conf create mode 100644 samples/crypto/ecdh/boards/nrf54l09pdk_nrf54l09_cpuapp.conf create mode 100644 samples/crypto/ecdsa/boards/nrf54l09pdk_nrf54l09_cpuapp.conf create mode 100644 samples/crypto/ecjpake/boards/nrf54l09pdk_nrf54l09_cpuapp.conf create mode 100644 samples/crypto/ed25519ph/CMakeLists.txt create mode 100644 samples/crypto/ed25519ph/README.rst create mode 100644 samples/crypto/ed25519ph/boards/nrf52840dk_nrf52840.conf create mode 100644 samples/crypto/ed25519ph/boards/nrf5340dk_nrf5340_cpuapp.conf create mode 100644 samples/crypto/ed25519ph/boards/nrf5340dk_nrf5340_cpuapp_ns.conf create mode 100644 samples/crypto/ed25519ph/boards/nrf5340dk_nrf5340_cpunet.conf create mode 100644 samples/crypto/ed25519ph/boards/nrf54h20dk_nrf54h20_cpuapp.conf create mode 100644 samples/crypto/ed25519ph/boards/nrf54h20dk_nrf54h20_cpuapp.overlay create mode 100644 samples/crypto/ed25519ph/boards/nrf54l15dk_nrf54l05_cpuapp.conf create mode 100644 samples/crypto/ed25519ph/boards/nrf54l15dk_nrf54l10_cpuapp.conf create mode 100644 samples/crypto/ed25519ph/boards/nrf54l15dk_nrf54l15_cpuapp.conf create mode 100644 samples/crypto/ed25519ph/boards/nrf9151dk_nrf9151.conf create mode 100644 samples/crypto/ed25519ph/boards/nrf9151dk_nrf9151_ns.conf create mode 100644 samples/crypto/ed25519ph/boards/nrf9160dk_nrf9160.conf create mode 100644 samples/crypto/ed25519ph/boards/nrf9160dk_nrf9160_ns.conf create mode 100644 samples/crypto/ed25519ph/boards/nrf9161dk_nrf9161.conf create mode 100644 samples/crypto/ed25519ph/boards/nrf9161dk_nrf9161_ns.conf create mode 100644 samples/crypto/ed25519ph/prj.conf create mode 100644 samples/crypto/ed25519ph/sample.yaml create mode 100644 samples/crypto/ed25519ph/src/main.c create mode 100644 samples/crypto/eddsa/boards/nrf54l09pdk_nrf54l09_cpuapp.conf create mode 100644 samples/crypto/hkdf/boards/nrf54l09pdk_nrf54l09_cpuapp.conf create mode 100644 samples/crypto/hmac/boards/nrf54l09pdk_nrf54l09_cpuapp.conf create mode 100644 samples/crypto/pbkdf2/boards/nrf54l09pdk_nrf54l09_cpuapp.conf create mode 100644 samples/crypto/persistent_key_usage/boards/nrf54l09dk_nrf54l09_cpuapp.conf create mode 100644 samples/crypto/rng/boards/nrf54l09pdk_nrf54l09_cpuapp.conf create mode 100644 samples/crypto/rsa/boards/nrf54l09pdk_nrf54l09_cpuapp.conf create mode 100644 samples/crypto/spake2p/boards/nrf54l09pdk_nrf54l09_cpuapp.conf diff --git a/samples/crypto/aes_cbc/boards/nrf54l09pdk_nrf54l09_cpuapp.conf b/samples/crypto/aes_cbc/boards/nrf54l09pdk_nrf54l09_cpuapp.conf new file mode 100644 index 000000000000..fb825d567f3a --- /dev/null +++ b/samples/crypto/aes_cbc/boards/nrf54l09pdk_nrf54l09_cpuapp.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/aes_ccm/boards/nrf54l09pdk_nrf54l09_cpuapp.conf b/samples/crypto/aes_ccm/boards/nrf54l09pdk_nrf54l09_cpuapp.conf new file mode 100644 index 000000000000..fb825d567f3a --- /dev/null +++ b/samples/crypto/aes_ccm/boards/nrf54l09pdk_nrf54l09_cpuapp.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/aes_ctr/boards/nrf54l09pdk_nrf54l09_cpuapp.conf b/samples/crypto/aes_ctr/boards/nrf54l09pdk_nrf54l09_cpuapp.conf new file mode 100644 index 000000000000..fb825d567f3a --- /dev/null +++ b/samples/crypto/aes_ctr/boards/nrf54l09pdk_nrf54l09_cpuapp.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/aes_gcm/boards/nrf54l09pdk_nrf54l09_cpuapp.conf b/samples/crypto/aes_gcm/boards/nrf54l09pdk_nrf54l09_cpuapp.conf new file mode 100644 index 000000000000..fb825d567f3a --- /dev/null +++ b/samples/crypto/aes_gcm/boards/nrf54l09pdk_nrf54l09_cpuapp.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/chachapoly/boards/nrf54l09pdk_nrf54l09_cpuapp.conf b/samples/crypto/chachapoly/boards/nrf54l09pdk_nrf54l09_cpuapp.conf new file mode 100644 index 000000000000..fb825d567f3a --- /dev/null +++ b/samples/crypto/chachapoly/boards/nrf54l09pdk_nrf54l09_cpuapp.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/ecdh/boards/nrf54l09pdk_nrf54l09_cpuapp.conf b/samples/crypto/ecdh/boards/nrf54l09pdk_nrf54l09_cpuapp.conf new file mode 100644 index 000000000000..fb825d567f3a --- /dev/null +++ b/samples/crypto/ecdh/boards/nrf54l09pdk_nrf54l09_cpuapp.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/ecdsa/boards/nrf54l09pdk_nrf54l09_cpuapp.conf b/samples/crypto/ecdsa/boards/nrf54l09pdk_nrf54l09_cpuapp.conf new file mode 100644 index 000000000000..fb825d567f3a --- /dev/null +++ b/samples/crypto/ecdsa/boards/nrf54l09pdk_nrf54l09_cpuapp.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/ecjpake/boards/nrf54l09pdk_nrf54l09_cpuapp.conf b/samples/crypto/ecjpake/boards/nrf54l09pdk_nrf54l09_cpuapp.conf new file mode 100644 index 000000000000..fb825d567f3a --- /dev/null +++ b/samples/crypto/ecjpake/boards/nrf54l09pdk_nrf54l09_cpuapp.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/ed25519ph/CMakeLists.txt b/samples/crypto/ed25519ph/CMakeLists.txt new file mode 100644 index 000000000000..a00c7ce31e71 --- /dev/null +++ b/samples/crypto/ed25519ph/CMakeLists.txt @@ -0,0 +1,14 @@ +# +# Copyright (c) 2021 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) + +project(ecdsa) + +target_sources(app PRIVATE + src/main.c) diff --git a/samples/crypto/ed25519ph/README.rst b/samples/crypto/ed25519ph/README.rst new file mode 100644 index 000000000000..0d4da80de094 --- /dev/null +++ b/samples/crypto/ed25519ph/README.rst @@ -0,0 +1,59 @@ +.. _crypto_ecdsa: + +Crypto: ECDSA +############# + +.. contents:: + :local: + :depth: 2 + +The ECDSA sample shows how to sign and verify messages using SHA-256 as the hashing algorithm and the secp256r1 curve. + +Requirements +************ + +The sample supports the following development kits: + +.. table-from-sample-yaml:: + +.. include:: /includes/tfm.txt + +Overview +******** + +The sample performs the following operations: + +1. Initialization: + + a. The Platform Security Architecture (PSA) API is initialized. + #. A random Elliptic Curve Cryptography (ECC) key pair is generated in the PSA crypto keystore for signing purposes. + #. The public key of the ECC key pair is exported to the application. + #. The exported public key is imported into the PSA crypto key storage to be used for verification. + +#. ECDSA signing and verification: + + a. Signing is performed using the private key of the ECC key pair. + #. The signature is verified using the exported public key. + +#. Cleanup: + + a. The key pair and public key are removed from the PSA crypto keystore. + +Building and running +******************** + +.. |sample path| replace:: :file:`samples/crypto/ecdsa` + +.. include:: /includes/build_and_run_ns.txt + +.. note:: + |54H_engb_2_8| + +Testing +======= + +After programming the sample to your development kit, complete the following steps to test it: + +1. |connect_terminal| +#. Compile and program the application. +#. Observe the logs from the application using a terminal emulator. diff --git a/samples/crypto/ed25519ph/boards/nrf52840dk_nrf52840.conf b/samples/crypto/ed25519ph/boards/nrf52840dk_nrf52840.conf new file mode 100644 index 000000000000..1506df21e88b --- /dev/null +++ b/samples/crypto/ed25519ph/boards/nrf52840dk_nrf52840.conf @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +# Using hardware crypto accelerator +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/ed25519ph/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/crypto/ed25519ph/boards/nrf5340dk_nrf5340_cpuapp.conf new file mode 100644 index 000000000000..1506df21e88b --- /dev/null +++ b/samples/crypto/ed25519ph/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +# Using hardware crypto accelerator +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/ed25519ph/boards/nrf5340dk_nrf5340_cpuapp_ns.conf b/samples/crypto/ed25519ph/boards/nrf5340dk_nrf5340_cpuapp_ns.conf new file mode 100644 index 000000000000..0b6c20e1aa11 --- /dev/null +++ b/samples/crypto/ed25519ph/boards/nrf5340dk_nrf5340_cpuapp_ns.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_TFM_PROFILE_TYPE_NOT_SET=y + +# Using hardware crypto accelerator +CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y diff --git a/samples/crypto/ed25519ph/boards/nrf5340dk_nrf5340_cpunet.conf b/samples/crypto/ed25519ph/boards/nrf5340dk_nrf5340_cpunet.conf new file mode 100644 index 000000000000..50008a7ca390 --- /dev/null +++ b/samples/crypto/ed25519ph/boards/nrf5340dk_nrf5340_cpunet.conf @@ -0,0 +1,14 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_PSA_CRYPTO_DRIVER_OBERON=y +CONFIG_PSA_CRYPTO_DRIVER_CC3XX=n + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 + +CONFIG_ENTROPY_GENERATOR=y diff --git a/samples/crypto/ed25519ph/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/crypto/ed25519ph/boards/nrf54h20dk_nrf54h20_cpuapp.conf new file mode 100644 index 000000000000..98a20e215e81 --- /dev/null +++ b/samples/crypto/ed25519ph/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -0,0 +1,19 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Disable Oberon PSA crypto drivers +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n + +# Enable PSA crypto from SSF client +CONFIG_PSA_SSF_CRYPTO_CLIENT=y +CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y + +# Disable Data Cache +CONFIG_DCACHE=n + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/ed25519ph/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/crypto/ed25519ph/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..1ca688cf9792 --- /dev/null +++ b/samples/crypto/ed25519ph/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&cpusec_cpuapp_ipc { + status = "okay"; +}; + +&cpuapp_ram0x_region { + status = "okay"; +}; + +&cpusec_bellboard { + status = "okay"; +}; + +&cpuapp_bellboard { + status = "okay"; +}; diff --git a/samples/crypto/ed25519ph/boards/nrf54l15dk_nrf54l05_cpuapp.conf b/samples/crypto/ed25519ph/boards/nrf54l15dk_nrf54l05_cpuapp.conf new file mode 100644 index 000000000000..fb825d567f3a --- /dev/null +++ b/samples/crypto/ed25519ph/boards/nrf54l15dk_nrf54l05_cpuapp.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/ed25519ph/boards/nrf54l15dk_nrf54l10_cpuapp.conf b/samples/crypto/ed25519ph/boards/nrf54l15dk_nrf54l10_cpuapp.conf new file mode 100644 index 000000000000..fb825d567f3a --- /dev/null +++ b/samples/crypto/ed25519ph/boards/nrf54l15dk_nrf54l10_cpuapp.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/ed25519ph/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/crypto/ed25519ph/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..fb825d567f3a --- /dev/null +++ b/samples/crypto/ed25519ph/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/ed25519ph/boards/nrf9151dk_nrf9151.conf b/samples/crypto/ed25519ph/boards/nrf9151dk_nrf9151.conf new file mode 100644 index 000000000000..1506df21e88b --- /dev/null +++ b/samples/crypto/ed25519ph/boards/nrf9151dk_nrf9151.conf @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +# Using hardware crypto accelerator +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/ed25519ph/boards/nrf9151dk_nrf9151_ns.conf b/samples/crypto/ed25519ph/boards/nrf9151dk_nrf9151_ns.conf new file mode 100644 index 000000000000..0b6c20e1aa11 --- /dev/null +++ b/samples/crypto/ed25519ph/boards/nrf9151dk_nrf9151_ns.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_TFM_PROFILE_TYPE_NOT_SET=y + +# Using hardware crypto accelerator +CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y diff --git a/samples/crypto/ed25519ph/boards/nrf9160dk_nrf9160.conf b/samples/crypto/ed25519ph/boards/nrf9160dk_nrf9160.conf new file mode 100644 index 000000000000..1506df21e88b --- /dev/null +++ b/samples/crypto/ed25519ph/boards/nrf9160dk_nrf9160.conf @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +# Using hardware crypto accelerator +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/ed25519ph/boards/nrf9160dk_nrf9160_ns.conf b/samples/crypto/ed25519ph/boards/nrf9160dk_nrf9160_ns.conf new file mode 100644 index 000000000000..0b6c20e1aa11 --- /dev/null +++ b/samples/crypto/ed25519ph/boards/nrf9160dk_nrf9160_ns.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_TFM_PROFILE_TYPE_NOT_SET=y + +# Using hardware crypto accelerator +CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y diff --git a/samples/crypto/ed25519ph/boards/nrf9161dk_nrf9161.conf b/samples/crypto/ed25519ph/boards/nrf9161dk_nrf9161.conf new file mode 100644 index 000000000000..1506df21e88b --- /dev/null +++ b/samples/crypto/ed25519ph/boards/nrf9161dk_nrf9161.conf @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +# Using hardware crypto accelerator +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/ed25519ph/boards/nrf9161dk_nrf9161_ns.conf b/samples/crypto/ed25519ph/boards/nrf9161dk_nrf9161_ns.conf new file mode 100644 index 000000000000..0b6c20e1aa11 --- /dev/null +++ b/samples/crypto/ed25519ph/boards/nrf9161dk_nrf9161_ns.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_TFM_PROFILE_TYPE_NOT_SET=y + +# Using hardware crypto accelerator +CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y diff --git a/samples/crypto/ed25519ph/prj.conf b/samples/crypto/ed25519ph/prj.conf new file mode 100644 index 000000000000..6eb6eb736d28 --- /dev/null +++ b/samples/crypto/ed25519ph/prj.conf @@ -0,0 +1,28 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +# The Zephyr CMSIS emulation assumes that ticks are ms, currently +CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 + +CONFIG_MAIN_STACK_SIZE=8192 +CONFIG_HEAP_MEM_POOL_SIZE=8192 + +# Enable logging +CONFIG_CONSOLE=y +CONFIG_LOG=y + +# Enable nordic security backend and PSA APIs +CONFIG_NRF_SECURITY=y +CONFIG_MBEDTLS_PSA_CRYPTO_C=y + +CONFIG_PSA_WANT_ALG_ED25519PH=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT=y +CONFIG_PSA_WANT_ECC_TWISTED_EDWARDS_255=y +CONFIG_PSA_WANT_ALG_SHA_512=y + +# For key generation +CONFIG_PSA_WANT_GENERATE_RANDOM=y diff --git a/samples/crypto/ed25519ph/sample.yaml b/samples/crypto/ed25519ph/sample.yaml new file mode 100644 index 000000000000..64875bc9471f --- /dev/null +++ b/samples/crypto/ed25519ph/sample.yaml @@ -0,0 +1,69 @@ +sample: + description: | + This app provides an example of signing/verifying using ECDSA signatures + name: ECDSA example +tests: + sample.ecdsa.cc3xx: + sysbuild: true + tags: introduction psa cc3xx sysbuild ci_samples_crypto + platform_allow: > + nrf5340dk/nrf5340/cpuapp/ns nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160/ns + nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf9161dk/nrf9161 nrf9161dk/nrf9161/ns + nrf9151dk/nrf9151 nrf9151dk/nrf9151/ns + harness: console + harness_config: + type: multi_line + regex: + - ".*Example finished successfully!.*" + integration_platforms: + - nrf5340dk/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160/ns + - nrf9160dk/nrf9160 + - nrf52840dk/nrf52840 + - nrf9161dk/nrf9161 + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151 + - nrf9151dk/nrf9151/ns + sample.ecdsa.oberon: + sysbuild: true + tags: introduction psa oberon sysbuild ci_samples_crypto + platform_allow: > + nrf5340dk/nrf5340/cpunet + harness: console + harness_config: + type: multi_line + regex: + - .*Example finished successfully!.* + integration_platforms: + - nrf5340dk/nrf5340/cpunet + sample.ecdsa.cracen: + sysbuild: true + tags: introduction psa cracen sysbuild ci_samples_crypto + platform_allow: > + nrf54l15dk/nrf54l15/cpuapp + nrf54l15dk/nrf54l15/cpuapp/ns + nrf54l15dk/nrf54l10/cpuapp + nrf54l15dk/nrf54l05/cpuapp + harness: console + harness_config: + type: multi_line + regex: + - ".*Example finished successfully!.*" + integration_platforms: + - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l10/cpuapp + - nrf54l15dk/nrf54l05/cpuapp + sample.ecdsa.cracen.crypto_service: + sysbuild: true + tags: introduction psa cracen sysbuild crypto ci_samples_crypto + platform_allow: > + nrf54h20dk/nrf54h20/cpuapp + harness: console + harness_config: + type: multi_line + regex: + - ".*Example finished successfully!.*" + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp diff --git a/samples/crypto/ed25519ph/src/main.c b/samples/crypto/ed25519ph/src/main.c new file mode 100644 index 000000000000..8a36d5108ec7 --- /dev/null +++ b/samples/crypto/ed25519ph/src/main.c @@ -0,0 +1,377 @@ +/* + * Copyright (c) 2021 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_BUILD_WITH_TFM +#include +#endif + +#define APP_SUCCESS (0) +#define APP_ERROR (-1) +#define APP_SUCCESS_MESSAGE "Example finished successfully!" +#define APP_ERROR_MESSAGE "Example exited with error!" + +#define PRINT_HEX(p_label, p_text, len)\ + ({\ + LOG_INF("---- %s (len: %u): ----", p_label, len);\ + LOG_HEXDUMP_INF(p_text, len, "Content:");\ + LOG_INF("---- %s end ----", p_label);\ + }) + +LOG_MODULE_REGISTER(ed25519ph, LOG_LEVEL_DBG); + +/* ====================================================================== */ +/* Global variables/defines for the ed25519ph example */ + +#define NRF_CRYPTO_EXAMPLE_ed25519ph_TEXT_SIZE (100) + +#define NRF_CRYPTO_EXAMPLE_ed25519ph_PUBLIC_KEY_SIZE (32) +#define NRF_CRYPTO_EXAMPLE_ed25519ph_SIGNATURE_SIZE (64) +#define NRF_CRYPTO_EXAMPLE_ed25519ph_HASH_SIZE (64) + +/* Below text is used as plaintext for signing/verification */ +static uint8_t m_plain_text[NRF_CRYPTO_EXAMPLE_ed25519ph_TEXT_SIZE] = { + "Example string to demonstrate basic usage of ed25519ph." +}; + +static uint8_t m_plain_text_test[3] = { + 0x61, 0x62, 0x63 +}; + +static uint8_t m_pub_key[NRF_CRYPTO_EXAMPLE_ed25519ph_PUBLIC_KEY_SIZE]; + +static uint8_t m_pub_key_test[NRF_CRYPTO_EXAMPLE_ed25519ph_PUBLIC_KEY_SIZE] = +{ +0xec, 0x17, 0x2b, 0x93, 0xad, 0x5e, 0x56, 0x3b, 0xf4, 0x93, 0x2c, 0x70, 0xe1, 0x24, 0x50, 0x34, +0xc3, 0x54, 0x67, 0xef, 0x2e, 0xfd, 0x4d, 0x64, 0xeb, 0xf8, 0x19, 0x68, 0x34, 0x67, 0xe2, 0xbf +}; + +static uint8_t m_signature[NRF_CRYPTO_EXAMPLE_ed25519ph_SIGNATURE_SIZE]; +static uint8_t m_signature_test[NRF_CRYPTO_EXAMPLE_ed25519ph_SIGNATURE_SIZE] = { + 0x98, 0xa7, 0x02, 0x22, 0xf0, 0xb8, 0x12, 0x1a, 0xa9, 0xd3, 0x0f, 0x81, 0x3d, 0x68, 0x3f, 0x80, + 0x9e, 0x46, 0x2b, 0x46, 0x9c, 0x7f, 0xf8, 0x76, 0x39, 0x49, 0x9b, 0xb9, 0x4e, 0x6d, 0xae, 0x41, + 0x31, 0xf8, 0x50, 0x42, 0x46, 0x3c, 0x2a, 0x35, 0x5a, 0x20, 0x03, 0xd0, 0x62, 0xad, 0xf5, 0xaa, + 0xa1, 0x0b, 0x8c, 0x61, 0xe6, 0x36, 0x06, 0x2a, 0xaa, 0xd1, 0x1c, 0x2a, 0x26, 0x08, 0x34, 0x06 +}; + +static uint8_t m_hash[NRF_CRYPTO_EXAMPLE_ed25519ph_HASH_SIZE]; + +static psa_key_id_t keypair_id; +static psa_key_id_t pub_key_id; +/* ====================================================================== */ + +int crypto_init(void) +{ + psa_status_t status; + + /* Initialize PSA Crypto */ + status = psa_crypto_init(); + if (status != PSA_SUCCESS) { + LOG_INF("psa_crypto_init failed! (Error: %d)", status); + return APP_ERROR; + } + + return APP_SUCCESS; +} + +int crypto_finish(void) +{ + psa_status_t status; + + /* Destroy the key handle */ + status = psa_destroy_key(keypair_id); + if (status != PSA_SUCCESS) { + LOG_INF("psa_destroy_key failed! (Error: %d)", status); + return APP_ERROR; + } + + status = psa_destroy_key(pub_key_id); + if (status != PSA_SUCCESS) { + LOG_INF("psa_destroy_key failed! (Error: %d)", status); + return APP_ERROR; + } + + return APP_SUCCESS; +} + +int generate_ed25519ph_keypair(void) +{ + psa_status_t status; + size_t olen; + + LOG_INF("Generating random ed25519ph keypair..."); + + /* Configure the key attributes */ + psa_key_attributes_t key_attributes = PSA_KEY_ATTRIBUTES_INIT; + + /* Configure the key attributes */ + psa_set_key_usage_flags(&key_attributes, PSA_KEY_USAGE_SIGN_MESSAGE); + psa_set_key_lifetime(&key_attributes, PSA_KEY_LIFETIME_VOLATILE); + psa_set_key_algorithm(&key_attributes, PSA_ALG_ED25519PH); + psa_set_key_type(&key_attributes, PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_TWISTED_EDWARDS)); + psa_set_key_bits(&key_attributes, 255); + + /* Generate a random keypair. The keypair is not exposed to the application, + * we can use it to sign hashes. + */ + status = psa_generate_key(&key_attributes, &keypair_id); + if (status != PSA_SUCCESS) { + LOG_INF("psa_generate_key failed! (Error: %d)", status); + return APP_ERROR; + } + + /* Export the public key */ + status = psa_export_public_key(keypair_id, m_pub_key, sizeof(m_pub_key), &olen); + if (status != PSA_SUCCESS) { + LOG_INF("psa_export_public_key failed! (Error: %d)", status); + return APP_ERROR; + } + + /* Reset key attributes and free any allocated resources. */ + psa_reset_key_attributes(&key_attributes); + + return APP_SUCCESS; +} + +int import_ed25519ph_pub_key(void) +{ + /* Configure the key attributes */ + psa_key_attributes_t key_attributes = PSA_KEY_ATTRIBUTES_INIT; + psa_status_t status; + + /* Configure the key attributes */ + psa_set_key_usage_flags(&key_attributes, PSA_KEY_USAGE_VERIFY_MESSAGE); + psa_set_key_lifetime(&key_attributes, PSA_KEY_LIFETIME_VOLATILE); + psa_set_key_algorithm(&key_attributes, PSA_ALG_ED25519PH); + psa_set_key_type(&key_attributes, PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_FAMILY_TWISTED_EDWARDS)); + psa_set_key_bits(&key_attributes, 255); + + status = psa_import_key(&key_attributes, m_pub_key, sizeof(m_pub_key), &pub_key_id); + if (status != PSA_SUCCESS) { + LOG_INF("psa_import_key failed! (Error: %d)", status); + return APP_ERROR; + } + + /* Reset key attributes and free any allocated resources. */ + psa_reset_key_attributes(&key_attributes); + + return APP_SUCCESS; +} + +int import_ed25519ph_pub_key_test(void) +{ + /* Configure the key attributes */ + psa_key_attributes_t key_attributes = PSA_KEY_ATTRIBUTES_INIT; + psa_status_t status; + + /* Configure the key attributes */ + psa_set_key_usage_flags(&key_attributes, PSA_KEY_USAGE_VERIFY_MESSAGE); + psa_set_key_lifetime(&key_attributes, PSA_KEY_LIFETIME_VOLATILE); + psa_set_key_algorithm(&key_attributes, PSA_ALG_ED25519PH); + psa_set_key_type(&key_attributes, PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_FAMILY_TWISTED_EDWARDS)); + psa_set_key_bits(&key_attributes, 255); + + status = psa_import_key(&key_attributes, m_pub_key_test, sizeof(m_pub_key_test), &pub_key_id); + if (status != PSA_SUCCESS) { + LOG_INF("psa_import_key failed! (Error: %d)", status); + return APP_ERROR; + } + + /* Reset key attributes and free any allocated resources. */ + psa_reset_key_attributes(&key_attributes); + + return APP_SUCCESS; +} + +int sign_message(void) +{ + uint32_t output_len; + psa_status_t status; + + LOG_INF("Signing a message using ED25519PH..."); + + /* Compute the SHA512 hash*/ + status = psa_hash_compute(PSA_ALG_SHA_512, + m_plain_text, + sizeof(m_plain_text), + m_hash, + sizeof(m_hash), + &output_len); + if (status != PSA_SUCCESS) { + LOG_INF("psa_hash_compute failed! (Error: %d)", status); + return APP_ERROR; + } + + /* Sign the hash */ + status = psa_sign_hash(keypair_id, + PSA_ALG_ED25519PH, + m_hash, + sizeof(m_hash), + m_signature, + sizeof(m_signature), + &output_len); + if (status != PSA_SUCCESS) { + LOG_INF("psa_sign_hash failed! (Error: %d)", status); + return APP_ERROR; + } + + LOG_INF("Message signed successfully!"); + PRINT_HEX("Plaintext", m_plain_text, sizeof(m_plain_text)); + PRINT_HEX("SHA512 hash", m_hash, sizeof(m_hash)); + PRINT_HEX("Signature", m_signature, sizeof(m_signature)); + + return APP_SUCCESS; +} + +int sign_message_actual(void) +{ + size_t output_len; + psa_status_t status; + + LOG_INF("Signing a message using ED25519PH..."); + + /* Sign the hash */ + status = psa_sign_message(keypair_id, + PSA_ALG_ED25519PH, + m_plain_text, + sizeof(m_plain_text), + m_signature, + sizeof(m_signature), + &output_len); + if (status != PSA_SUCCESS) { + LOG_INF("psa_sign_hash failed! (Error: %d)", status); + return APP_ERROR; + } + + LOG_INF("Message signed successfully!"); + PRINT_HEX("Plaintext", m_plain_text, sizeof(m_plain_text)); + PRINT_HEX("Signature", m_signature, sizeof(m_signature)); + + return APP_SUCCESS; +} + +int hash_compute_test(void) +{ + uint32_t output_len; + psa_status_t status; + /* Compute the SHA512 hash*/ + status = psa_hash_compute(PSA_ALG_SHA_512, + m_plain_text_test, + sizeof(m_plain_text_test), + m_hash, + sizeof(m_hash), + &output_len); + if (status != PSA_SUCCESS) { + LOG_INF("psa_hash_compute failed! (Error: %d)", status); + return APP_ERROR; + } +} + +int verify_message(void) +{ + psa_status_t status; + + LOG_INF("Verifying ED25199PH signature..."); + + /* Verify the signature of the hash */ + status = psa_verify_hash(pub_key_id, + PSA_ALG_ED25519PH, + m_hash, + sizeof(m_hash), + m_signature, + sizeof(m_signature)); + if (status != PSA_SUCCESS) { + LOG_INF("psa_verify_hash failed! (Error: %d)", status); + return APP_ERROR; + } + + LOG_INF("Signature verification was successful!"); + + return APP_SUCCESS; +} + +int verify_message_actual(void) +{ + psa_status_t status; + + LOG_INF("Verifying ED25199PH signature..."); + + /* Verify the signature of the hash */ + status = psa_verify_message(pub_key_id, + PSA_ALG_ED25519PH, + m_plain_text, + sizeof(m_plain_text), + m_signature, + sizeof(m_signature)); + if (status != PSA_SUCCESS) { + LOG_INF("psa_verify_hash failed! (Error: %d)", status); + return APP_ERROR; + } + + LOG_INF("Signature verification was successful!"); + + return APP_SUCCESS; +} + +int main(void) +{ + int status; + + LOG_INF("Starting ed25519ph example..."); + + status = crypto_init(); + if (status != APP_SUCCESS) { + LOG_INF(APP_ERROR_MESSAGE); + return APP_ERROR; + } + + status = generate_ed25519ph_keypair(); + if (status != APP_SUCCESS) { + LOG_INF(APP_ERROR_MESSAGE); + return APP_ERROR; + } + + status = import_ed25519ph_pub_key(); + if (status != APP_SUCCESS) { + LOG_INF(APP_ERROR_MESSAGE); + return APP_ERROR; + } + +/* status = hash_compute_test(); + if (status != APP_SUCCESS) { + LOG_INF(APP_ERROR_MESSAGE); + return APP_ERROR; + } */ + + status = sign_message_actual(); + if (status != APP_SUCCESS) { + LOG_INF(APP_ERROR_MESSAGE); + return APP_ERROR; + } + + status = verify_message_actual(); + if (status != APP_SUCCESS) { + LOG_INF(APP_ERROR_MESSAGE); + return APP_ERROR; + } + + status = crypto_finish(); + if (status != APP_SUCCESS) { + LOG_INF(APP_ERROR_MESSAGE); + return APP_ERROR; + } + + LOG_INF(APP_SUCCESS_MESSAGE); + + return APP_SUCCESS; +} diff --git a/samples/crypto/eddsa/boards/nrf54l09pdk_nrf54l09_cpuapp.conf b/samples/crypto/eddsa/boards/nrf54l09pdk_nrf54l09_cpuapp.conf new file mode 100644 index 000000000000..fb825d567f3a --- /dev/null +++ b/samples/crypto/eddsa/boards/nrf54l09pdk_nrf54l09_cpuapp.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/hkdf/boards/nrf54l09pdk_nrf54l09_cpuapp.conf b/samples/crypto/hkdf/boards/nrf54l09pdk_nrf54l09_cpuapp.conf new file mode 100644 index 000000000000..fb825d567f3a --- /dev/null +++ b/samples/crypto/hkdf/boards/nrf54l09pdk_nrf54l09_cpuapp.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/hmac/boards/nrf54l09pdk_nrf54l09_cpuapp.conf b/samples/crypto/hmac/boards/nrf54l09pdk_nrf54l09_cpuapp.conf new file mode 100644 index 000000000000..fb825d567f3a --- /dev/null +++ b/samples/crypto/hmac/boards/nrf54l09pdk_nrf54l09_cpuapp.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/pbkdf2/boards/nrf54l09pdk_nrf54l09_cpuapp.conf b/samples/crypto/pbkdf2/boards/nrf54l09pdk_nrf54l09_cpuapp.conf new file mode 100644 index 000000000000..fb825d567f3a --- /dev/null +++ b/samples/crypto/pbkdf2/boards/nrf54l09pdk_nrf54l09_cpuapp.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/persistent_key_usage/boards/nrf54l09dk_nrf54l09_cpuapp.conf b/samples/crypto/persistent_key_usage/boards/nrf54l09dk_nrf54l09_cpuapp.conf new file mode 100644 index 000000000000..3f072ccf0621 --- /dev/null +++ b/samples/crypto/persistent_key_usage/boards/nrf54l09dk_nrf54l09_cpuapp.conf @@ -0,0 +1,21 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +# Using hardware crypto accelerator +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y + +# Use TRUSTED_STORAGE because this is a non-TF-M board target. +CONFIG_TRUSTED_STORAGE=y + +CONFIG_FLASH=y +CONFIG_FLASH_PAGE_LAYOUT=y +CONFIG_FLASH_MAP=y +CONFIG_ZMS=y +CONFIG_SETTINGS=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/rng/boards/nrf54l09pdk_nrf54l09_cpuapp.conf b/samples/crypto/rng/boards/nrf54l09pdk_nrf54l09_cpuapp.conf new file mode 100644 index 000000000000..fb825d567f3a --- /dev/null +++ b/samples/crypto/rng/boards/nrf54l09pdk_nrf54l09_cpuapp.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/rsa/boards/nrf54l09pdk_nrf54l09_cpuapp.conf b/samples/crypto/rsa/boards/nrf54l09pdk_nrf54l09_cpuapp.conf new file mode 100644 index 000000000000..fb825d567f3a --- /dev/null +++ b/samples/crypto/rsa/boards/nrf54l09pdk_nrf54l09_cpuapp.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/crypto/spake2p/boards/nrf54l09pdk_nrf54l09_cpuapp.conf b/samples/crypto/spake2p/boards/nrf54l09pdk_nrf54l09_cpuapp.conf new file mode 100644 index 000000000000..fb825d567f3a --- /dev/null +++ b/samples/crypto/spake2p/boards/nrf54l09pdk_nrf54l09_cpuapp.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y + +# Mbedtls configuration +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192