Re: [PATCH 2/7] Makefile: optionally compile with both SHA1DC and SHA1_OPENSSL

2017-04-18 Thread Johannes Schindelin
Hi Junio, On Thu, 30 Mar 2017, Junio C Hamano wrote: > Johannes Schindelin writes: > > > +#ifdef SHA1_DC_AND_OPENSSL > > +void (*SHA1_Init_func)(SHA_CTX_union *ctx) = (void *)SHA1DCInit; > > +void (*SHA1_Update_func)(SHA_CTX_union *ctx, const void *pointer, size_t

Re: [PATCH 2/7] Makefile: optionally compile with both SHA1DC and SHA1_OPENSSL

2017-03-30 Thread Junio C Hamano
Junio C Hamano writes: > ... > The use of union is a good ingredient for a solution. I would have > chosen to do this slightly differently if I were doing it. > > typedef struct { > int safe; > union { >

Re: [PATCH 2/7] Makefile: optionally compile with both SHA1DC and SHA1_OPENSSL

2017-03-30 Thread Junio C Hamano
Johannes Schindelin writes: > +#ifdef SHA1_DC_AND_OPENSSL > +void (*SHA1_Init_func)(SHA_CTX_union *ctx) = (void *)SHA1DCInit; > +void (*SHA1_Update_func)(SHA_CTX_union *ctx, const void *pointer, size_t > size) = > + (void *)git_SHA1DCUpdate; > +int

Re: [PATCH 2/7] Makefile: optionally compile with both SHA1DC and SHA1_OPENSSL

2017-03-25 Thread Ævar Arnfjörð Bjarmason
On Sat, Mar 25, 2017 at 12:24 AM, Johannes Schindelin wrote: > The collision detection is not for free, though: when using the SHA1DC > code, calculating the SHA-1 takes substantially longer than using > OpenSSL's (in some case hardware-accelerated) SHA1-routines, and

[PATCH 2/7] Makefile: optionally compile with both SHA1DC and SHA1_OPENSSL

2017-03-24 Thread Johannes Schindelin
Nowadays, there are practical collision attacks on the SHA-1 algorithm. For that reason, Git integrated code that detects attempts to sneak in objects using those known attack vectors and enabled it by default. The collision detection is not for free, though: when using the SHA1DC code,