aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/codegen
diff options
context:
space:
mode:
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) {