diff options
| author | J08nY | 2025-10-02 17:05:17 +0200 |
|---|---|---|
| committer | J08nY | 2025-10-02 17:05:17 +0200 |
| commit | f9ace0287aba10def1f4686a73289fde7598f4ad (patch) | |
| tree | 0253dcb2a545a6b26eab4f8f16e946223f05a0e0 /pyecsca/codegen | |
| parent | 89c92b689503bbc9710329c368ec6b81283a1eca (diff) | |
| download | pyecsca-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.c | 4 |
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); |
