2021-09-08 04:06:35 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef CONFIG_ESP_USE_MBEDTLS
|
|
|
|
|
|
|
|
#include <mbedtls/platform.h>
|
|
|
|
#include <mbedtls/memory_buffer_alloc.h>
|
|
|
|
|
2021-12-10 02:47:50 +08:00
|
|
|
#define CRYPTO_HEAP_SIZE 8192
|
2021-09-08 04:06:35 +08:00
|
|
|
|
|
|
|
static unsigned char memory_buf[CRYPTO_HEAP_SIZE];
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Initialize Mbed TLS to be able to use the local heap.
|
|
|
|
*/
|
|
|
|
void os_heap_init(void)
|
|
|
|
{
|
|
|
|
mbedtls_memory_buffer_alloc_init(memory_buf, sizeof(memory_buf));
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
|
|
|
|
void os_heap_init(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|