diff options
| author | Tomas Jusko | 2022-01-31 20:32:53 +0100 |
|---|---|---|
| committer | Tomas Jusko | 2022-01-31 20:32:53 +0100 |
| commit | 5811b3af6f8ef42550a4650ee1dda02df61e2c7f (patch) | |
| tree | 349c18c350eb6f3e8e1bfaf3d3aa09001cb42d2f /test | |
| parent | 5acda22dc421107f20777186d404d10913785b9c (diff) | |
| download | pyecsca-5811b3af6f8ef42550a4650ee1dda02df61e2c7f.tar.gz pyecsca-5811b3af6f8ef42550a4650ee1dda02df61e2c7f.tar.zst pyecsca-5811b3af6f8ef42550a4650ee1dda02df61e2c7f.zip | |
Fixed bugs and imports
Diffstat (limited to 'test')
| -rw-r--r-- | test/sca/test_stacked_combine.py | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/test/sca/test_stacked_combine.py b/test/sca/test_stacked_combine.py index 63f51cc..91ad4fd 100644 --- a/test/sca/test_stacked_combine.py +++ b/test/sca/test_stacked_combine.py @@ -2,7 +2,7 @@ from unittest import TestCase import unittest import numpy as np -from pyecsca.pyecsca.sca import ( +from pyecsca.sca import ( Trace, StackedTraces, GPUTraceManager, @@ -32,7 +32,7 @@ class StackedCombineTests(TestCase): stacked.samples.shape, (self.samples.shape[0], min_len) ) - self.assertTrue((stacked.samples, self.samples[:,:min_len]).all()) + self.assertTrue((stacked.samples == self.samples[:,:min_len]).all()) def test_fromtraceset(self): max_len = self.samples.shape[1] @@ -42,7 +42,7 @@ class StackedCombineTests(TestCase): for t in self.samples ] - tset = TraceSet(traces) + tset = TraceSet(*traces) min_len = min(map(len, traces)) stacked = StackedTraces.fromtraceset(tset) @@ -103,22 +103,3 @@ class StackedCombineTests(TestCase): ) self.assertTrue(all(np.isclose(avg_trace.samples, avg_cmp))) self.assertTrue(all(np.isclose(var_trace.samples, var_cmp))) - - - # def test_average(): - # samples = np.random.rand(4 * TPB, 8 * TPB) - # ts = StackedTraces.fromarray(np.array(samples)) - # res = GPUTraceManager.average(ts) - # check_res = samples.sum(0) / ts.traces.shape[0] - # print(all(check_res == res)) - - # def test_standard_deviation(): - # samples: np.ndarray = np.random.rand(4 * TPB, 8 * TPB) - # ts = StackedTraces.fromarray(np.array(samples)) - # res = GPUTraceManager.standard_deviation(ts) - # check_res = samples.std(0, dtype=samples.dtype) - # print(all(np.isclose(res, check_res))) - - -if __name__ == '__main__': - unittest.main()
\ No newline at end of file |
