Skip to content

Commit

Permalink
Added extra memory buffer for wolfCrypt 5.7.0 RSA
Browse files Browse the repository at this point in the history
In TFM mode, there is an extra buffer used for "ASN" checks on RSA
  • Loading branch information
danielinux committed Apr 10, 2024
1 parent c64cb4e commit 68a974c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/xmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ static uint32_t sha_block[HASH_BLOCK_SIZE];
#define MP_SCHEME "TFM RSA"
#define MP_INT_TYPE_SIZE (sizeof(mp_int))
#define MP_MONT_REDUCE_BUF_SIZE (sizeof(fp_digit)*(FP_SIZE + 1))
#define ASNCHECK_BUF_SIZE (224)
static uint8_t asncheck_buf[ASNCHECK_BUF_SIZE];
static uint8_t mp_int_buffer0[MP_INT_TYPE_SIZE];
static uint8_t mp_int_buffer1[MP_INT_TYPE_SIZE * 3];
static uint8_t mp_int_buffer2[MP_INT_TYPE_SIZE];
Expand All @@ -335,6 +337,7 @@ static uint32_t sha_block[HASH_BLOCK_SIZE];
#if defined(WOLFBOOT_HASH_SHA256) || defined(WOLFBOOT_HASH_SHA384)
{ (uint8_t *)sha_block, HASH_BLOCK_SIZE * sizeof(uint32_t), 0 },
#endif
{ asncheck_buf, ASNCHECK_BUF_SIZE, 0 },
{ mp_int_buffer0, MP_INT_TYPE_SIZE, 0},
{ mp_int_buffer1, MP_INT_TYPE_SIZE * 3, 0},
{ mp_int_buffer2, MP_INT_TYPE_SIZE, 0},
Expand Down

0 comments on commit 68a974c

Please sign in to comment.