aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/codegen
diff options
context:
space:
mode:
authorJ08nY2025-10-02 17:05:17 +0200
committerJ08nY2025-10-02 17:05:17 +0200
commitf9ace0287aba10def1f4686a73289fde7598f4ad (patch)
tree0253dcb2a545a6b26eab4f8f16e946223f05a0e0 /pyecsca/codegen
parent89c92b689503bbc9710329c368ec6b81283a1eca (diff)
downloadpyecsca-codegen-f9ace0287aba10def1f4686a73289fde7598f4ad.tar.gz
pyecsca-codegen-f9ace0287aba10def1f4686a73289fde7598f4ad.tar.zst
pyecsca-codegen-f9ace0287aba10def1f4686a73289fde7598f4ad.zip
Fix Booth conditions for small window.
Diffstat (limited to 'pyecsca/codegen')
-rw-r--r--pyecsca/codegen/templates/mult_booth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pyecsca/codegen/templates/mult_booth.c b/pyecsca/codegen/templates/mult_booth.c
index 6dd19c7..4c1ba40 100644
--- a/pyecsca/codegen/templates/mult_booth.c
+++ b/pyecsca/codegen/templates/mult_booth.c
@@ -17,7 +17,7 @@ static void scalar_mult_inner(bn_t *scalar, point_t *point, curve_t *curve, poin
points_neg[0] = point_new();
point_neg(points[0], curve, points_neg[0]);
{% endif %}
- {% if scalarmult.width > 0 %}
+ {% if scalarmult.width > 1 %}
points[1] = point_copy(dbl);
{% if scalarmult.precompute_negation %}
points_neg[1] = point_new();
@@ -26,7 +26,7 @@ static void scalar_mult_inner(bn_t *scalar, point_t *point, curve_t *curve, poin
{% endif %}
point_set(dbl, current);
- {% if scalarmult.width > 1 %}
+ {% if scalarmult.width > 2 %}
for (long i = 2; i < {{ 2 ** (scalarmult.width - 1) }}; i++) {
point_add(current, point, curve, current);
points[i] = point_copy(current);