Elijah Newren | bc5c5ec | 2023-05-16 06:33:57 +0000 | [diff] [blame] | 1 | #include "git-compat-util.h" |
Elijah Newren | 08c46a4 | 2023-05-16 06:33:56 +0000 | [diff] [blame] | 2 | #include "hash-ll.h" |
Atousa Pahlevan Duprat | 001fd7a | 2015-11-04 22:38:42 -0800 | [diff] [blame] | 3 | |
| 4 | int git_SHA1_Update_Chunked(platform_SHA_CTX *c, const void *data, size_t len) |
| 5 | { |
| 6 | size_t nr; |
| 7 | size_t total = 0; |
| 8 | const char *cdata = (const char*)data; |
| 9 | |
| 10 | while (len) { |
| 11 | nr = len; |
| 12 | if (nr > SHA1_MAX_BLOCK_SIZE) |
| 13 | nr = SHA1_MAX_BLOCK_SIZE; |
| 14 | platform_SHA1_Update(c, cdata, nr); |
| 15 | total += nr; |
| 16 | cdata += nr; |
| 17 | len -= nr; |
| 18 | } |
| 19 | return total; |
| 20 | } |