tests: crypto: crypto_hash: Add support for Smartbond Pro DevKit
This commit should add support for the DA1469x Pro DevKit. Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
This commit is contained in:
parent
aca7f0d996
commit
816cf7051b
5 changed files with 43 additions and 8 deletions
9
tests/crypto/crypto_hash/boards/da1469x_dk_pro.overlay
Normal file
9
tests/crypto/crypto_hash/boards/da1469x_dk_pro.overlay
Normal file
|
@ -0,0 +1,9 @@
|
|||
/*
|
||||
* Copyright (c) 2023 Renesas Electronics Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
&crypto {
|
||||
status = "okay";
|
||||
};
|
|
@ -1,15 +1,9 @@
|
|||
CONFIG_ZTEST_STACK_SIZE=4096
|
||||
CONFIG_ZTEST=y
|
||||
CONFIG_LOG=y
|
||||
CONFIG_LOG_MODE_MINIMAL=y
|
||||
|
||||
CONFIG_MBEDTLS=y
|
||||
CONFIG_MBEDTLS_BUILTIN=y
|
||||
CONFIG_MBEDTLS_TEST=y
|
||||
|
||||
CONFIG_MBEDTLS_CIPHER_CCM_ENABLED=y
|
||||
CONFIG_MBEDTLS_CIPHER_GCM_ENABLED=y
|
||||
CONFIG_MBEDTLS_HEAP_SIZE=512
|
||||
CONFIG_MAIN_STACK_SIZE=4096
|
||||
|
||||
CONFIG_CRYPTO=y
|
||||
CONFIG_CRYPTO_MBEDTLS_SHIM=y
|
||||
CONFIG_CRYPTO_LOG_LEVEL_DBG=y
|
||||
|
|
10
tests/crypto/crypto_hash/prj_mtls_shim.conf
Normal file
10
tests/crypto/crypto_hash/prj_mtls_shim.conf
Normal file
|
@ -0,0 +1,10 @@
|
|||
CONFIG_MBEDTLS=y
|
||||
CONFIG_MBEDTLS_BUILTIN=y
|
||||
CONFIG_MBEDTLS_TEST=y
|
||||
|
||||
CONFIG_MBEDTLS_HEAP_SIZE=512
|
||||
|
||||
CONFIG_MBEDTLS_CIPHER_CCM_ENABLED=y
|
||||
CONFIG_MBEDTLS_CIPHER_GCM_ENABLED=y
|
||||
|
||||
CONFIG_CRYPTO_MBEDTLS_SHIM=y
|
|
@ -6,8 +6,16 @@
|
|||
|
||||
#include <zephyr/ztest.h>
|
||||
#include <zephyr/crypto/crypto.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/device.h>
|
||||
|
||||
#ifdef CONFIG_CRYPTO_MBEDTLS_SHIM
|
||||
#define CRYPTO_DRV_NAME CONFIG_CRYPTO_MBEDTLS_SHIM_DRV_NAME
|
||||
#elif DT_HAS_COMPAT_STATUS_OKAY(renesas_smartbond_crypto)
|
||||
#define CRYPTO_DEV_COMPAT renesas_smartbond_crypto
|
||||
#else
|
||||
#error "You need to enable one crypto device"
|
||||
#endif
|
||||
|
||||
/* Following test are part of mbedTLS */
|
||||
|
||||
|
@ -128,8 +136,21 @@ ZTEST_USER(crypto_hash, test_hash)
|
|||
{
|
||||
int ret;
|
||||
struct hash_ctx ctx;
|
||||
|
||||
#ifdef CRYPTO_DRV_NAME
|
||||
const struct device *dev = device_get_binding(CRYPTO_DRV_NAME);
|
||||
|
||||
if (!dev) {
|
||||
zassert(0, "Crypto device is not ready");
|
||||
}
|
||||
#else
|
||||
const struct device *dev = DEVICE_DT_GET_ONE(CRYPTO_DEV_COMPAT);
|
||||
|
||||
if (!device_is_ready(dev)) {
|
||||
zassert(0, "Crypto device is not ready");
|
||||
}
|
||||
#endif
|
||||
|
||||
ctx.flags = CAP_SYNC_OPS | CAP_SEPARATE_IO_BUFS;
|
||||
|
||||
ret = hash_begin_session(dev, &ctx, CRYPTO_HASH_ALGO_SHA256);
|
||||
|
|
|
@ -5,4 +5,5 @@ tests:
|
|||
- native_sim
|
||||
integration_platforms:
|
||||
- native_sim
|
||||
extra_args: EXTRA_CONF_FILE=prj_mtls_shim.conf
|
||||
tags: crypto
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue