aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/codegen
diff options
context:
space:
mode:
authorJ08nY2023-10-05 20:23:40 +0200
committerJ08nY2023-10-05 20:23:40 +0200
commit62ec24bb56e6be82b3cf4840d547aaf9130b197b (patch)
treec94584a75a370869bf9a5120eb7083945d99adc6 /pyecsca/codegen
parent19e240e6f8107ebe8bed4d36820c9d5d8fe1576b (diff)
downloadpyecsca-codegen-62ec24bb56e6be82b3cf4840d547aaf9130b197b.tar.gz
pyecsca-codegen-62ec24bb56e6be82b3cf4840d547aaf9130b197b.tar.zst
pyecsca-codegen-62ec24bb56e6be82b3cf4840d547aaf9130b197b.zip
Allocate more for sliding window array.
Diffstat (limited to 'pyecsca/codegen')
-rw-r--r--pyecsca/codegen/bn/bn.c4
1 files changed, 2 insertions, 2 deletions
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) {