aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/codegen/templates/mult_wnaf.c
diff options
context:
space:
mode:
authorJ08nY2025-11-30 18:02:02 +0100
committerJ08nY2025-11-30 18:02:02 +0100
commitb602400a52ff42f64faf495a9e46dbb17c86a472 (patch)
treefd40cfcc862115890e401f75398b99a7ccb04804 /pyecsca/codegen/templates/mult_wnaf.c
parente09d15a667a5cc0285319c17ce6de806b9681d06 (diff)
downloadpyecsca-codegen-master.tar.gz
pyecsca-codegen-master.tar.zst
pyecsca-codegen-master.zip
Fix equivalence to pyecsca mults.HEADmaster
Diffstat (limited to 'pyecsca/codegen/templates/mult_wnaf.c')
-rw-r--r--pyecsca/codegen/templates/mult_wnaf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pyecsca/codegen/templates/mult_wnaf.c b/pyecsca/codegen/templates/mult_wnaf.c
index 569e78b..1d15f07 100644
--- a/pyecsca/codegen/templates/mult_wnaf.c
+++ b/pyecsca/codegen/templates/mult_wnaf.c
@@ -19,7 +19,9 @@ static void scalar_mult_inner(bn_t *scalar, point_t *point, curve_t *curve, poin
points_neg[i] = point_copy(current);
point_neg(points_neg[i], curve, points_neg[i]);
{%- endif %}
- point_add(current, dbl, curve, current);
+ if (i != {{ 2 ** (scalarmult.width - 2) }} - 1) {
+ point_add(current, dbl, curve, current);
+ }
}
point_free(current);
point_free(dbl);