diff --git a/test/data/tvla_general/ci_opentitan_simple_aes_fvsr.cwp b/test/data/tvla_general/ci_opentitan_simple_aes_fvsr.cwp new file mode 100644 index 00000000..fab29d6f --- /dev/null +++ b/test/data/tvla_general/ci_opentitan_simple_aes_fvsr.cwp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b17b5b98754c0d0adbf016650f37cb4df8fbbbb657fe7a9567bf42fb74a7a795 +size 787 diff --git a/test/data/tvla_general/ci_opentitan_simple_aes_fvsr_data/traces/2023.08.17-18.15.28_0keylist.npy b/test/data/tvla_general/ci_opentitan_simple_aes_fvsr_data/traces/2023.08.17-18.15.28_0keylist.npy new file mode 100644 index 00000000..8e62608b Binary files /dev/null and b/test/data/tvla_general/ci_opentitan_simple_aes_fvsr_data/traces/2023.08.17-18.15.28_0keylist.npy differ diff --git a/test/data/tvla_general/ci_opentitan_simple_aes_fvsr_data/traces/2023.08.17-18.15.28_0knownkey.npy b/test/data/tvla_general/ci_opentitan_simple_aes_fvsr_data/traces/2023.08.17-18.15.28_0knownkey.npy new file mode 100644 index 00000000..6e5ed165 Binary files /dev/null and b/test/data/tvla_general/ci_opentitan_simple_aes_fvsr_data/traces/2023.08.17-18.15.28_0knownkey.npy differ diff --git a/test/data/tvla_general/ci_opentitan_simple_aes_fvsr_data/traces/2023.08.17-18.15.28_0textin.npy b/test/data/tvla_general/ci_opentitan_simple_aes_fvsr_data/traces/2023.08.17-18.15.28_0textin.npy new file mode 100644 index 00000000..4235d03c Binary files /dev/null and b/test/data/tvla_general/ci_opentitan_simple_aes_fvsr_data/traces/2023.08.17-18.15.28_0textin.npy differ diff --git a/test/data/tvla_general/ci_opentitan_simple_aes_fvsr_data/traces/2023.08.17-18.15.28_0textout.npy b/test/data/tvla_general/ci_opentitan_simple_aes_fvsr_data/traces/2023.08.17-18.15.28_0textout.npy new file mode 100644 index 00000000..a5952e5c Binary files /dev/null and b/test/data/tvla_general/ci_opentitan_simple_aes_fvsr_data/traces/2023.08.17-18.15.28_0textout.npy differ diff --git a/test/data/tvla_general/ci_opentitan_simple_aes_fvsr_data/traces/2023.08.17-18.15.28_0traces.npy b/test/data/tvla_general/ci_opentitan_simple_aes_fvsr_data/traces/2023.08.17-18.15.28_0traces.npy new file mode 100644 index 00000000..96e6cbab Binary files /dev/null and b/test/data/tvla_general/ci_opentitan_simple_aes_fvsr_data/traces/2023.08.17-18.15.28_0traces.npy differ diff --git a/test/data/tvla_general/ci_opentitan_simple_aes_fvsr_data/traces/config_2023.08.17-18.15.28_0.cfg b/test/data/tvla_general/ci_opentitan_simple_aes_fvsr_data/traces/config_2023.08.17-18.15.28_0.cfg new file mode 100644 index 00000000..52491f76 --- /dev/null +++ b/test/data/tvla_general/ci_opentitan_simple_aes_fvsr_data/traces/config_2023.08.17-18.15.28_0.cfg @@ -0,0 +1,13 @@ +[Trace Config] +format = native +numTraces = 5000 +numPoints = 1200 +date = 2023-08-17 18:15:28 +prefix = 2023.08.17-18.15.28_0 +targetHW = unknown +targetSW = unknown +scopeName = unknown +scopeSampleRate = 0 +scopeYUnits = 0 +scopeXUnits = 0 +notes = "" diff --git a/test/data/tvla_general/ttest-step-golden-aes.npy.npz b/test/data/tvla_general/ttest-step-golden-aes.npy.npz new file mode 100644 index 00000000..3b83a9ce --- /dev/null +++ b/test/data/tvla_general/ttest-step-golden-aes.npy.npz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:197ee6315dd31ce1155e0a59a6404b786b9e9d1f1b9a126101ea00b712e2de84 +size 187056 diff --git a/test/data/tvla_general/ttest-step-golden.npy.npz b/test/data/tvla_general/ttest-step-golden-kmac.npy.npz similarity index 100% rename from test/data/tvla_general/ttest-step-golden.npy.npz rename to test/data/tvla_general/ttest-step-golden-kmac.npy.npz diff --git a/test/tvla_test.py b/test/tvla_test.py index b24f10df..1f540826 100644 --- a/test/tvla_test.py +++ b/test/tvla_test.py @@ -40,12 +40,12 @@ def ttest_compare_results(expected, received, delta) -> bool: return nan_match and numbers_match -def test_general_nonleaking_project(): +def test_general_kmac_nonleaking_project(): project_path = TestDataPath('tvla_general/ci_opentitan_simple_kmac.cwp') tvla = TvlaCmd(Args(['--project-file', str(project_path), '--mode', 'kmac', '--save-to-disk-ttest', '--number-of-steps', '10', 'run-tvla'])).run() - expected_path = TestDataPath('tvla_general/ttest-step-golden.npy.npz') + expected_path = TestDataPath('tvla_general/ttest-step-golden-kmac.npy.npz') expected_file = np.load(str(expected_path)) expected_trace = expected_file['ttest_step'] received_file = np.load('tmp/ttest-step.npy.npz') @@ -58,6 +58,21 @@ def test_general_nonleaking_project(): f"{tvla} generated ttest_step values that don't match the expected ones") +def test_general_aes_nonleaking_project(): + project_path = TestDataPath('tvla_general/ci_opentitan_simple_aes_fvsr.cwp') + tvla = TvlaCmd(Args(['--project-file', str(project_path), + '--mode', 'aes', '--save-to-disk-ttest', + '--number-of-steps', '10', 'run-tvla'])).run() + expected_path = TestDataPath('tvla_general/ttest-step-golden-aes.npy.npz') + expected_file = np.load(str(expected_path)) + expected_trace = expected_file['ttest_step'] + received_file = np.load('tmp/ttest-step.npy.npz') + received_trace = received_file['ttest_step'] + delta = 0.001 + assert ttest_compare_results(expected_trace, received_trace, delta), ( + f"{tvla} generated ttest_step values that don't match the expected ones") + + def test_general_leaking_histogram(): hist_path = TestDataPath('tvla_general/kmac_hist_leaking.npz') tvla = TvlaCmd(Args(['--input-histogram-file', str(hist_path),