hello again. So I recorded 700 traces with my oscilloscope, downloaded the data and turned them into numpy arrays. With the exception, that each trace has 250k instead of 20k points. I recorded a project with my CWPRO, then I went to the directory and replaced the recorded traces with my own numpy array. Then I reopened the project in my notebook using open_project() function to reload the traces with the new exchanged ones. Sadly when I try to analyze them with CWAnalyzer or Lascar I get an error. Following one comes from CWAnalyzer:
<chipwhisperer.analyzer.attacks.cpa_new.CPA object at 0x000002AA3C14B788>
project = <chipwhisperer.common.api.ProjectFormat.Project object at 0x000002AA3C0C48C8>
leak_model = <chipwhisperer.analyzer.attacks.models.AES128_8bit.AES128_8bit object at 0x000002AA3C14B748>
algorithm = <chipwhisperer.analyzer.attacks.cpa_algorithms.progressive.CPAProgressive object at 0x000002AA3C1566C8>
trace_range = [0, 700]
point_range = [0, 250002]
subkey_list = range(0, 16)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-5-6fbf55483bd2> in <module>
5 attack = cwa.cpa(project, leak_model)
6 print(attack)
----> 7 results = attack.run(cwa.get_jupyter_callback(attack))
c:\chipwh~1\cw\home\portable\chipwhisperer\software\chipwhisperer\analyzer\attacks\cpa_new.py in run(self, callback, update_interval)
164 self.algorithm.setStatsReadyCallback(callback)
165 self.algorithm.addTraces(self.get_trace_source(), self.trace_range,
--> 166 None, pointRange=self.point_range)
167 return self.results
168
c:\chipwh~1\cw\home\portable\chipwhisperer\software\chipwhisperer\analyzer\attacks\cpa_algorithms\progressive.py in addTraces(self, traceSource, tracerange, progressBar, pointRange)
237 if (self.stats.simple_PGE(bnum) != 0) or (skipPGE == False):
238 bptrange = pointRange
--> 239 (data, pbcnt) = cpa[bnum].oneSubkey(bnum, bptrange, traces, tend - tstart, textins, textouts, knownkeys, progressBar, cpa[bnum].modelstate, pbcnt)
240 self.stats.update_subkey(bnum, data, tnum=tend)
241 else:
c:\chipwh~1\cw\home\portable\chipwhisperer\software\chipwhisperer\analyzer\attacks\cpa_algorithms\progressive.py in oneSubkey(self, bnum, pointRange, traces_all, numtraces, plaintexts, ciphertexts, knownkeys, progressBar, state, pbcnt)
58 # print "%d - %d (%d %d)" % (pointRange[0], pointRange[1], padbefore, padafter)
59
---> 60 self.sumtq += np.sum(np.square(traces), axis=0, dtype=np.float64)
61 self.sumt += np.sum(traces, axis=0)
62 sumden2 = (np.square(self.sumt) - self.totalTraces * self.sumtq)
TypeError: ufunc 'square' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
Do you have an idea what should I change to make it work? I would like to stick to this method for now