aboutsummaryrefslogtreecommitdiffstats
path: root/libhashsum.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2024-09-06 20:00:21 +0200
committerMattias Andrée <maandree@kth.se>2024-09-06 20:00:21 +0200
commite08dff210507b3a56e8aa1cd14d653ecfb3228f9 (patch)
tree66771aef79dd8e5da0d88035cf601d0219d7010d /libhashsum.h
parentDocument standard_partial_byte_{in,out}put_encoding in man pages (diff)
downloadlibhashsum-e08dff210507b3a56e8aa1cd14d653ecfb3228f9.tar.gz
libhashsum-e08dff210507b3a56e8aa1cd14d653ecfb3228f9.tar.bz2
libhashsum-e08dff210507b3a56e8aa1cd14d653ecfb3228f9.tar.xz
Add hash_excess_bits
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--libhashsum.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/libhashsum.h b/libhashsum.h
index 6ac9fc8..ea31b9d 100644
--- a/libhashsum.h
+++ b/libhashsum.h
@@ -340,7 +340,7 @@ enum {
/**
* Message hash functions and state
*
- * @since 1.0
+ * @since 1.0, 1.1
*/
struct libhashsum_hasher {
/**
@@ -466,6 +466,21 @@ struct libhashsum_hasher {
unsigned char standard_partial_byte_output_encoding; /* TODO test */
/**
+ * The size of the hash is rounded up to whole octet in
+ * `.hash_size`, in the case that the hash size is not
+ * a while number of octets, the returned hash will be
+ * padded, on the most significant part of the last byte,
+ * with cleared bits. This fields specifies the number
+ * of pad bits, which is always 0 if for hash functions
+ * that only support whole octet hash sizes (most of them;
+ * when `.standard_partial_byte_output_encoding` is set
+ * to `LIBHASHSUM_UNSUPPORTED`)
+ *
+ * @since 1.1
+ */
+ unsigned char hash_excess_bits; /* TODO test */
+
+ /**
* Update the hash state given additional
* input data
*