Plot_data.output_vs_time not working as intended?

Hello all,

I’m currently trying to make sense out of power traces a colleague of mine recorded.
To do this, I used those traces in the ChipWhisperer-Framework, which is great btw.
Everything works fine and I can do attacks with the traces, get nearly all the plots but I’m currently struggling to get plot_data.output_vs_time(i) to work.
The function output_vs_time() only returns a one dimensional array instead of multiple values for each sample in my trace.
this is the data i get back for the call of e.g. output_vs_time(0): [range(0, 1), array([0.08937667]), 0, 0]
Therefore the Plot only shows single points and not a full trace with correlations.
Have i done something completely wrong? I tried to stick to the jupyter-tutorials and did everything similar.
Everything else is working. This is the only plot I can’t get to work, and unfortunately its also a pretty important one.

Best regards,

Investigating into my issue, I also found that this could be a dangerous statement in the at the function of output_vs_time():
maxes = [np.amax(data[0:key-1], 0), np.amax(data[key+1:-1], 0)]
mins = [np.amin(data[0:key-1], 0), np.amin(data[key+1:-1], 0)]
as data should have 256 entries these statements will fail if the key-byte-value is either 0,1, 254 or 255, right? The array subset of data[0:0] will be empty and np.amax will throw a “value error : zero-size array to reduction operation maximum which has no identity”.

Am I correct on this?

It seems to work, if one does not select a point_range for the attack.
If I don’t preselect the point_range I am getting correlation-values within the traces.

Hi Jens,

It’s definitely possible I missed something when moving that portion over to CW5. Thanks for the notice, I’ll take a look at it when I have the chance.


1 Like

Thank you @Alex_Dewar,
if I got some other things I noticed, should I put it here or into github?
E.g. in some Preprocessing files (like getTrace() is still in camelCase. Therefore the baseclass of preprocessing will only call its get_trace() instead of the getTrace() of the subclass. It’s an easy fix though :slight_smile: