-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[tvla] Add histogram based TVLA #71
Commits on May 13, 2022
-
Signed-off-by: Vladimir Rozic <vrozic@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for b0908fa - Browse repository at this point
Copy the full SHA b0908faView commit details -
[tvla] Fix and improve leakage computation, add new argument
This commit contains several changes: 1. Fix leakage model computation. Previously, only the initial round and the first 9 regular rounds were computed. The final round couldn't be analyzed. 2. Now, all bytes and all rounds are computed. Basically when computing a single byte, the other bytes come for free. Similarly, if round 10 is needed, all other rounds need to be computed anyway. 3. The computed leakage model is saved to disk as traces.npy and using a new command line argument can be loaded in a later run to re-use previous intermediate results and speed up the analysis. Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for d91e55f - Browse repository at this point
Copy the full SHA d91e55fView commit details -
[tvla] Parallelize leakage model computation
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 2a8d809 - Browse repository at this point
Copy the full SHA 2a8d809View commit details -
[tvla] Enable saving and loading trace files after conversion to int
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 1b9aef6 - Browse repository at this point
Copy the full SHA 1b9aef6View commit details -
[tvla] Add new argument to specify ChipWhisperer project file
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 9931cc4 - Browse repository at this point
Copy the full SHA 9931cc4View commit details -
[tvla] Rename some function arguments
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 9e30d67 - Browse repository at this point
Copy the full SHA 9e30d67View commit details -
[tvla] Add new input arguments for specifying trace range
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for accdee2 - Browse repository at this point
Copy the full SHA accdee2View commit details -
[tvla] Create separate function for computing histograms
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 8d622eb - Browse repository at this point
Copy the full SHA 8d622ebView commit details -
[tvla] Use numpy.histogram2d function
This gives a performance improvement of nearly 100x compared to the previous implementation based on nested for loops. Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 4ff9899 - Browse repository at this point
Copy the full SHA 4ff9899View commit details -
[tvla] Compute all rounds, all bytes, add new argument for selection
This commit modifies the histograms & t-test computation as well as the plotting to run for all rounds and all bytes by default. Using new command line arguments, the user can specify a single round and/or a single byte if needed. Plots for all computed t-test results are saved and the script now prints results in text format, highlighting in which rounds and bytes, leakage above the threshold has been detected. Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for f57289c - Browse repository at this point
Copy the full SHA f57289cView commit details -
[tvla] Parallelize histograms computation
This commit parallelizes the histograms computation across samples. Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for b4de7d5 - Browse repository at this point
Copy the full SHA b4de7d5View commit details -
[tvla] Parallelize comptutation of t-test statistics
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for ef8fc71 - Browse repository at this point
Copy the full SHA ef8fc71View commit details -
[tvla] Save intermediate results, plots and temporary files under tmp/
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 564ea12 - Browse repository at this point
Copy the full SHA 564ea12View commit details -
[tvla] Fix lint errors and warnings
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 085d0ec - Browse repository at this point
Copy the full SHA 085d0ecView commit details -
[tvla] Only compute var and sigma if required for selected T-test order
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 5452139 - Browse repository at this point
Copy the full SHA 5452139View commit details -
[tvla] Filter out noisy traces
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for eb902b6 - Browse repository at this point
Copy the full SHA eb902b6View commit details -
[tvla] Use logging to simultaneously print to stdout and into a log file
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 9023537 - Browse repository at this point
Copy the full SHA 9023537View commit details -
In case either the fixed or random set is empty, the statistics can't be computed. This can happen e.g. if few traces are used only, or if using the hamming distance as sensitive variable and analyzing the initial round. In the latter case, the hamming distance can only be zero or non-zero if the corresponding key byte is zero or non-zero, respectively. Thus, either the fixed or the random set is empty. Previously we anyway computed the statistics producing meaningless results. With this commit, we don't try to compute the statistics anymore if either of the sets is empty and report this to the user. Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 89ae257 - Browse repository at this point
Copy the full SHA 89ae257View commit details -
[tvla] Optimize t-test computation
This commit switches to a t-test function provided by scipy which operates on arrays. Also, the code around the t-test function is refactored to make better use of numpy.ndarrays, to reduce the amount of control code and to reduce the number of loops. All this allows for a speedup of 20x for the t-test computation. Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 990e777 - Browse repository at this point
Copy the full SHA 990e777View commit details -
[tvla] TVLA support for general tests
Added support for general fixed-vs-random TVLA. Signed-off-by: vrozic <vrozic@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 8c267c7 - Browse repository at this point
Copy the full SHA 8c267c7View commit details -
[tvla] Allow appending more data to previously generated histograms
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 1b55386 - Browse repository at this point
Copy the full SHA 1b55386View commit details -
[tvla] Enable step-wise processing, add usability improvements
The most important change of this commit is that it adds the option for step-wise processing of trace sets using the `-n` argument and related to that the capability to plot how the t-test values evolve with increasing number of traces. Other usability improvements include: - Filtered traces and the computed leakage are only saved to disk if the `-d` argument is provided. - Figures are only plotted and saved to disk if the `-f` argument is provided. - The t-test results can be written to disk using the `-d` argument. They can be loaded with the `-a` argument to only display results and plot figures if really needed. The results table is always printed. Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 5be3231 - Browse repository at this point
Copy the full SHA 5be3231View commit details -
[tvla] Integrate support for general fixed-vs-random TVLA into tvla.py
This allows both specific AES TVLA (as we were doing before) and fixed- vs-random TVLA for AES and SHA3 using a single code base. Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 3227625 - Browse repository at this point
Copy the full SHA 3227625View commit details -
[tvla] Fixes a bug when bulding the random set
Fixes a way that a random set is constructed when running tvla general tests. Signed-off-by: vrozic <vrozic@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 681e8e2 - Browse repository at this point
Copy the full SHA 681e8e2View commit details -
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 44a6433 - Browse repository at this point
Copy the full SHA 44a6433View commit details -
[tvla] Increase ADC resolution for Husky
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 8ccb8e2 - Browse repository at this point
Copy the full SHA 8ccb8e2View commit details -
[tvla] Correct comment regarding general fixed-vs-random TVLA
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for b3d2869 - Browse repository at this point
Copy the full SHA b3d2869View commit details -
[tvla] Add support for random-order measurements
Add support for fixed-vs-random key TVLA when measurements are taken in random order (rather than alternating between fixed and random). The analysis works under the assumption is that the first trace in the project is generated using a fixed key. Signed-off-by: vrozic <vrozic@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for f664681 - Browse repository at this point
Copy the full SHA f664681View commit details -
Make tvla script compatible with AES General Test: FvsR Key traces.
Signed-off-by: Abdullah Varici <abdullah.varici@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for f5ef143 - Browse repository at this point
Copy the full SHA f5ef143View commit details
Commits on May 17, 2022
-
[tvla] Adjust window ranges for ttest_step plots
The inrease in sampling rate by 2x and the trigger offset needs to be accounted for when plotting these figures. Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 5fa4ad6 - Browse repository at this point
Copy the full SHA 5fa4ad6View commit details -
[tvla] Add support for uint16 trace files
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 2fd318e - Browse repository at this point
Copy the full SHA 2fd318eView commit details -
[tvla] Remove offset subtraction on converted traces
This is not actually needed but may have a slightly negative impact when doing more than one step as the offset may vary with each step. Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for d6634fe - Browse repository at this point
Copy the full SHA d6634feView commit details -
[tvla] Fix bug in specific AES TVLA for only a subset of bytes/rounds
Without this commit, it could happen that the wrong bytes/rounds would be selected for the final results/figure plotting step in case only a subset of bytes/rounds were analyzed. Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 0924069 - Browse repository at this point
Copy the full SHA 0924069View commit details
Commits on May 18, 2022
-
[tvla] Optimize performance and memory consumption of specific AES TVLA
Previously, we were generating 9 histograms one for each possible Hamming weight of the sensitive variable. But the actual statistics are then computed by combining the 8 histograms for the non-zero Hamming weights (fixed vs. random). It this therefore more efficient to only generate 2 histograms in the first place. One for Hamming weight = 0 and one for Hamming weight > 0. Most importantly, this leads to a reduction in memory footprint of roughly 4.5x. Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Configuration menu - View commit details
-
Copy full SHA for 8d30598 - Browse repository at this point
Copy the full SHA 8d30598View commit details