1 /* 2 * SPDX-License-Identifier: Apache-2.0 3 * 4 * Copyright (c) 2023 Nordic Semiconductor ASA 5 */ 6 7 #ifndef H_BOOT_SERIAL_ENCRYPTION_ 8 #define H_BOOT_SERIAL_ENCRYPTION_ 9 #include "bootutil/fault_injection_hardening.h" 10 11 /** 12 * Validate hash of a primary boot image doing on the fly decryption as well 13 * 14 * @param[in] fa_p flash area pointer 15 * @param[in] hdr boot image header pointer 16 * @param[in] buf buffer which is used for validating data 17 * @param[in] buf_size size of input buffer 18 * @param[in] start_off start offset inside of image (swap using offset only) 19 * 20 * @return FIH_SUCCESS on success, error code otherwise 21 */ 22 fih_ret 23 boot_image_validate_encrypted(const struct flash_area *fa_p, 24 struct image_header *hdr, uint8_t *buf, 25 uint16_t buf_size 26 #ifdef MCUBOOT_SWAP_USING_OFFSET 27 , uint32_t start_off 28 #endif 29 ); 30 31 /** 32 * Handle an encrypted firmware in the main flash. 33 * This will decrypt the image inplace 34 */ 35 int boot_handle_enc_fw(const struct flash_area *flash_area); 36 37 #endif 38