aboutsummaryrefslogtreecommitdiffstats
path: root/libhashsum_init_shake_hasher.3
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_init_shake_hasher.3
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 'libhashsum_init_shake_hasher.3')
-rw-r--r--libhashsum_init_shake_hasher.313
1 files changed, 12 insertions, 1 deletions
diff --git a/libhashsum_init_shake_hasher.3 b/libhashsum_init_shake_hasher.3
index 5ab1320..0891274 100644
--- a/libhashsum_init_shake_hasher.3
+++ b/libhashsum_init_shake_hasher.3
@@ -15,6 +15,7 @@ libhashsum_init_shake_hasher - initialise state for SHAKE hashing
unsigned char \fIsupports_non_whole_bytes\fP;
unsigned char \fIstandard_partial_byte_input_encoding\fP;
unsigned char \fIstandard_partial_byte_output_encoding\fP;
+ unsigned char \fIhash_excess_bits\fP;
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);
@@ -83,7 +84,17 @@ will be set to the block size, in bytes.
.PP
.I hasher->hash_size
will be set to the hash size, in bytes
-.RI ( (hashbits?hashbits:hcapbits)/8 ).
+.RI ( ((hashbits?hashbits:hcapbits)+7)/8 ).
+.PP
+.I hasher->hash_excess_bits
+will be set to number of bits the last byte in
+the hash is padded with (it will be padded with
+cleared bits in its most significant part). As
+long as
+.I hashbits
+is a multiple of 8, this number will be 0 (the
+entire last byte is used), otherwise, it will be
+.IR 8-(hashbits&7) .
.PP
.I hasher->hash_output
will be set to