Main Page   Compound List   File List   Compound Members   File Members  

sha2.h

Go to the documentation of this file.
00001 
00011 #define COMMENT
00012 
00015 #ifndef SHA2_H
00016 #define SHA2_H
00017 
00018 #include "mainDefs.h"
00019 #include "hashcom.h"
00020 #include <string.h>
00021 
00022 #ifndef SHA2_SMALL
00023   #define SHA2_SMALL   0  /* low footprint sha-1 */
00024 #endif
00025 
00026 #define SHA2_DIGEST_SIZE   (8*sizeof(uns64))
00027 
00028 typedef struct {
00029   uns64 state[8];
00030   uns8 buf[128];
00031   uns32 count[4];
00032 } sha2_context;
00033 
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037 
00038 #ifdef WIN32
00039  #ifdef CRYPTO_EXPORTS
00040    #define extern   extern __declspec(dllexport)
00041  #else
00042    #define extern   extern __declspec(dllimport)
00043  #endif
00044 #endif
00045 
00046 extern void sha2_init(sha2_context *c);
00047 extern void sha2_update(sha2_context *c, uns8 *input, unsigned int inLen);
00048 extern void sha2_final(uns8 *digest, sha2_context *c);
00049 
00050 #ifdef __cplusplus
00051 }
00052 #endif
00053 
00054 #ifdef WIN32
00055   #undef extern
00056 #endif
00057 
00058 /*
00059 sha2(abc) = ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f
00060 */
00061 
00062 #endif


Confidential