aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/codegen/templates/formula_dadd.c
blob: de9c9771eeb8846d4db42e74becc3b8a5bc5a66e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "point.h"
#include "action.h"
#include "hal/hal.h"
{% import "ops.c" as ops %}
{% from "action.c" import start_action, end_action %}

{{ ops.render_static_init(allocations, formula.shortname) }}

{{ ops.render_static_zero(allocations, formula.shortname) }}

{{ ops.render_static_clear(frees, formula.shortname) }}

__attribute__((noinline)) void point_dadd(const point_t *one, const point_t *other, const point_t *diff, const curve_t *curve, point_t *out_one) {
	{{ start_action("dadd") }}
	//NOP_128();
	// TODO: short-circuits
	{{ ops.render_initializations(initializations) }}
	{{ ops.render_ops(operations) }}
	{{ ops.render_returns(returns) }}
	//NOP_128();
	{{ end_action("dadd") }}
}