Skip to content

Commit c1138f0

Browse files
committed
bootutil: Add prototypes for crypto backend initialization API
Adds prototypes for: bootutil_crypto_backend_init bootutil_crypto_backend_deinit that will be expected to be provided by crypto backend in case when MCUBOOT_CRYPTO_BACKEND_HAS_INIT is enabled. Signed-off-by: Dominik Ermel <[email protected]>
1 parent 85aecf6 commit c1138f0

File tree

1 file changed

+33
-0
lines changed
  • boot/bootutil/include/bootutil/crypto

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* Copyright (c) 2025 Nordic Semiconductor ASA
5+
*/
6+
7+
#ifndef __BOOTUTIL_CRYPTO_BACKEND_H__
8+
#define __BOOTUTIL_CRYPTO_BACKEND_H__
9+
10+
#if defined(MCUBOOT_CRYPTO_BACKEND_HAS_INIT)
11+
/* Backend specific implementation for crypto subsystem
12+
* initialization.
13+
* MCUboot is supposed to call this function before
14+
* any crypto operation, including sha functions,
15+
* is executed.
16+
* Returns true on success. The function can also just fault
17+
* and topple entire boot process.
18+
*/
19+
bool bootutil_crypto_backend_init(void);
20+
21+
/* Backend specific implementation for crypto subsystem
22+
* deinitialization.
23+
* No more cryptographic operations are expected to be
24+
* invoked by MCUboot after this founction is called.
25+
* Returns true on success.
26+
*/
27+
bool bootutil_crypto_backend_deinit(void);
28+
#else
29+
#define bootutil_crypto_backend_init() (true)
30+
#define bootutil_crypto_backend_deinit() (true)
31+
#endif
32+
33+
#endif /* __BOOTUTIL_CRYPTO_BACKEND_H__ */

0 commit comments

Comments
 (0)