From cf0f05362e71c189b8052bbfddd2f270f907041e Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 24 Aug 2024 01:05:44 +0200 Subject: Standardise how to interpret a partial byte MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libhashsum.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libhashsum.h') diff --git a/libhashsum.h b/libhashsum.h index 5fb71cf..0bfb48a 100644 --- a/libhashsum.h +++ b/libhashsum.h @@ -315,6 +315,13 @@ struct libhashsum_hasher { * Update the hash state given it's final * input data * + * Regardless of the algorithm's standard, the function + * will takes the lower bits from `data[bytes]`, if + * `extra_bits > 0` and use the for the additional bits; + * the least significant bit will be used as the first + * bit and the most significant bit will be used as the + * last bit + * * @param this The object containing this function pointer * @param data The new input data, the function may rewrite it's content * @param bytes The number of bytes available in `data` for reading @@ -333,6 +340,13 @@ struct libhashsum_hasher { * Update the hash state given it's final * input data * + * Regardless of the algorithm's standard, the function + * will takes the lower bits from `data[bytes]`, if + * `extra_bits > 0` and use the for the additional bits; + * the least significant bit will be used as the first + * bit and the most significant bit will be used as the + * last bit + * * @param this The object containing this function pointer * @param data The new input data, the function may rewrite it's content * @param bytes The number of bytes available in `data` for reading -- cgit v1.2.3-70-g09d2