mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
feat(protocomm): Migrate to PSA api interface
This commit is contained in:
committed by
Ashish Sharma
parent
72a2f0b9aa
commit
574a60289d
@@ -21,12 +21,17 @@ uint32_t esp_core_dump_elf_version(void) __attribute__((alias("core_dump_sha_ver
|
||||
|
||||
static void core_dump_sha256_start(core_dump_sha_ctx_t *sha_ctx)
|
||||
{
|
||||
psa_hash_operation_init(sha_ctx->ctx);
|
||||
sha_ctx->ctx = psa_hash_operation_init();
|
||||
psa_hash_setup(&sha_ctx->ctx, PSA_ALG_SHA_256);
|
||||
}
|
||||
|
||||
static void core_dump_sha256_update(core_dump_sha_ctx_t *sha_ctx, const void *data, size_t data_len)
|
||||
{
|
||||
#if CONFIG_MBEDTLS_HARDWARE_SHA
|
||||
mbedtls_psa_hash_operation_t *op = &sha_ctx->ctx.MBEDTLS_PRIVATE(ctx).mbedtls_ctx;
|
||||
mbedtls_sha256_context *ctx = &op->MBEDTLS_PRIVATE(ctx).sha256;
|
||||
ctx->mode = ESP_MBEDTLS_SHA256_SOFTWARE;
|
||||
#endif /* (CONFIG_MBEDTLS_HARDWARE_SHA) */
|
||||
psa_hash_update(&sha_ctx->ctx, data, data_len);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ list(APPEND priv_includes "${espcoredump_dir}/include_core_dump")
|
||||
# list(APPEND SRCS "${espcoredump_dir}/src/core_dump_sha.c")
|
||||
idf_component_register(SRCS ${SRCS}
|
||||
INCLUDE_DIRS "."
|
||||
PRIV_REQUIRES unity espcoredump
|
||||
PRIV_REQUIRES unity
|
||||
PRIV_INCLUDE_DIRS ${priv_includes}
|
||||
REQUIRES mbedtls espcoredump
|
||||
WHOLE_ARCHIVE)
|
||||
|
||||
@@ -12,6 +12,12 @@ def test_coredump(dut: Dut) -> None:
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize('config', ['checksum_sha256',], indirect=True)
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'checksum_sha256',
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
def test_coredump_sha(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
Reference in New Issue
Block a user