[Cryptech-Commits] [test/novena_trng] 01/01: Adding initial version of the argparser.
git at cryptech.is
git at cryptech.is
Sat Dec 20 07:58:09 UTC 2014
This is an automated email from the git hooks/post-receive script.
joachim at secworks.se pushed a commit to branch master
in repository test/novena_trng.
commit 670e21811e2a118dca194da01ff5187907d6ed44
Author: Joachim Strömbergson <joachim at secworks.se>
Date: Sat Dec 20 08:58:05 2014 +0100
Adding initial version of the argparser.
---
src/sw/trng_extract.py | 28 +++++++++++++++++++++++-----
1 file changed, 23 insertions(+), 5 deletions(-)
diff --git a/src/sw/trng_extract.py b/src/sw/trng_extract.py
index a47fb54..9492f53 100755
--- a/src/sw/trng_extract.py
+++ b/src/sw/trng_extract.py
@@ -318,22 +318,40 @@ def looptest(dev):
# main
#----------------------------------------------------------------
def main():
- if VERBOSE:
- print("Starting trng data extraction.")
-
- my_commdev = Comm()
+ # my_commdev = Comm()
# looptest(my_commdev)
# get_avalanche_entropy()
# get_avalanche_delta()
- get_rosc_entropy(my_commdev)
+ # get_rosc_entropy(my_commdev)
# get_rosc_raw()
# get_rng_data()
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument('-d', '--debug', dest='debug', action='store_true',
+ help='Pring debug information.')
+
+ parser.add_argument('-v', '--verbose', dest='verbose', action='store_true',
+ help='Increase verbosity.')
+
+ parser.add_argument('-i', dest='device', default=I2C_DEVICE,
+ help='I2C device name (default ' + I2C_DEVICE + ')')
+
+ parser.add_argument('-n', dest='num_words', default=NUM_WORDS,
+ help='Number of 32-bit words to extract (default ' +
+ str(NUM_WORDS) + ')')
+
+
+ args = parser.parse_args()
+ DEBUG = args.debug
+ VERBOSE = args.verbose
+
+
#-------------------------------------------------------------------
# __name__
# Python thingy which allows the file to be run standalone as
More information about the Commits
mailing list