From 149e16806d9db7442b87f76259af740e27a77875 Mon Sep 17 00:00:00 2001 From: J08nY Date: Mon, 16 Oct 2023 15:16:55 +0200 Subject: Add trace transform function. --- test/sca/test_process.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') 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 -- cgit v1.2.3-70-g09d2