aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/codegen/mult/double_and_add.c
diff options
context:
space:
mode:
authorJ08nY2019-11-25 21:25:29 +0100
committerJ08nY2019-11-25 21:25:29 +0100
commitde491a6191b465edb7bd9a01a5177ac9bf836747 (patch)
tree18459bc2cb101782e2157b0e9313d288d1b6a43b /pyecsca/codegen/mult/double_and_add.c
parent8a56c7a95e662862cfe78b834ccb091e95d5372f (diff)
downloadpyecsca-codegen-de491a6191b465edb7bd9a01a5177ac9bf836747.tar.gz
pyecsca-codegen-de491a6191b465edb7bd9a01a5177ac9bf836747.tar.zst
pyecsca-codegen-de491a6191b465edb7bd9a01a5177ac9bf836747.zip
Start Python codegen impl.
Diffstat (limited to 'pyecsca/codegen/mult/double_and_add.c')
-rw-r--r--pyecsca/codegen/mult/double_and_add.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pyecsca/codegen/mult/double_and_add.c b/pyecsca/codegen/mult/double_and_add.c
index 1fd3c9e..a795654 100644
--- a/pyecsca/codegen/mult/double_and_add.c
+++ b/pyecsca/codegen/mult/double_and_add.c
@@ -1,10 +1,11 @@
#include "mult.h"
+#include "formulas.h"
void scalar_mult(bn_t *scalar, point_t *point, curve_t *curve, point_t *out) {
point_t *q = point_copy(point);
point_t *r = point_copy(curve->neutral);
- int nbits = bn_bit_length(curve->n);
+ int nbits = bn_bit_length(&curve->n);
for (int i = nbits; i >= 0; i--) {
point_dbl(r, curve, r);
if (bn_get_bit(scalar, i) == 1) {