aboutsummaryrefslogtreecommitdiffstats
path: root/libhashsum.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2024-08-28 16:41:28 +0200
committerMattias Andrée <maandree@kth.se>2024-08-28 16:41:28 +0200
commit9a0a1b696a47041985ce4d3969ba5d1261105ff0 (patch)
tree1f07a2cd0b101668d174329bad6f630c44261602 /libhashsum.h
parentm misc (diff)
downloadlibhashsum-9a0a1b696a47041985ce4d3969ba5d1261105ff0.tar.gz
libhashsum-9a0a1b696a47041985ce4d3969ba5d1261105ff0.tar.bz2
libhashsum-9a0a1b696a47041985ce4d3969ba5d1261105ff0.tar.xz
m + add support for z parameter for keccak
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libhashsum.h')
-rw-r--r--libhashsum.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/libhashsum.h b/libhashsum.h
index 29a8f6f..65c3a66 100644
--- a/libhashsum.h
+++ b/libhashsum.h
@@ -37,8 +37,8 @@
*/
enum libhashsum_algorithm {
/* since 1.0 */
- LIBHASHSUM_MD2, /**< MD2 */
- LIBHASHSUM_MD4, /**< MD4 */
+ LIBHASHSUM_MD2, /**< MD2; this algorithm has been theoretically compromised */
+ LIBHASHSUM_MD4, /**< MD4; this algorithm has been compromised */
LIBHASHSUM_MD5, /**< MD5; this algorithm has been compromised */
LIBHASHSUM_RIPEMD_128, /**< RIPEMD-128 */
LIBHASHSUM_RIPEMD_160, /**< RIPEMD-160 */
@@ -422,8 +422,9 @@ union libhashsum_state {
uint8_t *dyn;
} sum;
const char *suffix;
+ size_t squeezes;
char algostr[256];
- } keccak; /* size = [1020, 1065] */
+ } keccak; /* size = [1024, 1072] */
#endif
#ifdef LIBHASHSUM_INCLUDE_LIBBLAKE_STATE
@@ -974,6 +975,7 @@ int libhashsum_init_keccak_512_hasher(struct libhashsum_hasher *this);
* @param ratebits Bitrate (in bits), 0 for automatic
* @param capbits Capacity in bits, 0 for automatic
* @param hashbits Hash output size in bits, 0 for automatic
+ * @param squeezes The number of squeezes to performed, 0 for automatic (which is 1)
* @return 0 on success, -1 on failure
*
* @throws EINVAL (`ratebits`, `capbits`, `hashbits`) is invalid
@@ -983,7 +985,8 @@ int libhashsum_init_keccak_512_hasher(struct libhashsum_hasher *this);
* @since 1.0
*/
LIBHASHSUM_1_NONNULL_
-int libhashsum_init_keccak_hasher(struct libhashsum_hasher *this, size_t ratebits, size_t capbits, size_t hashbits);
+int libhashsum_init_keccak_hasher(struct libhashsum_hasher *this, size_t ratebits,
+ size_t capbits, size_t hashbits, size_t squeezes);
/**
* Create an initialised state for SHA3-224