[ESRG-CVS] sfesrg/esrgpcpj/shared/c_datd esrg_sha512.c, NONE, 1.1 esrg_sha512.h, NONE, 1.1
Brought to you by:
dtashley
|
From: David T. A. <dta...@us...> - 2009-11-28 00:09:23
|
Update of /cvsroot/esrg/sfesrg/esrgpcpj/shared/c_datd In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8419 Added Files: esrg_sha512.c esrg_sha512.h Log Message: Initial checkin. --- NEW FILE: esrg_sha512.h --- /* $Header: /cvsroot/esrg/sfesrg/esrgpcpj/shared/c_datd/esrg_sha512.h,v 1.1 2009/11/28 00:09:15 dtashley Exp $ */ #ifndef ESRG_SHA512_H_INCLUDED #define ESRG_SHA512_H_INCLUDED #ifdef MODULE_ESRG_SHA512 #define DECMOD_ESRG_SHA512 #else #define DECMOD_ESRG_SHA512 extern #endif //Fundamental state (or RFC 1321 calls it context) for forming //MD5s. Conceptually private to this module. struct ESRG_SHA512_Sha512StateStruct { int placeholder; }; //Result structure, used to hold result. Caller is allowed to //pick it apart. struct ESRG_SHA512_Sha512ResultStruct { unsigned sha512_words[4]; char sha512_chars[129]; //Zero terminated string containing MD5 formed. }; //Initializes the SHA512 calculation structure. DECMOD_ESRG_SHA512 void ESRG_SHA512_Sha512StateStructOpen(struct ESRG_SHA512_Sha512StateStruct *arg); //Adds data to it. Zero length is OK. DECMOD_ESRG_SHA512 void ESRG_SHA512_Sha512StateStructAddData(struct ESRG_SHA512_Sha512StateStruct *arg, void *data, unsigned len); //Closes the structure and returns the SHA512. This is destructive--one cannot //continue adding characters. All characters returned are lower-case. DECMOD_ESRG_SHA512 void ESRG_SHA512_Sha512StateStructClose(struct ESRG_SHA512_Sha512StateStruct *state, struct ESRG_SHA512_Sha512ResultStruct *result); //Returns version control information. DECMOD_ESRG_SHA512 const char *ESRG_SHA512_cvcinfo(void); DECMOD_ESRG_SHA512 const char *ESRG_SHA512_hvcinfo(void); //Definition of the version of the H file, used for providing version control //information to external callers. #define ESRG_SHA512_H_VERSION ("$Header: /cvsroot/esrg/sfesrg/esrgpcpj/shared/c_datd/esrg_sha512.h,v 1.1 2009/11/28 00:09:15 dtashley Exp $") #endif /*************************************************************************** ** $Log: esrg_sha512.h,v $ ** Revision 1.1 2009/11/28 00:09:15 dtashley ** Initial checkin. ** **************************************************************************** ** End of ESRG_SHA512.H. */ --- NEW FILE: esrg_sha512.c --- /* $Header: /cvsroot/esrg/sfesrg/esrgpcpj/shared/c_datd/esrg_sha512.c,v 1.1 2009/11/28 00:09:15 dtashley Exp $ ** ** A description of the functionality of this module and the public interface ** definition is contained in the associated .H file. */ #define MODULE_ESRG_SHA512 #include <assert.h> #include <stddef.h> #include <string.h> #include "charfunc.h" #include "esrg_sha512.h" void ESRG_SHA512_Sha512StateStructOpen(struct ESRG_SHA512_Sha512StateStruct *arg) { } //Copies the byte buffer to the word buffer within the state block. //This is done in a way which hides big-endian/little-endian concerns. static void ESRG_SHA512_CopyBytesToWords(struct ESRG_SHA512_Sha512StateStruct *arg) { } //Does the SHA-512 rounds as specified by FIPS 180-3. static void ESRG_SHA512_DoSha512Rounds(struct ESRG_SHA512_Sha512StateStruct *arg) { } void ESRG_SHA512_Sha512StateStructAddData(struct ESRG_SHA512_Sha512StateStruct *arg, void *pointer_in, unsigned len) { } void ESRG_SHA512_Sha512StateStructClose(struct ESRG_SHA512_Sha512StateStruct *state, struct ESRG_SHA512_Sha512ResultStruct *result) { unsigned i; for (i=0; i<128; i++) result->sha512_chars[i] = 'X'; } //Returns version control string for file. // const char *ESRG_SHA512_cvcinfo(void) { return ("$Header: /cvsroot/esrg/sfesrg/esrgpcpj/shared/c_datd/esrg_sha512.c,v 1.1 2009/11/28 00:09:15 dtashley Exp $"); } //Returns version control string for associated .H file. // const char *ESRG_SHA512_hvcinfo(void) { return (ESRG_SHA512_H_VERSION); } /****************************************************************************** ** $Log: esrg_sha512.c,v $ ** Revision 1.1 2009/11/28 00:09:15 dtashley ** Initial checkin. ** ******************************************************************************* ** End of ESRG_SHA512.C. */ |