[Cryptech-Commits] [test/novena_trng] 01/01: Updated name and fixed som copy crimes.

git at cryptech.is git at cryptech.is
Mon Dec 15 20:57:14 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 ccf60aeae6b9e9137fb3a765632f20a0c04e2858
Author: Joachim Strömbergson <joachim at secworks.se>
Date:   Mon Dec 15 21:57:06 2014 +0100

    Updated name and fixed som copy crimes.
---
 src/sw/rosc_tester.py | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/src/sw/rosc_tester.py b/src/sw/rosc_tester.py
index f5ee65e..980ffea 100755
--- a/src/sw/rosc_tester.py
+++ b/src/sw/rosc_tester.py
@@ -2,19 +2,10 @@
 # -*- coding: utf-8 -*-
 #=======================================================================
 #
-# hash_tester.py
+# rosc_tester.py
 # --------------
-# This program sends several commands to the coretest_hashes subsystem
-# in order to verify the SHA-1, SHA-256 and SHA-512/x hash function
-# cores. The program will use the built in hash implementations in
-# Python to do functional comparison and validation.
-#
-# This version of the program talks to the FPGA over an I2C bus, but
-# does not require any additional modules.
-#
-# The single and dual block test cases are taken from the
-# NIST KAT document:
-# http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA_All.pdf
+# This program tests the rosc entropy provider by extracting entropy
+# or counter values.
 #
 #
 # Authors: Joachim Strömbergson, Paul Selkirk
@@ -53,6 +44,8 @@
 import sys
 import io
 import fcntl
+import argparse
+
 
 #-------------------------------------------------------------------
 # Defines.
@@ -721,9 +714,7 @@ def TC16(i2c):
 #----------------------------------------------------------------
 # main
 #----------------------------------------------------------------
-if __name__ == '__main__':
-    import argparse
-
+def main():
     all_tests = [TC16]
 #    all_tests = [TC12]
     all_tests2 = [ TC1, TC2, TC3, TC4, TC5, TC6, TC7, TC8, TC9, TC10 ]
@@ -772,6 +763,16 @@ if __name__ == '__main__':
                     else:
                         all_tests[n-1](i)
 
+
+#-------------------------------------------------------------------
+# __name__
+# Python thingy which allows the file to be run standalone as
+# well as parsed from within a Python interpreter.
+#-------------------------------------------------------------------
+if __name__=="__main__":
+    # Run the main function.
+    sys.exit(main())
+
 #=======================================================================
-# EOF hash_tester.py
+# EOF rosc_tester.py
 #=======================================================================



More information about the Commits mailing list