Hi,
I’m encountering a problem with the Husky. I am trying to capture the following operation:
for (j = 0; j < 15; j++) {
v->vec[0].coeffs[j] *= 1 - 2 * b;
}
When I put the trigger calls inside the loop, everything works well: we observe 15 spikes and the data are usable for performing an attack :
for (j = 0; j < 15; j++) {
trigger_high();
v->vec[0].coeffs[j] *= 1 - 2 * b;
trigger_low();
}
However, when I move the trigger calls outside the loop to simulate more realistic capture conditions, I can’t interpret anything from the trace. I’ve tried declaring the variables as volatile, but it didn’t make any difference:
trigger_high();
for (j = 0; j < 15; j++) {
v->vec[0].coeffs[j] *= 1 - 2 * b;
}
trigger_low();
Interestingly, when I run the exact same code on a ChipWhisperer Lite, everything works as expected, regardless of whether the trigger is placed inside or outside the loop. After comparing the .hex
files, we noticed that the trigger_high()
and trigger_low()
functions are never called in the build targeting the Husky.
Do you have any idea why this is happening? Could the compiler be optimizing away the trigger functions when they’re outside the loop?
Thanks in advance for your help!