Merge pull request #4015 from embhorn/zd12221

Fix XMALLOC of sp_point_256 array
This commit is contained in:
David Garske
2021-05-07 13:11:41 -07:00
committed by GitHub
3 changed files with 9 additions and 9 deletions

View File

@ -32596,7 +32596,7 @@ static int sp_256_ecc_mulmod_fast_8(sp_point_256* r, const sp_point_256* g, cons
(void)heap; (void)heap;
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_SP_NO_MALLOC) #if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_SP_NO_MALLOC)
t = (sp_point_256*)XMALLOC(sizeof(sp_point_256) * 16 + 1, t = (sp_point_256*)XMALLOC(sizeof(sp_point_256) * (16 + 1),
heap, DYNAMIC_TYPE_ECC); heap, DYNAMIC_TYPE_ECC);
if (t == NULL) if (t == NULL)
err = MEMORY_E; err = MEMORY_E;
@ -41750,7 +41750,7 @@ static int sp_384_ecc_mulmod_fast_12(sp_point_384* r, const sp_point_384* g, con
(void)heap; (void)heap;
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_SP_NO_MALLOC) #if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_SP_NO_MALLOC)
t = (sp_point_384*)XMALLOC(sizeof(sp_point_384) * 16 + 1, t = (sp_point_384*)XMALLOC(sizeof(sp_point_384) * (16 + 1),
heap, DYNAMIC_TYPE_ECC); heap, DYNAMIC_TYPE_ECC);
if (t == NULL) if (t == NULL)
err = MEMORY_E; err = MEMORY_E;
@ -54451,7 +54451,7 @@ static int sp_1024_ecc_mulmod_fast_32(sp_point_1024* r, const sp_point_1024* g,
(void)heap; (void)heap;
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_SP_NO_MALLOC) #if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_SP_NO_MALLOC)
t = (sp_point_1024*)XMALLOC(sizeof(sp_point_1024) * 16 + 1, t = (sp_point_1024*)XMALLOC(sizeof(sp_point_1024) * (16 + 1),
heap, DYNAMIC_TYPE_ECC); heap, DYNAMIC_TYPE_ECC);
if (t == NULL) if (t == NULL)
err = MEMORY_E; err = MEMORY_E;

View File

@ -17891,7 +17891,7 @@ static int sp_256_ecc_mulmod_fast_8(sp_point_256* r, const sp_point_256* g, cons
(void)heap; (void)heap;
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_SP_NO_MALLOC) #if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_SP_NO_MALLOC)
t = (sp_point_256*)XMALLOC(sizeof(sp_point_256) * 16 + 1, t = (sp_point_256*)XMALLOC(sizeof(sp_point_256) * (16 + 1),
heap, DYNAMIC_TYPE_ECC); heap, DYNAMIC_TYPE_ECC);
if (t == NULL) if (t == NULL)
err = MEMORY_E; err = MEMORY_E;
@ -25530,7 +25530,7 @@ static int sp_384_ecc_mulmod_fast_12(sp_point_384* r, const sp_point_384* g, con
(void)heap; (void)heap;
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_SP_NO_MALLOC) #if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_SP_NO_MALLOC)
t = (sp_point_384*)XMALLOC(sizeof(sp_point_384) * 16 + 1, t = (sp_point_384*)XMALLOC(sizeof(sp_point_384) * (16 + 1),
heap, DYNAMIC_TYPE_ECC); heap, DYNAMIC_TYPE_ECC);
if (t == NULL) if (t == NULL)
err = MEMORY_E; err = MEMORY_E;
@ -36014,7 +36014,7 @@ static int sp_1024_ecc_mulmod_fast_32(sp_point_1024* r, const sp_point_1024* g,
(void)heap; (void)heap;
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_SP_NO_MALLOC) #if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_SP_NO_MALLOC)
t = (sp_point_1024*)XMALLOC(sizeof(sp_point_1024) * 16 + 1, t = (sp_point_1024*)XMALLOC(sizeof(sp_point_1024) * (16 + 1),
heap, DYNAMIC_TYPE_ECC); heap, DYNAMIC_TYPE_ECC);
if (t == NULL) if (t == NULL)
err = MEMORY_E; err = MEMORY_E;

View File

@ -18021,7 +18021,7 @@ static int sp_256_ecc_mulmod_fast_8(sp_point_256* r, const sp_point_256* g, cons
(void)heap; (void)heap;
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_SP_NO_MALLOC) #if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_SP_NO_MALLOC)
t = (sp_point_256*)XMALLOC(sizeof(sp_point_256) * 16 + 1, t = (sp_point_256*)XMALLOC(sizeof(sp_point_256) * (16 + 1),
heap, DYNAMIC_TYPE_ECC); heap, DYNAMIC_TYPE_ECC);
if (t == NULL) if (t == NULL)
err = MEMORY_E; err = MEMORY_E;
@ -25154,7 +25154,7 @@ static int sp_384_ecc_mulmod_fast_12(sp_point_384* r, const sp_point_384* g, con
(void)heap; (void)heap;
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_SP_NO_MALLOC) #if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_SP_NO_MALLOC)
t = (sp_point_384*)XMALLOC(sizeof(sp_point_384) * 16 + 1, t = (sp_point_384*)XMALLOC(sizeof(sp_point_384) * (16 + 1),
heap, DYNAMIC_TYPE_ECC); heap, DYNAMIC_TYPE_ECC);
if (t == NULL) if (t == NULL)
err = MEMORY_E; err = MEMORY_E;
@ -33853,7 +33853,7 @@ static int sp_1024_ecc_mulmod_fast_32(sp_point_1024* r, const sp_point_1024* g,
(void)heap; (void)heap;
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_SP_NO_MALLOC) #if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_SP_NO_MALLOC)
t = (sp_point_1024*)XMALLOC(sizeof(sp_point_1024) * 16 + 1, t = (sp_point_1024*)XMALLOC(sizeof(sp_point_1024) * (16 + 1),
heap, DYNAMIC_TYPE_ECC); heap, DYNAMIC_TYPE_ECC);
if (t == NULL) if (t == NULL)
err = MEMORY_E; err = MEMORY_E;