00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00026 #ifndef _SHA1_H
00027 #define _SHA1_H
00028
00029 #include "beecrypt/beecrypt.h"
00030 #include "beecrypt/sha1opt.h"
00031
00035 #ifdef __cplusplus
00036 struct BEECRYPTAPI sha1Param
00037 #else
00038 struct _sha1Param
00039 #endif
00040 {
00043 uint32_t h[5];
00046 uint32_t data[80];
00051 #if (MP_WBITS == 64)
00052 mpw length[1];
00053 #elif (MP_WBITS == 32)
00054 mpw length[2];
00055 #else
00056 # error
00057 #endif
00058
00062 uint32_t offset;
00063 };
00064
00065 #ifndef __cplusplus
00066 typedef struct _sha1Param sha1Param;
00067 #endif
00068
00069 #ifdef __cplusplus
00070 extern "C" {
00071 #endif
00072
00076 extern BEECRYPTAPI const hashFunction sha1;
00077
00083 BEECRYPTAPI
00084 void sha1Process(sha1Param* sp);
00085
00092 BEECRYPTAPI
00093 int sha1Reset (sha1Param* sp);
00094
00103 BEECRYPTAPI
00104 int sha1Update (sha1Param* sp, const byte* data, size_t size);
00105
00113 BEECRYPTAPI
00114 int sha1Digest (sha1Param* sp, byte* digest);
00115
00116 #ifdef __cplusplus
00117 }
00118 #endif
00119
00120 #endif