Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DNM] Upmerge TF-M v2.1.0 Mbed TLS v3.6.0 #333

Open
wants to merge 139 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
139 commits
Select commit Hold shift + click to select a range
195145b
[nrf noup] github: Add a commit tags check workflow
carlescufi Oct 10, 2023
312ba86
[nrf noup] zephyr: Remove duplication from cmake
sigvartmh Mar 26, 2019
cd1c995
[nrf noup] zephyr: add 'minimal' configuration files
mbolivar-nordic Sep 3, 2021
a53f78d
[nrf noup] boards: add support for Thingy:91
bjda Sep 20, 2019
0faa8b2
[nrf noup] boot: Add shared crypto for ECDSA and SHA
sigvartmh Feb 14, 2019
a42e9cc
[nrf noup] crypto: ecdsa: Add required signature decoding
de-nordic Apr 21, 2023
895c76b
[nrf noup] crypto: ecdsa: Fix shared crypto MCUBoot EXT_ABI
sigvartmh Oct 10, 2023
ff53382
[nrf noup] zephyr: Set at least provide EXT_API
Vge0rge Nov 8, 2021
cffdc52
[nrf noup] zephyr: Restore default RTC user channel count
Damian-Nordic Mar 21, 2022
916a9dc
[nrf noup] boards: thingy91x: add board config
maxd-nordic Dec 8, 2023
9555ca7
[nrf noup] treewide: add NCS partition manager support
SebastianBoe Dec 12, 2018
cab8ef9
[nrf noup] boot: nrf53-specific customizations
sigvartmh Aug 27, 2020
c033da0
[nrf noup] zephyr: clean peripherals state before boot
nvlsianpu Feb 27, 2020
cc6103b
[nrf noup] zephyr: Clean up non-secure RAM if enabled
sigvartmh Jan 6, 2023
a3d0772
[nrf noup] loader: Fix reading reset addr to support ext flash
chrta Feb 10, 2022
6f1ba91
[nrf noup] zephyr: Fix path variables
nordicjm Jul 11, 2023
5fe56c9
[nrf noup] loader: Do not check reset vector for XIP image
de-nordic Sep 22, 2023
33effae
[nrf noup] zephyr: Add RAM flash configuration to cache for sysbuild
nordicjm Sep 18, 2023
62b5dc1
[nrf noup] zephyr: Boot even if EXT_ABI is not provided
sigvartmh Oct 17, 2023
b045778
[nrf noup] loader: Add firmware version check downgrade prevention
sigvartmh Sep 27, 2023
7377421
[nrf noup] boards: thingy53: disable GPIO ISR support
nika-nordic Oct 9, 2023
0fcc1f8
[nrf noup] boot/zephyr/boards: nRF54l15pdk ext flash cfg
nvlsianpu Apr 11, 2024
843ee8e
[nrf noup] loader: work-around for multi-image builds
sigvartmh Mar 30, 2021
f15d384
[nrf noup] loader: Fix missing PCD define check
nordicjm Aug 31, 2023
ce42cac
[nrf noup] boot: Add support for NSIB and multi-image
sigvartmh May 31, 2023
6cecb1c
[nrf noup] sysflash: Move partition manager definitions to pm_sysflash.h
de-nordic Aug 10, 2023
d2d11bf
[nrf noup] sysflash: Add support for three images
de-nordic Aug 11, 2023
ee67c04
[nrf noup] loader: introduced cleanup of unusable secondary slot
nvlsianpu Feb 15, 2024
ec59c38
[nrf noup] boards: nrf54l15: Disable FPROTECT
gchwier Apr 16, 2024
3853d26
[nrf noup] loader: remove cleanup for direct xip mode
gchwier May 17, 2024
b305c3d
[nrf noup] zephyr: Clean up non-secure RAM if enabled
de-nordic Apr 19, 2024
826a407
[nrf noup] boot/zephyr/boards: nrf54l15pdk ext-flash partition
nvlsianpu Apr 15, 2024
0656a67
[nrf noup] boot/zephyr/boards: nrf54l15pdk ext-flash update
nvlsianpu May 20, 2024
152f641
[nrf noup] boards: thingy91x: enable serial recovery
maxd-nordic Mar 12, 2024
f0a0c50
[nrf noup] boot: zephyr: Disable boot banner if NCS_BOOT_BANNER is used
rlubos May 17, 2024
f3ae1af
[nrf noup] boot/zephyr: fix fw_info search
nvlsianpu May 27, 2024
0f317a2
[nrf noup] Revert of zephyr: arm: Update reading the flash image rese…
de-nordic May 28, 2024
cc42516
[nrf noup] zephyr: disabled EXT_API_ATLEAST_OPTIONAL
nvlsianpu Jun 3, 2024
4f84ba9
[nrf noup] zephyr/boards: fix nrf54l15pdk ext flash dts overlay
nvlsianpu Jun 5, 2024
d639f90
[nrf noup] boot: zephyr: Add NCS boot banner
nordicjm Jun 11, 2024
d9fe011
[nrf noup] boot/../loader: skip downgrade prevention for s1/s0
nvlsianpu Jun 13, 2024
daf2946
[nrf noup] boot/../loader: reboot after updating s0/s1
nvlsianpu Jun 18, 2024
e66169a
[nrf noup] Remove secure boot debug Kconfig
nordicjm Sep 4, 2024
5db1981
[nrf noup] bootutil: loader: Fix netcore address checking
nordicjm Aug 29, 2024
9ac6f76
[nrf fromtree] boot: zephyr: boards: Add nrf54l15dk configuration
nvlsianpu Sep 16, 2024
f30dce1
[nrf noup] boards: nrf54l15dk: Disable FPROTECT
nvlsianpu Sep 18, 2024
14c37eb
Revert "[nrf noup] boards: nrf54l15dk: Disable FPROTECT"
bjarki-andreasen Sep 19, 2024
254b21e
Revert "[nrf fromtree] boot: zephyr: boards: Add nrf54l15dk configura…
bjarki-andreasen Sep 19, 2024
cdaa05d
Revert "[nrf noup] bootutil: loader: Fix netcore address checking"
bjarki-andreasen Sep 19, 2024
879598e
Revert "[nrf noup] Remove secure boot debug Kconfig"
bjarki-andreasen Sep 19, 2024
d5834c4
Revert "[nrf noup] boot/../loader: reboot after updating s0/s1"
bjarki-andreasen Sep 19, 2024
17434f7
Revert "[nrf noup] boot/../loader: skip downgrade prevention for s1/s0"
bjarki-andreasen Sep 19, 2024
9a3d14b
Revert "[nrf noup] boot: zephyr: Add NCS boot banner"
bjarki-andreasen Sep 19, 2024
b67fa57
Revert "[nrf noup] zephyr/boards: fix nrf54l15pdk ext flash dts overlay"
bjarki-andreasen Sep 19, 2024
8d978d9
Revert "[nrf noup] zephyr: disabled EXT_API_ATLEAST_OPTIONAL"
bjarki-andreasen Sep 19, 2024
12866a0
Revert "[nrf noup] Revert of zephyr: arm: Update reading the flash im…
bjarki-andreasen Sep 19, 2024
e065740
Revert "[nrf noup] boot/zephyr: fix fw_info search"
bjarki-andreasen Sep 19, 2024
9758453
Revert "[nrf noup] boot: zephyr: Disable boot banner if NCS_BOOT_BANN…
bjarki-andreasen Sep 19, 2024
c39e7e5
Revert "[nrf noup] boards: thingy91x: enable serial recovery"
bjarki-andreasen Sep 19, 2024
cd57172
Revert "[nrf noup] boot/zephyr/boards: nrf54l15pdk ext-flash update"
bjarki-andreasen Sep 19, 2024
1d00f3b
Revert "[nrf noup] boot/zephyr/boards: nrf54l15pdk ext-flash partition"
bjarki-andreasen Sep 19, 2024
ecabc48
Revert "[nrf noup] zephyr: Clean up non-secure RAM if enabled"
bjarki-andreasen Sep 19, 2024
9a758f0
Revert "[nrf noup] loader: remove cleanup for direct xip mode"
bjarki-andreasen Sep 19, 2024
2b1d81f
Revert "[nrf noup] boards: nrf54l15: Disable FPROTECT"
bjarki-andreasen Sep 19, 2024
0217a50
Revert "[nrf noup] loader: introduced cleanup of unusable secondary s…
bjarki-andreasen Sep 19, 2024
636f0be
Revert "[nrf noup] sysflash: Add support for three images"
bjarki-andreasen Sep 19, 2024
a972d77
Revert "[nrf noup] sysflash: Move partition manager definitions to pm…
bjarki-andreasen Sep 19, 2024
1886ad5
Revert "[nrf noup] boot: Add support for NSIB and multi-image"
bjarki-andreasen Sep 19, 2024
51f2e17
Revert "[nrf noup] loader: Fix missing PCD define check"
bjarki-andreasen Sep 19, 2024
fee4ff2
Revert "[nrf noup] loader: work-around for multi-image builds"
bjarki-andreasen Sep 19, 2024
924b18c
Revert "[nrf noup] boot/zephyr/boards: nRF54l15pdk ext flash cfg"
bjarki-andreasen Sep 19, 2024
7cc52cb
Revert "[nrf noup] boards: thingy53: disable GPIO ISR support"
bjarki-andreasen Sep 19, 2024
39df53b
Revert "[nrf noup] loader: Add firmware version check downgrade preve…
bjarki-andreasen Sep 19, 2024
77c128c
Revert "[nrf noup] zephyr: Boot even if EXT_ABI is not provided"
bjarki-andreasen Sep 19, 2024
404e9d9
Revert "[nrf noup] zephyr: Add RAM flash configuration to cache for s…
bjarki-andreasen Sep 19, 2024
4f6279a
Revert "[nrf noup] loader: Do not check reset vector for XIP image"
bjarki-andreasen Sep 19, 2024
6b4864b
Revert "[nrf noup] zephyr: Fix path variables"
bjarki-andreasen Sep 19, 2024
a498052
Revert "[nrf noup] loader: Fix reading reset addr to support ext flash"
bjarki-andreasen Sep 19, 2024
f84c7f6
Revert "[nrf noup] zephyr: Clean up non-secure RAM if enabled"
bjarki-andreasen Sep 19, 2024
6be813c
Revert "[nrf noup] zephyr: clean peripherals state before boot"
bjarki-andreasen Sep 19, 2024
8413872
Revert "[nrf noup] boot: nrf53-specific customizations"
bjarki-andreasen Sep 19, 2024
54b951f
Revert "[nrf noup] treewide: add NCS partition manager support"
bjarki-andreasen Sep 19, 2024
19a9309
Revert "[nrf noup] boards: thingy91x: add board config"
bjarki-andreasen Sep 19, 2024
970b83f
Revert "[nrf noup] zephyr: Restore default RTC user channel count"
bjarki-andreasen Sep 19, 2024
5933acc
Revert "[nrf noup] zephyr: Set at least provide EXT_API"
bjarki-andreasen Sep 19, 2024
e93083e
Revert "[nrf noup] crypto: ecdsa: Fix shared crypto MCUBoot EXT_ABI"
bjarki-andreasen Sep 19, 2024
8032f93
Revert "[nrf noup] crypto: ecdsa: Add required signature decoding"
bjarki-andreasen Sep 19, 2024
18941d5
Revert "[nrf noup] boot: Add shared crypto for ECDSA and SHA"
bjarki-andreasen Sep 19, 2024
5f31e28
Revert "[nrf noup] boards: add support for Thingy:91"
bjarki-andreasen Sep 19, 2024
de8d3ec
Revert "[nrf noup] zephyr: add 'minimal' configuration files"
bjarki-andreasen Sep 19, 2024
00e4af0
Revert "[nrf noup] zephyr: Remove duplication from cmake"
bjarki-andreasen Sep 19, 2024
2c97291
Revert "[nrf noup] github: Add a commit tags check workflow"
bjarki-andreasen Sep 19, 2024
fec6187
[nrf mergeup] Merge upstream up to commit 84b56b61118a1140e1afcb8802e…
bjarki-andreasen Sep 19, 2024
cc9c02a
[nrf noup] github: Add a commit tags check workflow
carlescufi Oct 10, 2023
c6dde79
[nrf noup] zephyr: Remove duplication from cmake
sigvartmh Mar 26, 2019
9eb8204
[nrf noup] zephyr: add 'minimal' configuration files
mbolivar-nordic Sep 3, 2021
16db7e2
[nrf noup] boards: add support for Thingy:91
bjda Sep 20, 2019
4289111
[nrf noup] boot: Add shared crypto for ECDSA and SHA
sigvartmh Feb 14, 2019
805b843
[nrf noup] crypto: ecdsa: Add required signature decoding
de-nordic Apr 21, 2023
9f0b0db
[nrf noup] crypto: ecdsa: Fix shared crypto MCUBoot EXT_ABI
sigvartmh Oct 10, 2023
98603dd
[nrf noup] zephyr: Set at least provide EXT_API
Vge0rge Nov 8, 2021
c4e1abd
[nrf noup] zephyr: Restore default RTC user channel count
Damian-Nordic Mar 21, 2022
3d997e3
[nrf noup] boards: thingy91x: add board config
maxd-nordic Dec 8, 2023
03372e7
[nrf noup] treewide: add NCS partition manager support
SebastianBoe Dec 12, 2018
4ca1fa3
[nrf noup] boot: nrf53-specific customizations
sigvartmh Aug 27, 2020
0e3b4f9
[nrf noup] zephyr: clean peripherals state before boot
nvlsianpu Feb 27, 2020
cee85c9
[nrf noup] zephyr: Clean up non-secure RAM if enabled
sigvartmh Jan 6, 2023
c3e90d0
[nrf noup] loader: Fix reading reset addr to support ext flash
chrta Feb 10, 2022
d681d8f
[nrf noup] zephyr: Fix path variables
nordicjm Jul 11, 2023
68339ee
[nrf noup] loader: Do not check reset vector for XIP image
de-nordic Sep 22, 2023
9f7ec60
[nrf noup] zephyr: Add RAM flash configuration to cache for sysbuild
nordicjm Sep 18, 2023
6a5331b
[nrf noup] zephyr: Boot even if EXT_ABI is not provided
sigvartmh Oct 17, 2023
0657388
[nrf noup] loader: Add firmware version check downgrade prevention
sigvartmh Sep 27, 2023
e836116
[nrf noup] boards: thingy53: disable GPIO ISR support
nika-nordic Oct 9, 2023
7a0c70b
[nrf noup] boot/zephyr/boards: nRF54l15pdk ext flash cfg
nvlsianpu Apr 11, 2024
8bbfb6c
[nrf noup] loader: work-around for multi-image builds
sigvartmh Mar 30, 2021
ed8c353
[nrf noup] loader: Fix missing PCD define check
nordicjm Aug 31, 2023
4b9be0b
[nrf noup] boot: Add support for NSIB and multi-image
sigvartmh May 31, 2023
22665c0
[nrf noup] sysflash: Move partition manager definitions to pm_sysflash.h
de-nordic Aug 10, 2023
5e5529c
[nrf noup] sysflash: Add support for three images
de-nordic Aug 11, 2023
3375120
[nrf noup] loader: introduced cleanup of unusable secondary slot
nvlsianpu Feb 15, 2024
4ef1721
[nrf noup] boards: nrf54l15: Disable FPROTECT
gchwier Apr 16, 2024
783f835
[nrf noup] loader: remove cleanup for direct xip mode
gchwier May 17, 2024
c29ac42
[nrf noup] zephyr: Clean up non-secure RAM if enabled
de-nordic Apr 19, 2024
49fb5b9
[nrf noup] boot/zephyr/boards: nrf54l15pdk ext-flash partition
nvlsianpu Apr 15, 2024
4b54c03
[nrf noup] boot/zephyr/boards: nrf54l15pdk ext-flash update
nvlsianpu May 20, 2024
db54c65
[nrf noup] boards: thingy91x: enable serial recovery
maxd-nordic Mar 12, 2024
7d34324
[nrf noup] boot: zephyr: Disable boot banner if NCS_BOOT_BANNER is used
rlubos May 17, 2024
2ac833e
[nrf noup] boot/zephyr: fix fw_info search
nvlsianpu May 27, 2024
d110b8a
[nrf noup] Revert of zephyr: arm: Update reading the flash image rese…
de-nordic May 28, 2024
161624f
[nrf noup] zephyr: disabled EXT_API_ATLEAST_OPTIONAL
nvlsianpu Jun 3, 2024
c660483
[nrf noup] zephyr/boards: fix nrf54l15pdk ext flash dts overlay
nvlsianpu Jun 5, 2024
021446e
[nrf noup] boot: zephyr: Add NCS boot banner
nordicjm Jun 11, 2024
aae7aa8
[nrf noup] boot/../loader: skip downgrade prevention for s1/s0
nvlsianpu Jun 13, 2024
087bc2a
[nrf noup] boot/../loader: reboot after updating s0/s1
nvlsianpu Jun 18, 2024
bdc6c9d
[nrf noup] Remove secure boot debug Kconfig
nordicjm Sep 4, 2024
f19081b
[nrf noup] bootutil: loader: Fix netcore address checking
nordicjm Aug 29, 2024
622b015
[nrf noup] boards: nrf54l15dk: Disable FPROTECT
nvlsianpu Sep 18, 2024
8aebcf7
[nrf noup] boot/zephyr/Kconfig: conditionally disable BOOT_MAX_IMG_SE…
nvlsianpu Sep 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/commit-tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Commit tags

on: pull_request

jobs:
commit_tags:
runs-on: ubuntu-22.04
name: Run commit tags checks on patch series (PR)
steps:
- name: Update PATH for west
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Checkout the code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Install python dependencies
run: |
pip3 install setuptools
pip3 install wheel
pip3 install gitlint

- name: Run the commit tags
uses: nrfconnect/action-commit-tags@main
with:
target: '.'
baserev: origin/${{ github.base_ref }}
revrange: 'none'
64 changes: 58 additions & 6 deletions boot/bootutil/include/bootutil/crypto/ecdsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

#if (defined(MCUBOOT_USE_TINYCRYPT) + \
defined(MCUBOOT_USE_CC310) + \
defined(MCUBOOT_USE_NRF_EXTERNAL_CRYPTO) + \
defined(MCUBOOT_USE_PSA_OR_MBED_TLS)) != 1
#error "One crypto backend must be defined: either CC310/TINYCRYPT/MBED_TLS/PSA_CRYPTO"
#endif
Expand Down Expand Up @@ -70,12 +71,18 @@
#include "bootutil/sign_key.h"
#include "common.h"

#if defined(MCUBOOT_USE_NRF_EXTERNAL_CRYPTO)
#include <bl_crypto.h>
#define NUM_ECC_BYTES (256 / 8)
#endif /* MCUBOOT_USE_NRF_EXTERNAL_CRYPTO */

#ifdef __cplusplus
extern "C" {
#endif

#if (defined(MCUBOOT_USE_TINYCRYPT) || defined(MCUBOOT_USE_MBED_TLS) || \
defined(MCUBOOT_USE_CC310)) && !defined(MCUBOOT_USE_PSA_CRYPTO)
defined(MCUBOOT_USE_CC310) || defined(MCUBOOT_USE_NRF_EXTERNAL_CRYPTO)) \
&& !defined(MCUBOOT_USE_PSA_CRYPTO)
/*
* Declaring these like this adds NULL termination.
*/
Expand Down Expand Up @@ -127,8 +134,6 @@ static int bootutil_import_key(uint8_t **cp, uint8_t *end)
}
#endif /* (MCUBOOT_USE_TINYCRYPT || MCUBOOT_USE_MBED_TLS || MCUBOOT_USE_CC310) && !MCUBOOT_USE_PSA_CRYPTO */

#if defined(MCUBOOT_USE_TINYCRYPT)
#ifndef MCUBOOT_ECDSA_NEED_ASN1_SIG
/*
* cp points to ASN1 string containing an integer.
* Verify the tag, and that the length is 32 bytes. Helper function.
Expand Down Expand Up @@ -178,8 +183,8 @@ static int bootutil_decode_sig(uint8_t signature[NUM_ECC_BYTES * 2], uint8_t *cp
}
return 0;
}
#endif /* not MCUBOOT_ECDSA_NEED_ASN1_SIG */

#if defined(MCUBOOT_USE_TINYCRYPT)
typedef uintptr_t bootutil_ecdsa_context;
static inline void bootutil_ecdsa_init(bootutil_ecdsa_context *ctx)
{
Expand Down Expand Up @@ -248,16 +253,20 @@ static inline int bootutil_ecdsa_verify(bootutil_ecdsa_context *ctx,
{
(void)ctx;
(void)pk_len;
(void)sig_len;
(void)hash_len;
uint8_t dsig[2 * NUM_ECC_BYTES];

if (bootutil_decode_sig(dsig, sig, sig + sig_len)) {
return -1;
}

/* Only support uncompressed keys. */
if (pk[0] != 0x04) {
return -1;
}
pk++;

return cc310_ecdsa_verify_secp256r1(hash, pk, sig, BOOTUTIL_CRYPTO_ECDSA_P256_HASH_SIZE);
return cc310_ecdsa_verify_secp256r1(hash, pk, dsig, BOOTUTIL_CRYPTO_ECDSA_P256_HASH_SIZE);
}

static inline int bootutil_ecdsa_parse_public_key(bootutil_ecdsa_context *ctx,
Expand Down Expand Up @@ -613,6 +622,49 @@ static inline int bootutil_ecdsa_parse_public_key(bootutil_ecdsa_context *ctx,

#endif /* MCUBOOT_USE_MBED_TLS */

#if defined(MCUBOOT_USE_NRF_EXTERNAL_CRYPTO)
typedef uintptr_t bootutil_ecdsa_context;
static inline void bootutil_ecdsa_init(bootutil_ecdsa_context *ctx)
{
(void)ctx;
}

static inline void bootutil_ecdsa_drop(bootutil_ecdsa_context *ctx)
{
(void)ctx;
}

static inline int bootutil_ecdsa_verify(bootutil_ecdsa_context *ctx,
uint8_t *pk, size_t pk_len,
uint8_t *hash, size_t hash_len,
uint8_t *sig, size_t sig_len)
{
(void)ctx;
(void)pk_len;
(void)hash_len;
uint8_t dsig[2 * NUM_ECC_BYTES];

if (bootutil_decode_sig(dsig, sig, sig + sig_len)) {
return -1;
}

/* Only support uncompressed keys. */
if (pk[0] != 0x04) {
return -1;
}
pk++;

return bl_secp256r1_validate(hash, BOOTUTIL_CRYPTO_ECDSA_P256_HASH_SIZE, pk, dsig);
}

static inline int bootutil_ecdsa_parse_public_key(bootutil_ecdsa_context *ctx,
uint8_t **cp,uint8_t *end)
{
(void)ctx;
return bootutil_import_key(cp, end);
}
#endif /* MCUBOOT_USE_NRF_EXTERNAL_CRYPTO */

#ifdef __cplusplus
}
#endif
Expand Down
32 changes: 32 additions & 0 deletions boot/bootutil/include/bootutil/crypto/sha.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

#if (defined(MCUBOOT_USE_PSA_OR_MBED_TLS) + \
defined(MCUBOOT_USE_TINYCRYPT) + \
defined(MCUBOOT_USE_NRF_EXTERNAL_CRYPTO) + \
defined(MCUBOOT_USE_CC310)) != 1
#error "One crypto backend must be defined: either CC310/MBED_TLS/TINYCRYPT/PSA_CRYPTO"
#endif
Expand Down Expand Up @@ -206,6 +207,37 @@ static inline int bootutil_sha_finish(bootutil_sha_context *ctx,
}
#endif /* MCUBOOT_USE_CC310 */

#if defined(MCUBOOT_USE_NRF_EXTERNAL_CRYPTO)

#include <bl_crypto.h>

typedef bl_sha256_ctx_t bootutil_sha_context;

static inline void bootutil_sha_init(bootutil_sha_context *ctx)
{
bl_sha256_init(ctx);
}

static inline void bootutil_sha_drop(bootutil_sha_context *ctx)
{
(void)ctx;
}

static inline int bootutil_sha_update(bootutil_sha_context *ctx,
const void *data,
uint32_t data_len)
{
return bl_sha256_update(ctx, data, data_len);
}

static inline int bootutil_sha_finish(bootutil_sha_context *ctx,
uint8_t *output)
{
bl_sha256_finalize(ctx, output);
return 0;
}
#endif /* MCUBOOT_USE_NRF_EXTERNAL_CRYPTO */

#ifdef __cplusplus
}
#endif
Expand Down
Loading
Loading