FR | EN
Quentin L. Meunier
Associate Professor in Computer Science at Sorbonne Université

Distribution of the values of an expression by enumeration

The following python program allows to analyse by an enumeration technique the distribution of the values of an expression. The variables considered for the expression have either a uniform distribution (mask type variable), or an unknown distribution (secret variable).
Link to the file
The analysis gives three possible results: The program can be used with the following command line:

$ ./check_formula_distrib.py -l "k ^ m"

Variable size should be less than 16 bits, and must configured in the python file.
In the expression, by convention, mask type variables are those whose name starts is m<val> or r<val>, and secret variables are those with a name like k<val> or s<val>.
About shifts, the >> operator does a logical right shift, whereas the function sra(m, sh) does a signed (arithmetic) right shift.

For example: