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 <sigvart.m@gmail.com>
This commit is contained in:
Sigvart Hovland 2020-10-28 14:40:09 +01:00 committed by Andrzej Puzdrowski
parent c0dbdd407c
commit 59f1d29c0c
3 changed files with 6 additions and 1 deletions

View File

@ -69,7 +69,7 @@ static inline void bootutil_ecdsa_p256_drop(bootutil_ecdsa_p256_context *ctx)
(void)ctx; (void)ctx;
} }
static inline int bootutil_ecdsa_p256_verify(bootutil_ecdsa_p256_context *ctx, const uint8_t *pk, const uint8_t *hash, const uint8_t *sig) static inline int bootutil_ecdsa_p256_verify(bootutil_ecdsa_p256_context *ctx, uint8_t *pk, uint8_t *hash, uint8_t *sig)
{ {
(void)ctx; (void)ctx;
return cc310_ecdsa_verify_secp256r1(hash, pk, sig, BOOTUTIL_CRYPTO_ECDSA_P256_HASH_SIZE); return cc310_ecdsa_verify_secp256r1(hash, pk, sig, BOOTUTIL_CRYPTO_ECDSA_P256_HASH_SIZE);

View File

@ -30,6 +30,9 @@
#ifdef MCUBOOT_SIGN_EC256 #ifdef MCUBOOT_SIGN_EC256
/*TODO: remove this after cypress port mbedtls to abstract crypto api */ /*TODO: remove this after cypress port mbedtls to abstract crypto api */
#ifdef MCUBOOT_USE_CC310
#define NUM_ECC_BYTES (256 / 8)
#endif
#if defined (MCUBOOT_USE_TINYCRYPT) || defined (MCUBOOT_USE_CC310) #if defined (MCUBOOT_USE_TINYCRYPT) || defined (MCUBOOT_USE_CC310)
#include "bootutil/sign_key.h" #include "bootutil/sign_key.h"

View File

@ -0,0 +1,2 @@
CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=y
CONFIG_BOOT_ECDSA_CC310=y