diff --git a/test/data/tvla_aes_byte/ci_opentitan_simple_aes.cwp b/test/data/tvla_aes_byte/ci_opentitan_simple_aes.cwp new file mode 100644 index 00000000..6bb3762e --- /dev/null +++ b/test/data/tvla_aes_byte/ci_opentitan_simple_aes.cwp @@ -0,0 +1,28 @@ +[Trace Management] +tracefile0 = ci_opentitan_simple_aes_data/traces/config_2023.09.21-17.29.29_0.cfg +enabled0 = True +[ChipWhisperer] +[[General Settings]] +Project Name = Untitled +Project File Version = 1.00 +Project Author = Unknown +Program Name = ChipWhisperer +Program Version = "" +sample_rate = 200000000 +fpga_bitstream = objs/lowrisc_systems_chip_earlgrey_cw310_0.1.bit +force_program_bitstream = False +fw_bin = objs/aes_serial_fpga_cw310.bin +pll_frequency = 100000000 +baudrate = 115200 +key_len_bytes = 16 +plain_text_len_bytes = 16 +output_len_bytes = 16 +num_samples = 1200 +offset = -40 +lfsr_seed = 3735928559 +batch_prng_seed = 0 +scope_gain = 31.5 +num_traces = 1000 +project_name = projects/opentitan_simple_aes +waverunner_ip = 192.168.1.228 +datetime = "09/21/2023, 17:29:29" diff --git a/test/data/tvla_aes_byte/ci_opentitan_simple_aes_data/traces/2023.09.21-17.29.29_0keylist.npy b/test/data/tvla_aes_byte/ci_opentitan_simple_aes_data/traces/2023.09.21-17.29.29_0keylist.npy new file mode 100644 index 00000000..25bf23ff Binary files /dev/null and b/test/data/tvla_aes_byte/ci_opentitan_simple_aes_data/traces/2023.09.21-17.29.29_0keylist.npy differ diff --git a/test/data/tvla_aes_byte/ci_opentitan_simple_aes_data/traces/2023.09.21-17.29.29_0knownkey.npy b/test/data/tvla_aes_byte/ci_opentitan_simple_aes_data/traces/2023.09.21-17.29.29_0knownkey.npy new file mode 100644 index 00000000..6e5ed165 Binary files /dev/null and b/test/data/tvla_aes_byte/ci_opentitan_simple_aes_data/traces/2023.09.21-17.29.29_0knownkey.npy differ diff --git a/test/data/tvla_aes_byte/ci_opentitan_simple_aes_data/traces/2023.09.21-17.29.29_0textin.npy b/test/data/tvla_aes_byte/ci_opentitan_simple_aes_data/traces/2023.09.21-17.29.29_0textin.npy new file mode 100644 index 00000000..e8932a22 Binary files /dev/null and b/test/data/tvla_aes_byte/ci_opentitan_simple_aes_data/traces/2023.09.21-17.29.29_0textin.npy differ diff --git a/test/data/tvla_aes_byte/ci_opentitan_simple_aes_data/traces/2023.09.21-17.29.29_0textout.npy b/test/data/tvla_aes_byte/ci_opentitan_simple_aes_data/traces/2023.09.21-17.29.29_0textout.npy new file mode 100644 index 00000000..64ae6f13 Binary files /dev/null and b/test/data/tvla_aes_byte/ci_opentitan_simple_aes_data/traces/2023.09.21-17.29.29_0textout.npy differ diff --git a/test/data/tvla_aes_byte/ci_opentitan_simple_aes_data/traces/2023.09.21-17.29.29_0traces.npy b/test/data/tvla_aes_byte/ci_opentitan_simple_aes_data/traces/2023.09.21-17.29.29_0traces.npy new file mode 100644 index 00000000..b90b78c8 Binary files /dev/null and b/test/data/tvla_aes_byte/ci_opentitan_simple_aes_data/traces/2023.09.21-17.29.29_0traces.npy differ diff --git a/test/data/tvla_aes_byte/ci_opentitan_simple_aes_data/traces/config_2023.09.21-17.29.29_0.cfg b/test/data/tvla_aes_byte/ci_opentitan_simple_aes_data/traces/config_2023.09.21-17.29.29_0.cfg new file mode 100644 index 00000000..8bb02c19 --- /dev/null +++ b/test/data/tvla_aes_byte/ci_opentitan_simple_aes_data/traces/config_2023.09.21-17.29.29_0.cfg @@ -0,0 +1,13 @@ +[Trace Config] +format = native +numTraces = 1000 +numPoints = 1200 +date = 2023-09-21 17:29:29 +prefix = 2023.09.21-17.29.29_0 +targetHW = unknown +targetSW = unknown +scopeName = unknown +scopeSampleRate = 0 +scopeYUnits = 0 +scopeXUnits = 0 +notes = "" diff --git a/test/tvla_test.py b/test/tvla_test.py index ff46c8a5..a81379a2 100644 --- a/test/tvla_test.py +++ b/test/tvla_test.py @@ -89,3 +89,14 @@ def test_general_nonleaking_histogram(): 'run-tvla'])).run() assert not ttest_significant(np.load('tmp/ttest.npy')), ( f"{tvla} did find significant leakage, which is unexpected") + + +def test_aes_byte_filtering(): + project_path = TestDataPath('tvla_aes_byte/ci_opentitan_simple_aes.cwp') + tvla = TvlaCmd(Args(['--project-file', str(project_path), + '--mode', 'aes', '--round-select', '0', + '--byte-select', '0', '--save-to-disk', 'run-tvla'])).run() + received_file = np.load('tmp/traces.npy.npz') + traces_to_use = received_file['traces_to_use'] + assert sum(traces_to_use) <= 100, ( + f"{tvla} filtered less than 90 % of the input traces, which is unexpected.")