From d1acc40f9361cf5d1f0e92a0a2569b518b29b1cf Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 31 Aug 2024 07:41:27 +0200 Subject: Add support for extended hash + add support for output hash to custom buffer when supported MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libhashsum_init_blake256_hasher.3 | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'libhashsum_init_blake256_hasher.3') diff --git a/libhashsum_init_blake256_hasher.3 b/libhashsum_init_blake256_hasher.3 index c427f51..9baf5e3 100644 --- a/libhashsum_init_blake256_hasher.3 +++ b/libhashsum_init_blake256_hasher.3 @@ -16,6 +16,7 @@ libhashsum_init_blake256_hasher - initialise state for BLAKE256 hashing size_t (*\fIprocess\fP)(struct libhashsum_hasher *\fPthis\fP, const void *\fPdata\fP, size_t \fPbytes\fP); int (*\fIfinalise_const\fP)(struct libhashsum_hasher *\fPthis\fP, const void *\fPdata\fP, size_t \fPbytes\fP, unsigned \fPextra_bits\fP); int (*\fIfinalise\fP)(struct libhashsum_hasher *\fPthis\fP, void *\fPdata\fP, size_t \fPbytes\fP, unsigned \fPextra_bits\fP, size_t \fPsize\fP); + void (*\fIstretch\fP)(struct libhashsum_hasher *\fPthis\fP, int \fPskip\fP, void *\fPbuffer\fP); void (*\fIdestroy\fP)(struct libhashsum_hasher *\fPthis\fP); union libhashsum_state { /* definition omitted */ } \fIstate\fP; }; @@ -108,7 +109,7 @@ no greater than .I hasher->finalise_const will be set to a pointer to the function to call once the entire text being hashed has been loaded, -and to get the hash of the text. It's parameter +and to get the hash of the text. Its parameter .I this shall be set to .IR hasher . @@ -134,8 +135,16 @@ to a pointer to a buffer in containing the binary hash of the processed data. Otherwise, the function will return -1, and set .I errno -to indicate the error. The function will failure -if: +to indicate the error. However, if the user has +already set +.I hasher->hash_output +to a +.RI non- NULL +pointer, the function will output the binary hash +to that pointer instead without redirecting +.I hasher->hash_output +(the application must make sure this buffer is +sufficiently large). The function will failure if: .RS .TP .B EINVAL @@ -167,6 +176,10 @@ shall be set to the size of the buffer is otherwise identical to .IR *hasher->finalise_const . .PP +.I hasher->stretch +will be set to +.IR NULL . +.PP .I hasher->destroy will be set to .IR NULL . -- cgit v1.2.3-70-g09d2