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
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
00060
00061
00062 #endif