[ESRG-CVS] sfesrg/esrgpcpj/shared/c_datd esrg_sha512.c, 1.4, 1.5 esrg_sha512.h, 1.3, 1.4
Brought to you by:
dtashley
|
From: David T. A. <dta...@us...> - 2009-11-29 02:16:14
|
Update of /cvsroot/esrg/sfesrg/esrgpcpj/shared/c_datd In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31511/shared/c_datd Modified Files: esrg_sha512.c esrg_sha512.h Log Message: Passed final review. Index: esrg_sha512.h =================================================================== RCS file: /cvsroot/esrg/sfesrg/esrgpcpj/shared/c_datd/esrg_sha512.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** esrg_sha512.h 28 Nov 2009 19:09:02 -0000 1.3 --- esrg_sha512.h 29 Nov 2009 02:16:05 -0000 1.4 *************** *** 11,20 **** #endif ! //Fundamental state (or RFC 1321 calls it context) for forming ! //MD5s. Conceptually private to this module. struct ESRG_SHA512_Sha512StateStruct { unsigned __int64 H0, H1, H2, H3, H4, H5, H6, H7; ! //Directly from FIPS 180-3. unsigned __int64 bit_count; //The count of bits processed thus far. The algorithm here --- 11,21 ---- #endif ! //Fundamental state for forming ! //SHA-512s. Conceptually private to this module. struct ESRG_SHA512_Sha512StateStruct { unsigned __int64 H0, H1, H2, H3, H4, H5, H6, H7; ! //Directly from FIPS 180-3. In retrospect, this might have ! //been better implemented as an array. unsigned __int64 bit_count; //The count of bits processed thus far. The algorithm here *************** *** 22,30 **** //each byte processed. FIPS 180-3 calls for processing //messages up to length 2^128, but for obvious reasons ! //we don't do that. unsigned __int64 M[16]; ! //These are the words corresponding to the chars. We don't ! //dare union them because of big-endian/little-endian concerns. ! //The "M" nomenclature is from FIPS 180-3. unsigned char buf[128]; //We can't proceed to execute a round unless we have the --- 23,35 ---- //each byte processed. FIPS 180-3 calls for processing //messages up to length 2^128, but for obvious reasons ! //we don't do that. 2^64-1 bits is in excess of 2^61-1 ! //bytes, or somewhere around 2,000 terabytes. This ! //isn't a practical limit with current computer technology. unsigned __int64 M[16]; ! //These are the words corresponding to the chars (below). We don't ! //dare union to extract them because of big-endian/little-endian concerns. ! //The "M" nomenclature is from FIPS 180-3. At the time the ! //SHA-512 rounds are done, the chars (below) are converted to words ! //(this field) so that the rounds can be done using the words. unsigned char buf[128]; //We can't proceed to execute a round unless we have the *************** *** 36,39 **** --- 41,45 ---- }; + //Result structure, used to hold result. Caller is allowed to //pick it apart. *************** *** 46,49 **** --- 52,56 ---- }; + //Initializes the SHA512 calculation structure. DECMOD_ESRG_SHA512 *************** *** 74,77 **** --- 81,87 ---- /*************************************************************************** ** $Log$ + ** Revision 1.4 2009/11/29 02:16:05 dtashley + ** Passed final review. + ** ** Revision 1.3 2009/11/28 19:09:02 dtashley ** Appears to be working. Ready for final review and cleanup. Index: esrg_sha512.c =================================================================== RCS file: /cvsroot/esrg/sfesrg/esrgpcpj/shared/c_datd/esrg_sha512.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** esrg_sha512.c 28 Nov 2009 19:09:02 -0000 1.4 --- esrg_sha512.c 29 Nov 2009 02:16:05 -0000 1.5 *************** *** 131,134 **** --- 131,135 ---- } + //Copies the buffer of words into a string buffer of string length 128, and also places //the zero terminator, which means that the string supplied by the caller must be of size *************** *** 440,443 **** --- 441,447 ---- /****************************************************************************** ** $Log$ + ** Revision 1.5 2009/11/29 02:16:05 dtashley + ** Passed final review. + ** ** Revision 1.4 2009/11/28 19:09:02 dtashley ** Appears to be working. Ready for final review and cleanup. |