Skip to content

Commit

Permalink
[tvla] Set HAMMING_WEIGHT as the default leakage model
Browse files Browse the repository at this point in the history
AES leakage can be computed using either HAMMING_WEIGHT or
HAMMING_DISTANCE. HAMMING_DISTANCE was useful in the early stages
of the project for analysing unprotected implemtation and debugging
the setup. However, now we use only HAMMING_WEIGHT model for TVLA
so it makes sense to make it the default.

Signed-off-by: Vladimir Rozic <[email protected]>
  • Loading branch information
vrozic committed Sep 12, 2023
1 parent 3628e1e commit 211447b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cw/tvla.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def compute_histograms_aes(trace_resolution, rnd_list, byte_list, traces, leakag
return histograms


def compute_leakage_aes(keys, plaintexts, leakage_model):
def compute_leakage_aes(keys, plaintexts, leakage_model = 'HAMMING_WEIGHT'):
"""
Sensitive variable is always byte-sized.
Expand Down Expand Up @@ -565,8 +565,7 @@ def run_tvla(ctx: typer.Context):
log.info("Computing Leakage")
leakage = Parallel(n_jobs=num_jobs)(
delayed(compute_leakage_aes)(keys[i:i + trace_step_leakage],
plaintexts[i:i + trace_step_leakage],
'HAMMING_WEIGHT')
plaintexts[i:i + trace_step_leakage])
for i in range(0, num_traces, trace_step_leakage))
leakage = np.concatenate((leakage[:]), axis=2)
if save_to_disk_leakage:
Expand Down

0 comments on commit 211447b

Please sign in to comment.