mirror of https://github.com/wolfSSL/wolfBoot.git
Fixed RSA+SMALL_STACK+FASTMATH
parent
6e9d65ebf3
commit
cb0f3ec3a3
|
@ -100,7 +100,11 @@ ifeq ($(SIGN),RSA4096)
|
||||||
CFLAGS+=-D"WOLFBOOT_SIGN_RSA4096" $(RSA_EXTRA_CFLAGS) \
|
CFLAGS+=-D"WOLFBOOT_SIGN_RSA4096" $(RSA_EXTRA_CFLAGS) \
|
||||||
-D"IMAGE_HEADER_SIZE=1024"
|
-D"IMAGE_HEADER_SIZE=1024"
|
||||||
ifeq ($(WOLFBOOT_SMALL_STACK),1)
|
ifeq ($(WOLFBOOT_SMALL_STACK),1)
|
||||||
|
ifneq ($(SPMATH),1)
|
||||||
|
STACK_USAGE?=5888
|
||||||
|
else
|
||||||
STACK_USAGE?=4096
|
STACK_USAGE?=4096
|
||||||
|
endif
|
||||||
else ifeq ($(WOLFTPM),0)
|
else ifeq ($(WOLFTPM),0)
|
||||||
STACK_USAGE?=18064
|
STACK_USAGE?=18064
|
||||||
else ifneq ($(SPMATH),1)
|
else ifneq ($(SPMATH),1)
|
||||||
|
|
|
@ -155,6 +155,7 @@ static struct xmalloc_slot xmalloc_pool[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
#elif defined WOLFBOOT_SIGN_ED25519
|
#elif defined WOLFBOOT_SIGN_ED25519
|
||||||
|
|
||||||
static uint32_t sha_block[HASH_BLOCK_SIZE];
|
static uint32_t sha_block[HASH_BLOCK_SIZE];
|
||||||
static uint32_t sha512_block[sizeof(word64) * 16];
|
static uint32_t sha512_block[sizeof(word64) * 16];
|
||||||
|
|
||||||
|
@ -167,6 +168,9 @@ static struct xmalloc_slot xmalloc_pool[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
#elif defined(WOLFBOOT_SIGN_RSA2048) || defined(WOLFBOOT_SIGN_RSA4096)
|
#elif defined(WOLFBOOT_SIGN_RSA2048) || defined(WOLFBOOT_SIGN_RSA4096)
|
||||||
|
|
||||||
|
static uint32_t sha_block[HASH_BLOCK_SIZE];
|
||||||
|
#ifndef USE_FAST_MATH
|
||||||
#ifdef WOLFBOOT_SIGN_RSA2048
|
#ifdef WOLFBOOT_SIGN_RSA2048
|
||||||
#ifdef WOLFSSL_SP_ARM_CORTEX_M_ASM
|
#ifdef WOLFSSL_SP_ARM_CORTEX_M_ASM
|
||||||
#define MPDIGIT_BUF0_SIZE (MP_DIGIT_SIZE * 64 * 5)
|
#define MPDIGIT_BUF0_SIZE (MP_DIGIT_SIZE * 64 * 5)
|
||||||
|
@ -184,8 +188,6 @@ static struct xmalloc_slot xmalloc_pool[] = {
|
||||||
static uint8_t mp_digit_buf1[MPDIGIT_BUF1_SIZE];
|
static uint8_t mp_digit_buf1[MPDIGIT_BUF1_SIZE];
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static uint32_t sha_block[HASH_BLOCK_SIZE];
|
|
||||||
static uint8_t mp_digit_buf0[MPDIGIT_BUF0_SIZE];
|
static uint8_t mp_digit_buf0[MPDIGIT_BUF0_SIZE];
|
||||||
static struct xmalloc_slot xmalloc_pool[] = {
|
static struct xmalloc_slot xmalloc_pool[] = {
|
||||||
#ifdef WOLFBOOT_HASH_SHA256
|
#ifdef WOLFBOOT_HASH_SHA256
|
||||||
|
@ -197,8 +199,31 @@ static struct xmalloc_slot xmalloc_pool[] = {
|
||||||
#endif
|
#endif
|
||||||
{ NULL, 0, 0}
|
{ NULL, 0, 0}
|
||||||
};
|
};
|
||||||
|
#else
|
||||||
|
#define MP_INT_SIZE (sizeof(mp_int))
|
||||||
|
#define MP_MONT_REDUCE_BUF_SIZE (sizeof(fp_digit)*(FP_SIZE + 1))
|
||||||
|
static uint8_t mp_int_buffer0[MP_INT_SIZE];
|
||||||
|
static uint8_t mp_int_buffer1[MP_INT_SIZE * 3];
|
||||||
|
static uint8_t mp_int_buffer2[MP_INT_SIZE];
|
||||||
|
static uint8_t mp_int_buffer3[MP_INT_SIZE];
|
||||||
|
static uint8_t mp_int_buffer4[MP_INT_SIZE * 5];
|
||||||
|
static uint8_t mp_mont_reduce_buffer[MP_MONT_REDUCE_BUF_SIZE];
|
||||||
|
static struct xmalloc_slot xmalloc_pool[] = {
|
||||||
|
#ifdef WOLFBOOT_HASH_SHA256
|
||||||
|
{ (uint8_t *)sha_block, WC_SHA256_BLOCK_SIZE * sizeof(uint32_t), 0 },
|
||||||
|
#endif
|
||||||
|
{ mp_int_buffer0, MP_INT_SIZE, 0},
|
||||||
|
{ mp_int_buffer1, MP_INT_SIZE * 3, 0},
|
||||||
|
{ mp_int_buffer2, MP_INT_SIZE, 0},
|
||||||
|
{ mp_int_buffer3, MP_INT_SIZE, 0},
|
||||||
|
{ mp_int_buffer4, MP_INT_SIZE * 5, 0},
|
||||||
|
{ mp_mont_reduce_buffer, MP_MONT_REDUCE_BUF_SIZE, 0 },
|
||||||
|
{ NULL, 0, 0}
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#elif defined WOLFBOOT_NO_SIGN
|
#elif defined WOLFBOOT_NO_SIGN
|
||||||
|
|
||||||
static uint32_t sha_block[HASH_BLOCK_SIZE];
|
static uint32_t sha_block[HASH_BLOCK_SIZE];
|
||||||
static struct xmalloc_slot xmalloc_pool[] = {
|
static struct xmalloc_slot xmalloc_pool[] = {
|
||||||
#ifdef WOLFBOOT_HASH_SHA256
|
#ifdef WOLFBOOT_HASH_SHA256
|
||||||
|
|
Loading…
Reference in New Issue