Skip to content

Commit c710fe9

Browse files
committed
Fixed xmalloc pools for new wolfSSL ECC+SMALLSTACK
1 parent f62dc72 commit c710fe9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/xmalloc.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,10 @@ struct xmalloc_slot {
171171
#define MP_CURVE_FIELD_COUNT_SIZE (380)
172172
#ifndef _LP64
173173
#define ECC_POINT_SIZE (232)
174+
#define MP_INT_BUFFER_SIZE_1 (MP_INT_TYPE_SIZE * 6)
174175
#else
175176
#define ECC_POINT_SIZE (320)
176-
#define MP_INT_BUFFER_SIZE_1 (MP_INT_TYPE_SIZE * 5)
177+
#define MP_INT_BUFFER_SIZE_1 (MP_INT_TYPE_SIZE * 6)
177178
#endif
178179
#define MP_INT_BUFFER_SIZE (MP_INT_TYPE_SIZE * 6)
179180
#define MP_DIGIT_BUFFER_MONT_SIZE (sizeof(fp_digit)*(FP_SIZE + 1))
@@ -186,8 +187,11 @@ struct xmalloc_slot {
186187
#define ECC_POINT_SIZE (412)
187188
#else
188189
#define ECC_POINT_SIZE (512)
190+
#define MP_INT_BUFFER_SIZE (MP_INT_TYPE_SIZE * 6)
189191
#endif
192+
#ifndef MP_INT_BUFFER_SIZE
190193
#define MP_INT_BUFFER_SIZE (MP_INT_TYPE_SIZE * 5)
194+
#endif
191195
#define MP_INT_BUFFER_SIZE_1 (MP_INT_TYPE_SIZE * 6)
192196
#define MP_DIGIT_BUFFER_MONT_SIZE (sizeof(fp_digit)*(FP_SIZE + 1))
193197
#endif
@@ -199,8 +203,11 @@ struct xmalloc_slot {
199203
#define ECC_POINT_SIZE (520)
200204
#else
201205
#define ECC_POINT_SIZE (608)
206+
#define MP_INT_BUFFER_SIZE (MP_INT_TYPE_SIZE * 6)
202207
#endif
208+
#ifndef MP_INT_BUFFER_SIZE
203209
#define MP_INT_BUFFER_SIZE (MP_INT_TYPE_SIZE * 5)
210+
#endif
204211
#define MP_INT_BUFFER_SIZE_1 (MP_INT_TYPE_SIZE * 6)
205212
#define MP_DIGIT_BUFFER_MONT_SIZE (sizeof(fp_digit)*(FP_SIZE + 1))
206213
#endif

0 commit comments

Comments
 (0)