From f461b7692546127f58140be8eb97b750d4dc3134 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 5 Dec 2014 18:13:28 +0100 Subject: [PATCH] Allocate precomputation arrays on the heap --- src/ecmult_impl.h | 3 ++- src/group_impl.h | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ecmult_impl.h b/src/ecmult_impl.h index 445b815..690d525 100644 --- a/src/ecmult_impl.h +++ b/src/ecmult_impl.h @@ -43,13 +43,14 @@ static void secp256k1_ecmult_table_precomp_gej_var(secp256k1_gej_t *pre, const s static void secp256k1_ecmult_table_precomp_ge_var(secp256k1_ge_t *pre, const secp256k1_gej_t *a, int w) { const int table_size = 1 << (w-2); - secp256k1_gej_t prej[table_size]; + secp256k1_gej_t *prej = malloc(sizeof(secp256k1_gej_t) * table_size); prej[0] = *a; secp256k1_gej_t d; secp256k1_gej_double_var(&d, a); for (int i=1; i