cph6 / zsync

zsync - rsync over http
202 stars 48 forks source link

is it possible to replace sha1.c by openssl #1

Open wendal opened 7 years ago

wendal commented 7 years ago

https://github.com/openssl/openssl/blob/6f0ac0e2f27d9240516edb9a23b7863e7ad02898/include/openssl/sha.h

wendal commented 7 years ago
< #include <openssl/sha.h>
52c51
< SHA_CTX shactx;
---
> SHA1_CTX shactx;
293c292
<                 SHA1_Update(&shactx, outbuf, blocksize - zs.avail_out);
---
>                 SHA1Update(&shactx, outbuf, blocksize - zs.avail_out);
367c366
<             SHA1_Update(&shactx, buf, got);
---
>             SHA1Update(&shactx, buf, got);
718c717
<     SHA1_Init(&shactx);
---
>     SHA1Init(&shactx);
873c880
<         SHA1_Final(digest, &shactx);
---
>         SHA1Final(digest, &shactx);

and link with -lssl -lcrypto