aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/codegen/templates/formulas.c
diff options
context:
space:
mode:
authorJ08nY2020-02-20 15:06:18 +0100
committerJ08nY2020-02-20 15:06:18 +0100
commit92cb16e8103da998aa1bf226d24ef6771a92c5d5 (patch)
tree760e5f4921e8813b29748e7353a32168d99140cc /pyecsca/codegen/templates/formulas.c
parent5da1d167c203395103d220c450e29fece08f4198 (diff)
downloadpyecsca-codegen-92cb16e8103da998aa1bf226d24ef6771a92c5d5.tar.gz
pyecsca-codegen-92cb16e8103da998aa1bf226d24ef6771a92c5d5.tar.zst
pyecsca-codegen-92cb16e8103da998aa1bf226d24ef6771a92c5d5.zip
Allocate and initialize formula variables only once.
Diffstat (limited to 'pyecsca/codegen/templates/formulas.c')
-rw-r--r--pyecsca/codegen/templates/formulas.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/pyecsca/codegen/templates/formulas.c b/pyecsca/codegen/templates/formulas.c
new file mode 100644
index 0000000..7135727
--- /dev/null
+++ b/pyecsca/codegen/templates/formulas.c
@@ -0,0 +1,15 @@
+#include "point.h"
+#include "formulas.h"
+
+
+void formulas_init(void) {
+ {%- for name in names %}
+ point_{{ name }}_init();
+ {%- endfor %}
+}
+
+void formulas_clear(void) {
+ {%- for name in names %}
+ point_{{ name }}_clear();
+ {%- endfor %}
+} \ No newline at end of file