1 /* 2 * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 #pragma once 7 8 /* Provide a SHA256 API for bootloader_support code, 9 that can be used from bootloader or app code. 10 11 This header is available to source code in the bootloader & bootloader_support components only. 12 Use mbedTLS APIs or include esp32/sha.h to calculate SHA256 in IDF apps. 13 */ 14 15 #include <stdint.h> 16 #include <stdlib.h> 17 #include "esp_err.h" 18 19 typedef void *bootloader_sha256_handle_t; 20 21 bootloader_sha256_handle_t bootloader_sha256_start(void); 22 23 void bootloader_sha256_data(bootloader_sha256_handle_t handle, const void *data, size_t data_len); 24 25 void bootloader_sha256_finish(bootloader_sha256_handle_t handle, uint8_t *digest); 26