-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Hi, I'm interested in using the OPOI subset of the DPAv4.2 dataset from your paper.
Is it possible there is a mixup in the code?
As I see it, the convert_to_h5.py selects the window [0:400_000] into the files
dpa_v42_0_100000.h5, dpa_v42_100000_200000.h5, dpa_v42_200000_300000.h5 and dpa_v42_300000_400000.h5
(each 100k samples)
Then generate_dataset.py merge_dataset skips the first 100_000 samples, making the window [100_000:400_000]
feature_selection_dlsca/experiments/DPAV42/generate_dataset.py
Lines 320 to 326 in eb5b909
| ns_chunck = 100000 | |
| attack_samples = np.zeros((n_attack, 300000)) | |
| profiling_samples = np.zeros((n_profiling, 300000)) | |
| for s_i in range(1, 4): | |
| fs = ns_chunck * s_i | |
into file dpa_v42_full.h5 (300k samples)
then generate_nopoi(20) for some reason skips the first 150k samples:
feature_selection_dlsca/experiments/DPAV42/generate_dataset.py
Lines 214 to 221 in eb5b909
| def generate_nopoi(window, desync=False): | |
| n_profiling = 70000 | |
| n_attack = 10000 | |
| number_of_samples = 150000 | |
| in_file = h5py.File(f'{dataset_folder_dpav42_nopoi}/dpa_v42_full.h5', 'r') | |
| profiling_samples = np.array(in_file['Profiling_traces/traces'], dtype=np.float32)[:, 150000:] | |
| attack_samples = np.array(in_file['Attack_traces/traces'], dtype=np.float32)[:, 150000:] |
which results in a 150k (300k - 150k) sample intermediate set which is averaged with stepsize=10
dpa_v42_nopoi_window_20.h5 then has 15k samples per trace.
However the generate_opoi() function then indexes into the dpa_v42_nopoi_window_20.h5 with [17000:17400] and [20600:21000], which are larger than the 15k samples available.
For me at least this leads to an error:
/tmp/ipykernel_2697999/2547568393.py in generate_opoi()
179
180 for i in range(len(profiling_samples)):
--> 181 profiling_samples_opoi[i][:400] = profiling_samples[i][17000:17400]
182 profiling_samples_opoi[i][400:] = profiling_samples[i][20600:21000]
183
ValueError: could not broadcast input array from shape (0,) into shape (400,)
Question 1
Is the window of [170_000:174_000] and [206_000:210_000], as mentioned in the Paper the correct range in the raw original DPAv4.2 traces?
I'm asking since I'm having trouble getting a good GE attack with the ID MLP and others. I probably have a bug somewhere, but I wanted to confirm I'm not working on a wrong sample window.
Or would it be possible for you to provide the DPAv4.2 OPOI .h5 file for me to use?
Compressed it should be reasonably small, maybe its even possible to attach them here in this issue.