Documentation for SHA, Secure Hash Algorithm
Based upon :
FIPS 180-1, May 1994, by National Institute of Standards and Technology,
and Applied Cryptography, by Bruce Schneier.

The attached .EXE and C code implement the SHA algorithm.
Source is based heavily on the above documents.
There are four modes of use :
1.      To perform the test in Appendix A of FIPS 180-1, and verify the 
correct hash value is returned. 
This also displays the "W" data generated in the SHA expansion phase, in HEX.
Useful for testing the actual implementation steps are correct.
The "t" data is supplied in the standard, for this test, so I have not
displayed it.
        
        Command - SHATEST 1

2.      To perform the test in Appendix B of FIPS 180-1, and verify the 
correct hash value is returned.
        
        Command - SHATEST 2

3.      A time trial is run, testing the time taken to hash 1 million 
bytes, and returning a bytes/second figure and seconds taken.
        A 486DX/33 shows about 185,000 bytes/second.
        A 386SX/16 is about 40,000 bytes/second
        The initial version, FIPS 180, was slightly faster, about
        200,000 bytes/second on a 486/33.
        Time taken does vary slightly, depending upon content of the string 
        being hashed.
        
        Command - SHATEST T     (Note upper case !!!)

4.      User is prompted for a string from the keyboard, and hash value
output displayed. Useful for testing and evaluating the SHA.
        
        Command - SHATEST

All hash values are shown in HEX.
I hope this helps anyone developing or evaluating SHA or other hash 
algorithms.
Comments are welcome - programming is a learning hobby for me, so the code
is not "pretty", and could be optimised and imporved somewhat, I expect.

Lyal Collins
Compuserve 100353,2506, lyalc@sleeper.apana.org.au
