]> Kevux Git Server - rit/commit
hash: expose hash context functions to Rust
authorbrian m. carlson <sandals@crustytoothpaste.net>
Sat, 7 Feb 2026 20:04:40 +0000 (20:04 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 8 Feb 2026 01:41:02 +0000 (17:41 -0800)
commit9a1fa36fe3dbed82ae7f9906ba1ac6d391c18f17
tree3ae06a9c9be6ba44ae3a44ecf9f36173af020f74
parente54bedc169cf6f4fe73143ecf5f3725e3af884c3
hash: expose hash context functions to Rust

We'd like to be able to hash our data in Rust using the same contexts as
in C.  However, we need our helper functions to not be inline so they
can be linked into the binary appropriately.  In addition, to avoid
managing memory manually and since we don't know the size of the hash
context structure, we want to have simple alloc and free functions we
can use to make sure a context can be easily dynamically created.

Expose the helper functions and create alloc, free, and init functions
we can call.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
hash.c
hash.h