aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/sca/test_process.py
diff options
context:
space:
mode:
authorJ08nY2023-10-16 15:16:55 +0200
committerJ08nY2023-10-16 15:16:55 +0200
commit149e16806d9db7442b87f76259af740e27a77875 (patch)
tree6b64ea86253dee60b02742bde625d8b1a040f89a /test/sca/test_process.py
parentb51fc31685479b800e5b71c395f12c9d9e4ee4d2 (diff)
downloadpyecsca-149e16806d9db7442b87f76259af740e27a77875.tar.gz
pyecsca-149e16806d9db7442b87f76259af740e27a77875.tar.zst
pyecsca-149e16806d9db7442b87f76259af740e27a77875.zip
Add trace transform function.
Diffstat (limited to '')
-rw-r--r--test/sca/test_process.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/sca/test_process.py b/test/sca/test_process.py
index 9ab8bcf..e36f212 100644
--- a/test/sca/test_process.py
+++ b/test/sca/test_process.py
@@ -11,6 +11,7 @@ from pyecsca.sca import (
recenter,
normalize,
normalize_wl,
+ transform
)
@@ -62,8 +63,19 @@ def test_recenter(trace):
def test_normalize(trace):
result = normalize(trace)
assert result is not None
+ assert np.isclose(0, np.mean(result.samples))
+ assert np.isclose(1, np.var(result.samples))
def test_normalize_wl(trace):
result = normalize_wl(trace)
assert result is not None
+ assert np.isclose(0, np.mean(result.samples))
+ assert np.isclose(1/len(result), np.std(result.samples))
+
+
+def test_transform(trace):
+ result = transform(trace, 5, 10)
+ assert result is not None
+ assert min(result) == 5
+ assert max(result) == 10