aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Strömbergson <joachim@secworks.se>2014-12-15 21:57:06 +0100
committerJoachim Strömbergson <joachim@secworks.se>2014-12-15 21:57:06 +0100
commitccf60aeae6b9e9137fb3a765632f20a0c04e2858 (patch)
treeea8a634a3a767d8d464c8c13279012ad696fe262
parent40228041877c373a9f8f8d33068534cade212311 (diff)
Updated name and fixed som copy crimes.
-rwxr-xr-xsrc/sw/rosc_tester.py33
1 files 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
#=======================================================================