From 3a73ab675a19e2ea29b4cb1385db0188ce4997f8 Mon Sep 17 00:00:00 2001
From: Mattias Andrée <maandree@kth.se>
Date: Sat, 24 Aug 2024 11:26:42 +0200
Subject: Make algorithms optional
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Mattias Andrée <maandree@kth.se>
---
 libhashsum.h | 34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

(limited to 'libhashsum.h')

diff --git a/libhashsum.h b/libhashsum.h
index 0bfb48a..1e453b3 100644
--- a/libhashsum.h
+++ b/libhashsum.h
@@ -382,7 +382,8 @@ struct libhashsum_hasher {
  * @param   algorithm  The hashing algorithm
  * @return             0 on success, -1 on failure
  * 
- * @throws  EINVAL  `algorithm` is unsupported
+ * @throws  EINVAL  `algorithm` is not recognised
+ * @throws  ENOSYS  Support for `algorithm` was excluded at compile time
  * 
  * @since  1.0
  */
@@ -396,7 +397,7 @@ int libhashsum_init_hasher(struct libhashsum_hasher *this, enum libhashsum_algor
  * @param   this  The output parameter for the functions, details, and state
  * @return        0 on success, -1 on failure
  * 
- * Failure isn't actually possible, so this function always return 0
+ * @throws  ENOSYS  Support was excluded at compile time
  * 
  * @since  1.0
  */
@@ -410,7 +411,7 @@ int libhashsum_init_md2_hasher(struct libhashsum_hasher *this);
  * @param   this  The output parameter for the functions, details, and state
  * @return        0 on success, -1 on failure
  * 
- * Failure isn't actually possible, so this function always return 0
+ * @throws  ENOSYS  Support was excluded at compile time
  * 
  * @since  1.0
  */
@@ -424,7 +425,7 @@ int libhashsum_init_md4_hasher(struct libhashsum_hasher *this);
  * @param   this  The output parameter for the functions, details, and state
  * @return        0 on success, -1 on failure
  * 
- * Failure isn't actually possible, so this function always return 0
+ * @throws  ENOSYS  Support was excluded at compile time
  * 
  * @since  1.0
  */
@@ -438,7 +439,7 @@ int libhashsum_init_md5_hasher(struct libhashsum_hasher *this);
  * @param   this  The output parameter for the functions, details, and state
  * @return        0 on success, -1 on failure
  * 
- * Failure isn't actually possible, so this function always return 0
+ * @throws  ENOSYS  Support was excluded at compile time
  * 
  * @since  1.0
  */
@@ -452,7 +453,7 @@ int libhashsum_init_ripemd_128_hasher(struct libhashsum_hasher *this);
  * @param   this  The output parameter for the functions, details, and state
  * @return        0 on success, -1 on failure
  * 
- * Failure isn't actually possible, so this function always return 0
+ * @throws  ENOSYS  Support was excluded at compile time
  * 
  * @since  1.0
  */
@@ -466,7 +467,7 @@ int libhashsum_init_ripemd_160_hasher(struct libhashsum_hasher *this);
  * @param   this  The output parameter for the functions, details, and state
  * @return        0 on success, -1 on failure
  * 
- * Failure isn't actually possible, so this function always return 0
+ * @throws  ENOSYS  Support was excluded at compile time
  * 
  * @since  1.0
  */
@@ -480,7 +481,7 @@ int libhashsum_init_ripemd_256_hasher(struct libhashsum_hasher *this);
  * @param   this  The output parameter for the functions, details, and state
  * @return        0 on success, -1 on failure
  * 
- * Failure isn't actually possible, so this function always return 0
+ * @throws  ENOSYS  Support was excluded at compile time
  * 
  * @since  1.0
  */
@@ -494,7 +495,7 @@ int libhashsum_init_ripemd_320_hasher(struct libhashsum_hasher *this);
  * @param   this  The output parameter for the functions, details, and state
  * @return        0 on success, -1 on failure
  * 
- * Failure isn't actually possible, so this function always return 0
+ * @throws  ENOSYS  Support was excluded at compile time
  * 
  * @since  1.0
  */
@@ -508,7 +509,7 @@ int libhashsum_init_sha0_hasher(struct libhashsum_hasher *this);
  * @param   this  The output parameter for the functions, details, and state
  * @return        0 on success, -1 on failure
  * 
- * Failure isn't actually possible, so this function always return 0
+ * @throws  ENOSYS  Support was excluded at compile time
  * 
  * @since  1.0
  */
@@ -522,7 +523,7 @@ int libhashsum_init_sha1_hasher(struct libhashsum_hasher *this);
  * @param   this  The output parameter for the functions, details, and state
  * @return        0 on success, -1 on failure
  * 
- * Failure isn't actually possible, so this function always return 0
+ * @throws  ENOSYS  Support was excluded at compile time
  * 
  * @since  1.0
  */
@@ -536,7 +537,7 @@ int libhashsum_init_sha_224_hasher(struct libhashsum_hasher *this);
  * @param   this  The output parameter for the functions, details, and state
  * @return        0 on success, -1 on failure
  * 
- * Failure isn't actually possible, so this function always return 0
+ * @throws  ENOSYS  Support was excluded at compile time
  * 
  * @since  1.0
  */
@@ -550,7 +551,7 @@ int libhashsum_init_sha_256_hasher(struct libhashsum_hasher *this);
  * @param   this  The output parameter for the functions, details, and state
  * @return        0 on success, -1 on failure
  * 
- * Failure isn't actually possible, so this function always return 0
+ * @throws  ENOSYS  Support was excluded at compile time
  * 
  * @since  1.0
  */
@@ -564,7 +565,7 @@ int libhashsum_init_sha_384_hasher(struct libhashsum_hasher *this);
  * @param   this  The output parameter for the functions, details, and state
  * @return        0 on success, -1 on failure
  * 
- * Failure isn't actually possible, so this function always return 0
+ * @throws  ENOSYS  Support was excluded at compile time
  * 
  * @since  1.0
  */
@@ -578,7 +579,7 @@ int libhashsum_init_sha_512_hasher(struct libhashsum_hasher *this);
  * @param   this  The output parameter for the functions, details, and state
  * @return        0 on success, -1 on failure
  * 
- * Failure isn't actually possible, so this function always return 0
+ * @throws  ENOSYS  Support was excluded at compile time
  * 
  * @since  1.0
  */
@@ -592,7 +593,7 @@ int libhashsum_init_sha_512_224_hasher(struct libhashsum_hasher *this);
  * @param   this  The output parameter for the functions, details, and state
  * @return        0 on success, -1 on failure
  * 
- * Failure isn't actually possible, so this function always return 0
+ * @throws  ENOSYS  Support was excluded at compile time
  * 
  * @since  1.0
  */
@@ -612,6 +613,7 @@ int libhashsum_init_sha_512_256_hasher(struct libhashsum_hasher *this);
  * @throws  EINVAL  `hashbits` is invalid (neither 224, 256, 384, nor 512)
  * @throws  EINVAL  The combination of `algobits` and `hashbits` is invalid
  *                  (`hashbits` is 384 or 512 but `algobits` is 32)
+ * @throws  ENOSYS  Support was excluded at compile time
  * 
  * @since  1.0
  */
-- 
cgit v1.2.3-70-g09d2