Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/block-sha1/sha1.h # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / block-sha1 / sha1.h` 24 lines ยท 737 bytes Raw Blame History 1 /* 2 * SHA1 routine optimized to do word accesses rather than byte accesses, 3 * and to avoid unnecessary copies into the context array. 4 * 5 * This was initially based on the Mozilla SHA1 implementation, although 6 * none of the original Mozilla code remains. 7 */ 8 9 typedef struct { 10 unsigned long long size; 11 unsigned int H[5]; 12 unsigned int W[16]; 13 } blk_SHA_CTX; 14 15 void blk_SHA1_Init(blk_SHA_CTX *ctx); 16 void blk_SHA1_Update(blk_SHA_CTX *ctx, const void *dataIn, size_t len); 17 void blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx); 18 19 #ifndef platform_SHA_CTX 20 #define platform_SHA_CTX blk_SHA_CTX 21 #define platform_SHA1_Init blk_SHA1_Init 22 #define platform_SHA1_Update blk_SHA1_Update 23 #define platform_SHA1_Final blk_SHA1_Final 24 #endif