diff options
| author | J08nY | 2020-02-20 15:06:18 +0100 |
|---|---|---|
| committer | J08nY | 2020-02-20 15:06:18 +0100 |
| commit | 92cb16e8103da998aa1bf226d24ef6771a92c5d5 (patch) | |
| tree | 760e5f4921e8813b29748e7353a32168d99140cc /pyecsca/codegen/templates/formula_neg.c | |
| parent | 5da1d167c203395103d220c450e29fece08f4198 (diff) | |
| download | pyecsca-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/formula_neg.c')
| -rw-r--r-- | pyecsca/codegen/templates/formula_neg.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pyecsca/codegen/templates/formula_neg.c b/pyecsca/codegen/templates/formula_neg.c index fc790de..c728e70 100644 --- a/pyecsca/codegen/templates/formula_neg.c +++ b/pyecsca/codegen/templates/formula_neg.c @@ -1,3 +1,10 @@ +#include "point.h" +{% import "ops.c" as ops %} + +{{ ops.render_static_init(allocations, initializations, formula.shortname) }} + +{{ ops.render_static_clear(frees, formula.shortname) }} + void point_neg(const point_t *one, const curve_t *curve, point_t *out_one) { {%- if short_circuit %} if (point_equals(one, curve->neutral)) { @@ -5,5 +12,6 @@ void point_neg(const point_t *one, const curve_t *curve, point_t *out_one) { return; } {%- endif %} - {%- include "ops.c" %} + {{ ops.render_ops(operations) }} + {{ ops.render_returns(returns) }} }
\ No newline at end of file |
