aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/codegen/templates
diff options
context:
space:
mode:
authorJ08nY2019-11-28 19:35:33 +0100
committerJ08nY2019-11-28 19:35:33 +0100
commit878d95c4e4dadf882a205316a07bc0642f773256 (patch)
treee539512c2a5386d714b6c29735b6bd17d30b2ca6 /pyecsca/codegen/templates
parenta17c64b710688ac697427544eaaab4aae6188c3c (diff)
downloadpyecsca-codegen-878d95c4e4dadf882a205316a07bc0642f773256.tar.gz
pyecsca-codegen-878d95c4e4dadf882a205316a07bc0642f773256.tar.zst
pyecsca-codegen-878d95c4e4dadf882a205316a07bc0642f773256.zip
Split to builder and client.
Diffstat (limited to 'pyecsca/codegen/templates')
-rw-r--r--pyecsca/codegen/templates/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pyecsca/codegen/templates/main.c b/pyecsca/codegen/templates/main.c
index ac620b5..14a4e58 100644
--- a/pyecsca/codegen/templates/main.c
+++ b/pyecsca/codegen/templates/main.c
@@ -93,7 +93,7 @@ static uint8_t cmd_generate(uint8_t *data, uint16_t len) {
uint8_t priv[priv_size];
bn_to_bin(&privkey, priv);
simpleserial_put('s', priv_size, priv);
- uint8_t pub[coord_size * {{ curve_parameters | length }}];
+ uint8_t pub[coord_size * {{ curve_variables | length }}];
{%- for variable in curve_variables %}
bn_to_binpad(&pubkey->{{ variable }}, pub + coord_size * {{ loop.index0 }}, coord_size);
{%- endfor %}
@@ -147,7 +147,7 @@ static uint8_t cmd_scalar_mult(uint8_t *data, uint16_t len) {
scalar_mult(&scalar, curve->generator, curve, result);
- uint8_t res[coord_size * {{ curve_parameters | length }}];
+ uint8_t res[coord_size * {{ curve_variables | length }}];
{%- for variable in curve_variables %}
bn_to_binpad(&result->{{ variable }}, res + coord_size * {{ loop.index0 }}, coord_size);
{%- endfor %}