Skip to content

[DPA Template] Optimise matching phase

https://gitlab.com/eshard/scared/-/blob/master/scared/distinguishers/template.py?ref_type=heads#L72

During DPA template, the matching phase is performed with a loop on data, so with nb_guesses iterations. But if the number of templates : partitions is lower than the number of guesses, some calculus are performed multiple times.

To optimise, the temporary score can be computed for each template and then for each guess the corresponding score is picked and used to update the corresponding guess score.