bootloader_sha.h 765 B

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