aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJ08nY2023-10-05 17:11:29 +0200
committerJ08nY2023-10-05 17:11:29 +0200
commit5752f4da62f638d2e8a713f1ac03eab2d4bc3147 (patch)
tree954bb126b093899fbf0e21378df0b7ffe738f414
parent44e49254cdef200528205464b00701433d788a75 (diff)
downloadpyecsca-codegen-5752f4da62f638d2e8a713f1ac03eab2d4bc3147.tar.gz
pyecsca-codegen-5752f4da62f638d2e8a713f1ac03eab2d4bc3147.tar.zst
pyecsca-codegen-5752f4da62f638d2e8a713f1ac03eab2d4bc3147.zip
Run config under valgrind.
-rw-r--r--.github/workflows/test.yml4
-rw-r--r--pyecsca/codegen/templates/mult_sliding_w.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index b075ec7..aa6d6c3 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -4,7 +4,7 @@ on: [push, pull_request]
env:
LLVM_CONFIG: /usr/bin/llvm-config-14
- OTHER_PACKAGES: swig libpcsclite-dev llvm-14 libllvm14 llvm-14-dev gcc gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi
+ OTHER_PACKAGES: swig libpcsclite-dev llvm-14 libllvm14 llvm-14-dev valgrind gcc gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi
jobs:
test:
@@ -48,7 +48,7 @@ jobs:
- name: Build test config
run: |
builder build --platform HOST --red BARRETT --no-remove -v shortw projective add-1998-cmo dbl-1998-cmo "sliding(width=3,recoding_direction=ProcessingDirection.RTL)" .
- echo -e "c7010fffffffdffffffffffffffffffffffff6e10fffffffe0000000075a30d1b9038a1156801016110fffffffdfffffffffffffffffffffffc6210e87579c11079f43dd824993c2cee5ed3e7247810161ff7528b899b2d0c28607ca52c5b867910cf5ac8395bafeb13c02da292dded7a83e9036e0101\ng\nx\n" | ./pyecsca-codegen-HOST.elf
+ echo -e "c7010fffffffdffffffffffffffffffffffff6e10fffffffe0000000075a30d1b9038a1156801016110fffffffdfffffffffffffffffffffffc6210e87579c11079f43dd824993c2cee5ed3e7247810161ff7528b899b2d0c28607ca52c5b867910cf5ac8395bafeb13c02da292dded7a83e9036e0101\ng\nx\n" | valgrind --track-origins=yes --leak-check=full ./pyecsca-codegen-HOST.elf
- name: Test
run: |
make test
diff --git a/pyecsca/codegen/templates/mult_sliding_w.c b/pyecsca/codegen/templates/mult_sliding_w.c
index 7321292..1b670e9 100644
--- a/pyecsca/codegen/templates/mult_sliding_w.c
+++ b/pyecsca/codegen/templates/mult_sliding_w.c
@@ -20,15 +20,15 @@ static void scalar_mult_inner(bn_t *scalar, point_t *point, curve_t *curve, poin
{% elif scalarmult.recoding_direction == ProcessingDirection.RTL %}
wsliding_t *ws = bn_wsliding_rtl(scalar, {{ scalarmult.width }});
{% endif %}
- printf("ws %p\n", ws);
- printf("len = %li\n", ws->length);
+ //printf("ws %p\n", ws);
+ //printf("len = %li\n", ws->length);
for (long i = 0; i < ws->length; i++) {
point_dbl(q, curve, q);
uint8_t val = ws->data[i];
- printf("i = %li, val = %i\n", i, val);
+ //printf("i = %li, val = %i\n", i, val);
if (val) {
- printf("adding %i\n", (val - 1) / 2);
+ //printf("adding %i\n", (val - 1) / 2);
point_accumulate(q, points[(val - 1) / 2], curve, q);
}
}