aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorJ08nY2018-01-05 15:56:34 +0100
committerJ08nY2018-01-05 15:56:34 +0100
commit3a654a1b6919c8d4c5982dac645c227a8ff2c5f1 (patch)
tree6e48f02794932b50aacb10896358e44a4f074910 /util
parente9fcef97c71d01e92658af522b5ecb99a751b540 (diff)
downloadECTester-3a654a1b6919c8d4c5982dac645c227a8ff2c5f1.tar.gz
ECTester-3a654a1b6919c8d4c5982dac645c227a8ff2c5f1.tar.zst
ECTester-3a654a1b6919c8d4c5982dac645c227a8ff2c5f1.zip
Diffstat (limited to 'util')
-rwxr-xr-xutil/plot_dh.py3
-rwxr-xr-xutil/plot_gen.py3
2 files changed, 6 insertions, 0 deletions
diff --git a/util/plot_dh.py b/util/plot_dh.py
index 8c1dfff..2354688 100755
--- a/util/plot_dh.py
+++ b/util/plot_dh.py
@@ -20,6 +20,7 @@ from operator import itemgetter
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Plot ECTester ECDH timing.")
parser.add_argument("-o", "--output", dest="output", type=argparse.FileType("wb"), help="Write image to [file], do not display.", metavar="file")
+ parser.add_argument("--skip-first", dest="skip_first", action="store_true", help="Skip first entry, as it's usually a large outlier.")
parser.add_argument("file", type=str, help="The file to plot(csv).")
opts = parser.parse_args()
@@ -30,6 +31,8 @@ if __name__ == "__main__":
hx = lambda x: int(x, 16)
data = np.genfromtxt(opts.file, delimiter=";", skip_header=1, converters={2: hx, 3: hx, 4: hx}, dtype=np.dtype([("index","u4"), ("time","u4"), ("pub", "O"), ("priv", "O"), ("secret","O")]))
+ if opts.skip_first:
+ data = data[1:]
if "nano" in header_names[1]:
unit = r"$\mu s$"
diff --git a/util/plot_gen.py b/util/plot_gen.py
index 016dd15..12f7089 100755
--- a/util/plot_gen.py
+++ b/util/plot_gen.py
@@ -23,6 +23,7 @@ if __name__ == "__main__":
parser.add_argument("--pub", dest="pub", action="store_true", help="Show public key scatter plot.")
parser.add_argument("--priv", dest="priv", action="store_true", help="Show private key scatter plot.")
parser.add_argument("--hist", dest="hist", action="store_true", help="Show histogram.")
+ parser.add_argument("--skip-first", dest="skip_first", action="store_true", help="Skip first entry, as it's usually a large outlier.")
parser.add_argument("file", type=str, help="The file to plot(csv).")
opts = parser.parse_args()
@@ -39,6 +40,8 @@ if __name__ == "__main__":
hx = lambda x: int(x, 16)
data = np.genfromtxt(opts.file, delimiter=";", skip_header=1, converters={2: hx, 3: hx}, dtype=np.dtype([("index","u4"), ("time","u4"), ("pub", "O"), ("priv", "O")]))
+ if opts.skip_first:
+ data = data[1:]
if "nano" in header_names[1]:
unit = r"$\mu s$"