-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/add_dma_suppport_for_aes_and_sha' into 'master'
feat(hal/testapps): Added AES and SHA testcases with DMA support Closes IDF-7986 and IDF-7987 See merge request espressif/esp-idf!26497
- Loading branch information
Showing
23 changed files
with
1,516 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
components/hal/test_apps/crypto/components/mbedtls/include/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# | ||
# The mbedtls component gets pulled in during the build(due to a dependency of component bootloader_support), | ||
# but we needed to avoid inclusion of mbedtls in this hal layer test app, thus creating a "dummy" mbedtls component. | ||
# This dummy mbedtls component will get the priority during the build stage and thus the "real" mbedtls component | ||
# does not get pulled. | ||
# | ||
idf_build_get_property(idf_target IDF_TARGET) | ||
idf_build_get_property(python PYTHON) | ||
|
||
set(mbedtls_srcs ".") | ||
set(mbedtls_include_dirs include) | ||
|
||
idf_component_register(SRCS "${mbedtls_srcs}" | ||
INCLUDE_DIRS "${mbedtls_include_dirs}") |
11 changes: 11 additions & 0 deletions
11
components/hal/test_apps/crypto/components/mbedtls/include/aes.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Unlicense OR CC0-1.0 | ||
*/ | ||
#define MBEDTLS_ERR_AES_INVALID_KEY_LENGTH -1 | ||
#define MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH -2 | ||
#define MBEDTLS_ERR_AES_BAD_INPUT_DATA -3 | ||
|
||
#define MBEDTLS_AES_ENCRYPT ESP_AES_ENCRYPT | ||
#define MBEDTLS_AES_DECRYPT ESP_AES_DECRYPT |
6 changes: 6 additions & 0 deletions
6
components/hal/test_apps/crypto/components/mbedtls/include/cipher.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Unlicense OR CC0-1.0 | ||
*/ | ||
typedef int mbedtls_cipher_id_t; |
6 changes: 6 additions & 0 deletions
6
components/hal/test_apps/crypto/components/mbedtls/include/error.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Unlicense OR CC0-1.0 | ||
*/ | ||
#define MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED -1 |
11 changes: 11 additions & 0 deletions
11
components/hal/test_apps/crypto/components/mbedtls/include/platform_util.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Unlicense OR CC0-1.0 | ||
*/ | ||
#include <stddef.h> | ||
|
||
static inline void mbedtls_platform_zeroize( void *buf, size_t len ) | ||
{ | ||
bzero(buf, len); | ||
} |
29 changes: 29 additions & 0 deletions
29
components/hal/test_apps/crypto/components/mbedtls/include/sha256.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Unlicense OR CC0-1.0 | ||
*/ | ||
#include <stddef.h> | ||
#include <stdint.h> | ||
|
||
typedef void *bootloader_sha256_handle_t; | ||
|
||
bootloader_sha256_handle_t bootloader_sha256_start(void); | ||
|
||
void bootloader_sha256_data(bootloader_sha256_handle_t handle, const void *data, size_t data_len); | ||
|
||
void bootloader_sha256_finish(bootloader_sha256_handle_t handle, uint8_t *digest); | ||
|
||
typedef void mbedtls_sha256_context; | ||
|
||
void mbedtls_sha256_init(mbedtls_sha256_context *ctx); | ||
|
||
void mbedtls_sha256_free(mbedtls_sha256_context *ctx); | ||
|
||
int mbedtls_sha256_starts(mbedtls_sha256_context *ctx, int is224); | ||
|
||
int mbedtls_sha256_update(mbedtls_sha256_context *ctx, | ||
const unsigned char *input, | ||
size_t ilen); | ||
int mbedtls_sha256_finish(mbedtls_sha256_context *ctx, | ||
unsigned char *output); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.