block-sha1: make the 'ntohl()' part of the first SHA1 loop
[git/jrn.git] / block-sha1 / sha1.h
blob7be2d93a2a150b5c54e1d7192eefb5f0f0a8f1cf
1 /*
2 * Based on the Mozilla SHA1 (see mozilla-sha1/sha1.h),
3 * optimized to do word accesses rather than byte accesses,
4 * and to avoid unnecessary copies into the context array.
5 */
7 typedef struct {
8 unsigned int H[5];
9 unsigned int W[16];
10 int lenW;
11 unsigned long long size;
12 } blk_SHA_CTX;
14 void blk_SHA1_Init(blk_SHA_CTX *ctx);
15 void blk_SHA1_Update(blk_SHA_CTX *ctx, const void *dataIn, unsigned long len);
16 void blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx);
18 #define git_SHA_CTX blk_SHA_CTX
19 #define git_SHA1_Init blk_SHA1_Init
20 #define git_SHA1_Update blk_SHA1_Update
21 #define git_SHA1_Final blk_SHA1_Final