From 62ec24bb56e6be82b3cf4840d547aaf9130b197b Mon Sep 17 00:00:00 2001 From: J08nY Date: Thu, 5 Oct 2023 20:23:40 +0200 Subject: Allocate more for sliding window array. --- pyecsca/codegen/bn/bn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pyecsca/codegen') diff --git a/pyecsca/codegen/bn/bn.c b/pyecsca/codegen/bn/bn.c index 9ad4d59..2cced3f 100644 --- a/pyecsca/codegen/bn/bn.c +++ b/pyecsca/codegen/bn/bn.c @@ -540,8 +540,8 @@ wsliding_t *bn_wsliding_rtl(const bn_t *bn, int w) { wsliding_t *result = NULL; int blen = bn_bit_length(bn); - uint8_t arr[blen]; - memset(arr, 0, blen * sizeof(uint8_t)); + uint8_t arr[blen + 1]; + memset(arr, 0, (blen + 1) * sizeof(uint8_t)); bn_t k; if (mp_init(&k) != BN_OKAY) { -- cgit v1.3.1