blob: 2a2e9ca1aced5e3654090db7daea6e621fed8209 [file] [log] [blame]
Almir Okatoeb6b7bf2021-09-07 17:06:35 -03001/*
2 * Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifdef CONFIG_ESP_USE_MBEDTLS
8
9#include <mbedtls/platform.h>
10#include <mbedtls/memory_buffer_alloc.h>
11
Gustavo Henrique Niheia3495102021-12-09 15:47:50 -030012#define CRYPTO_HEAP_SIZE 8192
Almir Okatoeb6b7bf2021-09-07 17:06:35 -030013
14static unsigned char memory_buf[CRYPTO_HEAP_SIZE];
15
16/*
17 * Initialize Mbed TLS to be able to use the local heap.
18 */
19void os_heap_init(void)
20{
21 mbedtls_memory_buffer_alloc_init(memory_buf, sizeof(memory_buf));
22}
23#else
24
25void os_heap_init(void)
26{
27}
28
29#endif