From 28f056f8c8303c2cf6091327ef779b9feae6a9cd Mon Sep 17 00:00:00 2001 From: "nilesh.kale" Date: Thu, 5 Dec 2024 17:14:25 +0530 Subject: [PATCH] fix(hal/test_apps): update efuse blcck numbers for ECDSA This commit updates the efuse block numbers to be burnt for hal/cryptp/test_apps --- components/hal/test_apps/crypto/README.md | 12 ++++++------ .../hal/test_apps/crypto/main/hal_crypto_common.h | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/components/hal/test_apps/crypto/README.md b/components/hal/test_apps/crypto/README.md index 4418b385ab..3924f05e26 100644 --- a/components/hal/test_apps/crypto/README.md +++ b/components/hal/test_apps/crypto/README.md @@ -74,12 +74,12 @@ This contains tests for the following features of the crypto peripherals: > **_NOTE:_** The verification tests for the HMAC, Digital Signature, ECDSA and XTS-AES peripherals would get exercised only by enabling the example config in an FPGA environment. # Burning the HMAC key -The HMAC tests need an HMAC key to be burned in the `BLOCK_KEY3` and `BLOCK_KEY4` of the efuses. As this verification application is independent of the efuse component, the user needs to manually burn the keys and their key purposes using `espefuse.py`. +The HMAC tests need an HMAC key to be burned in the `BLOCK_KEY4` and `BLOCK_KEY5` of the efuses. As this verification application is independent of the efuse component, the user needs to manually burn the keys and their key purposes using `espefuse.py`. ```bash -espefuse.py -p $ESPPORT burn_key BLOCK_KEY3 main/hmac/hmac_key.bin HMAC_DOWN_JTAG +espefuse.py -p $ESPPORT burn_key BLOCK_KEY4 main/hmac/hmac_key.bin HMAC_DOWN_JTAG -espefuse.py -p $ESPPORT burn_key BLOCK_KEY4 main/hmac/hmac_key.bin HMAC_UP +espefuse.py -p $ESPPORT burn_key BLOCK_KEY5 main/hmac/hmac_key.bin HMAC_UP ``` # Burning the HMAC keys for Digital Signature tests @@ -108,12 +108,12 @@ espefuse.py -p $ESPPORT burn_key BLOCK_KEY2 main/ds/keys/4096/ds_key3.bin HMAC_D By default, ECDSA tests are disabled. You can enable it after disabling HMAC tests using `idf.py menuconfig -> Test App Configuration -> Enable ECDSA Peripheral test cases` -The ECDSA tests need some ECDSA keys to be burned in the `BLOCK_KEY4` and `BLOCK_KEY5` of the efuses. As this verification application is independent of the efuse component, the user needs to manually burn the keys and their key purposes using `espefuse.py`. +The ECDSA tests need some ECDSA keys to be burned in the `BLOCK_KEY3` and `BLOCK_KEY4` of the efuses. As this verification application is independent of the efuse component, the user needs to manually burn the keys and their key purposes using `espefuse.py`. ```bash -espefuse.py -p $ESPPORT burn_key BLOCK_KEY4 main/ecdsa/ecdsa192_priv_key.pem ECDSA_KEY +espefuse.py -p $ESPPORT burn_key BLOCK_KEY3 main/ecdsa/ecdsa192_priv_key.pem ECDSA_KEY -espefuse.py -p $ESPPORT burn_key BLOCK_KEY5 main/ecdsa/ecdsa256_priv_key.pem ECDSA_KEY +espefuse.py -p $ESPPORT burn_key BLOCK_KEY4 main/ecdsa/ecdsa256_priv_key.pem ECDSA_KEY ``` # Burning the XTS-AES key diff --git a/components/hal/test_apps/crypto/main/hal_crypto_common.h b/components/hal/test_apps/crypto/main/hal_crypto_common.h index e47e8f8823..da8b073faa 100644 --- a/components/hal/test_apps/crypto/main/hal_crypto_common.h +++ b/components/hal/test_apps/crypto/main/hal_crypto_common.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Unlicense OR CC0-1.0 */ @@ -14,10 +14,10 @@ * HMAC and ECDSA testcases cannot run together as block used for burning keys are overlapped */ -// efuse key blocks for HMAC -#define HMAC_KEY_BLOCK_1 3 -#define HMAC_KEY_BLOCK_2 4 - // efuse key blocks for ECDSA -#define ECDSA_KEY_BLOCK_1 4 -#define ECDSA_KEY_BLOCK_2 5 +#define ECDSA_KEY_BLOCK_1 3 +#define ECDSA_KEY_BLOCK_2 4 + +// efuse key blocks for HMAC +#define HMAC_KEY_BLOCK_1 4 +#define HMAC_KEY_BLOCK_2 5