Re: [PATCH 0/4] hash: introduce generic wrappers to update hash contexts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Patrick Steinhardt <ps@xxxxxx> writes:

> this patch series introduces a couple of generic wrappers to update hash
> contexts. Instead of updating contexts via function pointers provided by
> the hash algorithm, we now remember the hash algorithm in the context
> itself. As a result, subsequent calls that update the hash don't need to
> remember which algorithm they used:
>
>     ```
>     struct git_hash_ctx ctx;
>     struct object_id oid;
>
>     git_hash_sha1_init(&ctx);
>     git_hash_update(&ctx, data);
>     git_hash_final_oid(&oid, &ctx);
>     ```
>
> This was discussed in [1] and [2].
>
> The series is built on top of master at 3b0d05c4a7 (The fifth batch,
> 2025-01-29) with tb/unsafe-hashtcleanup at 04292c3796 (hash.h: drop
> unsafe_ function variants, 2025-01-23) merged into it.
>
> Thanks!
>
> Patrick
>
> [1]: <Z3fhK1ACzJfVehM2@xxxxxx>
> [2]: <Z4jyZCAwqOjZ-u2U@xxxxxx>

Sounds sensible.  

It seems to textually interact with Karthik's attempt to pass down a
hash_algo instance through the callchain in pack-write.c but I
should be able to resolve the conflicts.

Thanks.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux