/home/dko/projects/mobilec/trunk/src/security/xyssl-0.7/include/xyssl/sha4.h

Go to the documentation of this file.
00001 /* SVN FILE INFO
00002  * $Revision: 174 $ : Last Committed Revision
00003  * $Date: 2008-06-24 10:50:29 -0700 (Tue, 24 Jun 2008) $ : Last Committed Date */
00007 #ifndef _SHA4_H
00008 #define _SHA4_H
00009 
00010 #ifdef __cplusplus
00011 extern "C" {
00012 #endif
00013 
00014 #if defined(_MSC_VER) || defined(__WATCOMC__)
00015 #define UL64(x) x##ui64
00016 #define uint64 unsigned __int64
00017 #else
00018 #define UL64(x) x##ULL
00019 #define uint64 unsigned long long
00020 #endif
00021 
00025 typedef struct
00026 {
00027     uint64 total[2];            
00028     uint64 state[8];            
00029     unsigned char buffer[128];  
00030     unsigned char ipad[64];     
00031     unsigned char opad[64];     
00032     int is384;                  
00033 }
00034 sha4_context;
00035 
00042 void sha4_starts( sha4_context *ctx, int is384 );
00043 
00051 void sha4_update( sha4_context *ctx, unsigned char *input, int ilen );
00052 
00059 void sha4_finish( sha4_context *ctx, unsigned char *output );
00060 
00069 void sha4( unsigned char *input,  int ilen,
00070            unsigned char *output, int is384 );
00071 
00082 int sha4_file( char *path, unsigned char *output, int is384 );
00083 
00092 void sha4_hmac_starts( sha4_context *ctx,  int is384,
00093                        unsigned char *key, int keylen );
00094 
00102 void sha4_hmac_update( sha4_context *ctx,
00103                        unsigned char *input, int ilen );
00104 
00111 void sha4_hmac_finish( sha4_context *ctx, unsigned char *output );
00112 
00123 void sha4_hmac( unsigned char *key,  int keylen,
00124                 unsigned char *input,  int ilen,
00125                 unsigned char *output, int is384 );
00126 
00132 int sha4_self_test( int verbose );
00133 
00134 #ifdef __cplusplus
00135 }
00136 #endif
00137 
00138 #endif /* sha4.h */

Generated on Tue Jul 1 15:29:58 2008 for Mobile-C by  doxygen 1.5.4