Download raw body.
add some helper functions to compute hashes
On 2023/02/23 17:45:46 +0100, Stefan Sperling <stsp@stsp.name> wrote: > Given that tests are passing I think you should go ahead with this. > I didn't spot any mistakes reading through, and I like the names > you have chosen. Thanks :) here's the follow-up diff that removes the now unused sha1 bits from inflate/deflate diff /home/op/w/got commit - ae25a666dd4099105786ef32f1e6ebaf92abe64d path + /home/op/w/got blob - 68040e9a601ee88f5422f037dee26c3ce0213fc0 file + lib/deflate.c --- lib/deflate.c +++ lib/deflate.c @@ -88,9 +88,6 @@ csum_output(struct got_deflate_checksum *csum, const u if (csum->output_crc) *csum->output_crc = crc32(*csum->output_crc, buf, len); - if (csum->output_sha1) - SHA1Update(csum->output_sha1, buf, len); - if (csum->output_ctx) got_hash_update(csum->output_ctx, buf, len); } blob - b2bda4a5026dccd005650cb802799dd42a235574 file + lib/got_lib_deflate.h --- lib/got_lib_deflate.h +++ lib/got_lib_deflate.h @@ -18,9 +18,6 @@ struct got_deflate_checksum { /* If not NULL, mix output bytes into this CRC checksum. */ uint32_t *output_crc; - /* If not NULL, mix output bytes into this SHA1 context. */ - SHA1_CTX *output_sha1; - /* If not NULL, mix output bytes into this hash context. */ struct got_hash *output_ctx; }; blob - 1f5de8404ec67a5500a3ef801466a208558ba9d3 file + lib/got_lib_inflate.h --- lib/got_lib_inflate.h +++ lib/got_lib_inflate.h @@ -18,18 +18,12 @@ struct got_inflate_checksum { /* If not NULL, mix input bytes into this CRC checksum. */ uint32_t *input_crc; - /* If not NULL, mix input bytes into this SHA1 context. */ - SHA1_CTX *input_sha1; - /* if not NULL, mix input bytes into this hash context. */ struct got_hash *input_ctx; /* If not NULL, mix output bytes into this CRC checksum. */ uint32_t *output_crc; - /* If not NULL, mix output bytes into this SHA1 context. */ - SHA1_CTX *output_sha1; - /* If not NULL, mix output bytes into this hash context. */ struct got_hash *output_ctx; }; blob - adf582371c406cc4a2a79408bde3913ff792159f file + lib/inflate.c --- lib/inflate.c +++ lib/inflate.c @@ -93,9 +93,6 @@ csum_input(struct got_inflate_checksum *csum, const ui if (csum->input_crc) *csum->input_crc = crc32(*csum->input_crc, buf, len); - if (csum->input_sha1) - SHA1Update(csum->input_sha1, buf, len); - if (csum->input_ctx) got_hash_update(csum->input_ctx, buf, len); } @@ -106,9 +103,6 @@ csum_output(struct got_inflate_checksum *csum, const u if (csum->output_crc) *csum->output_crc = crc32(*csum->output_crc, buf, len); - if (csum->output_sha1) - SHA1Update(csum->output_sha1, buf, len); - if (csum->output_ctx) got_hash_update(csum->output_ctx, buf, len); }
add some helper functions to compute hashes