blob: 9b9d55b075943f89fde20e201cc802b2ad347cd4 [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
12#define CRYPTO_HEAP_SIZE 16384
13
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