2021-05-09 22:56:51 -04:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2017-06-27 03:25:30 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
/* Provide a SHA256 API for bootloader_support code,
|
|
|
|
that can be used from bootloader or app code.
|
|
|
|
|
|
|
|
This header is available to source code in the bootloader & bootloader_support components only.
|
2019-03-25 02:15:14 -04:00
|
|
|
Use mbedTLS APIs or include esp32/sha.h to calculate SHA256 in IDF apps.
|
2017-06-27 03:25:30 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdlib.h>
|
2018-05-30 05:08:00 -04:00
|
|
|
#include "esp_err.h"
|
2017-06-27 03:25:30 -04:00
|
|
|
|
|
|
|
typedef void *bootloader_sha256_handle_t;
|
|
|
|
|
2019-07-16 05:33:30 -04:00
|
|
|
bootloader_sha256_handle_t bootloader_sha256_start(void);
|
2017-06-27 03:25:30 -04:00
|
|
|
|
|
|
|
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);
|