Skip to content

Commit 59f1d29

Browse files
sigvartmhnvlsianpu
authored andcommitted
bootutil: ecdsa: Fix CC310 for nRF devices
This contains fixes for CC310 for nRF devices using the nrfxlib. Removed some const for compilation warnings and added `NUM_ECC_BYTES` define. Signed-off-by: Sigvart Hovland <[email protected]>
1 parent c0dbdd4 commit 59f1d29

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

boot/bootutil/include/bootutil/crypto/ecdsa_p256.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static inline void bootutil_ecdsa_p256_drop(bootutil_ecdsa_p256_context *ctx)
6969
(void)ctx;
7070
}
7171

72-
static inline int bootutil_ecdsa_p256_verify(bootutil_ecdsa_p256_context *ctx, const uint8_t *pk, const uint8_t *hash, const uint8_t *sig)
72+
static inline int bootutil_ecdsa_p256_verify(bootutil_ecdsa_p256_context *ctx, uint8_t *pk, uint8_t *hash, uint8_t *sig)
7373
{
7474
(void)ctx;
7575
return cc310_ecdsa_verify_secp256r1(hash, pk, sig, BOOTUTIL_CRYPTO_ECDSA_P256_HASH_SIZE);

boot/bootutil/src/image_ec256.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030

3131
#ifdef MCUBOOT_SIGN_EC256
3232
/*TODO: remove this after cypress port mbedtls to abstract crypto api */
33+
#ifdef MCUBOOT_USE_CC310
34+
#define NUM_ECC_BYTES (256 / 8)
35+
#endif
3336
#if defined (MCUBOOT_USE_TINYCRYPT) || defined (MCUBOOT_USE_CC310)
3437
#include "bootutil/sign_key.h"
3538

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=y
2+
CONFIG_BOOT_ECDSA_CC310=y

0 commit comments

Comments
 (0)