aboutsummaryrefslogtreecommitdiff
path: root/util/plot_dsa.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'util/plot_dsa.ipynb')
-rw-r--r--util/plot_dsa.ipynb20
1 files changed, 15 insertions, 5 deletions
diff --git a/util/plot_dsa.ipynb b/util/plot_dsa.ipynb
index a542f9c..abd6531 100644
--- a/util/plot_dsa.ipynb
+++ b/util/plot_dsa.ipynb
@@ -27,7 +27,7 @@
"import matplotlib.pyplot as plt\n",
"from matplotlib import ticker, colors, gridspec\n",
"from copy import deepcopy\n",
- "from utils import plot_hist, moving_average, hw, time_scale, hist_size_func\n",
+ "from utils import plot_hist, moving_average, hw, time_scale, hist_size_func, recompute_nonces\n",
"from binascii import unhexlify\n",
"from IPython.display import display, HTML\n",
"from ipywidgets import interact, interactive, fixed, interact_manual\n",
@@ -57,6 +57,13 @@
"# File name with output from ECTesterReader or ECTesterStandalone signatures.\n",
"fname = \"filename.csv\"\n",
"\n",
+ "# A hash algorithm used\n",
+ "hash_algo = \"SHA1\" # e.g. \"SHA1\" or None for no hash, raw data signatures\n",
+ "\n",
+ "# A curve name or a path to curve file, used to recompute the random nonces used in signing, if they are not present\n",
+ "# in the file. (ECTester was not able to recompute them for some reason)\n",
+ "curve = None # e.g. \"secg/secp256r1\" or \"secp256r1.csv\" or None for no curve.\n",
+ "\n",
"# The time unit used in displaying the plots. One of \"milli\", \"micro\", \"nano\".\n",
"# WARNING: Using nano might lead to very large plots/histograms and to the\n",
"# notebook to freeze or run out of memory, as well as bad visualization\n",
@@ -83,7 +90,7 @@
"style = \"ggplot\"\n",
"\n",
"# Color map to use, and what color to assign to \"bad\" values (necessary for log_scale)\n",
- "color_map = plt.cm.plasma\n",
+ "color_map = plt.cm.viridis\n",
"color_map_bad = \"black\"\n",
"\n",
"# What function to use to calculate number of histogram bins of time\n",
@@ -152,6 +159,9 @@
"sign_disp_unit = time_scale(data[\"sign_time\"], orig_sign_unit, sign_unit, scaling_factor)\n",
"verify_disp_unit = time_scale(data[\"verify_time\"], orig_verify_unit, verify_unit, scaling_factor)\n",
"\n",
+ "if np.any(data[\"nonce\"] == None):\n",
+ " recompute_nonces(data, curve, hash_algo)\n",
+ "\n",
"# Trim times\n",
"quant_low_bound = trim_low if 0 <= trim_low <= 1 else 0.01\n",
"quant_high_bound = trim_high if 0 <= trim_high <= 1 else 0.95\n",
@@ -675,8 +685,8 @@
],
"metadata": {
"@webio": {
- "lastCommId": "8be83dd299f244e7859686e690aa3254",
- "lastKernelId": "4cf3b8b4-71ee-4bf5-aafc-ff6192e2d23c"
+ "lastCommId": "a38f080b9a044da08882846212c38d91",
+ "lastKernelId": "4cad5b27-583d-4c4e-947c-f47bdf2d4754"
},
"hide_input": false,
"kernelspec": {
@@ -694,7 +704,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.7.2"
+ "version": "3.7.4"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,