2 * This code is included at the end of sha1dc/sha1.c with the
3 * SHA1DC_CUSTOM_TRAILING_INCLUDE_SHA1_C macro.
6 void git_SHA1DCFinal(unsigned char hash
[20], SHA1_CTX
*ctx
)
8 if (!SHA1DCFinal(hash
, ctx
))
10 die("SHA-1 appears to be part of a collision attack: %s",
14 void git_SHA1DCUpdate(SHA1_CTX
*ctx
, const void *vdata
, unsigned long len
)
16 const char *data
= vdata
;
17 /* We expect an unsigned long, but sha1dc only takes an int */
18 while (len
> INT_MAX
) {
19 SHA1DCUpdate(ctx
, data
, INT_MAX
);
23 SHA1DCUpdate(ctx
, data
, len
);