From ccf60aeae6b9e9137fb3a765632f20a0c04e2858 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Mon, 15 Dec 2014 21:57:06 +0100 Subject: Updated name and fixed som copy crimes. --- src/sw/rosc_tester.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'src/sw') 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 #======================================================================= -- cgit v1.2.3