aboutsummaryrefslogtreecommitdiffstats
path: root/libhashsum.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libhashsum.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/libhashsum.h b/libhashsum.h
index 203ec10..0e49083 100644
--- a/libhashsum.h
+++ b/libhashsum.h
@@ -12,9 +12,11 @@
#if defined(__GNUC__)
# define LIBHASHSUM_USERET_ __attribute__((__warn_unused_result__))
# define LIBHASHSUM_1_NONNULL_ __attribute__((__nonnull__(1)))
+# define LIBHASHSUM_NONNULL_ __attribute__((__nonnull__))
#else
# define LIBHASHSUM_USERET_
# define LIBHASHSUM_1_NONNULL_
+# define LIBHASHSUM_NONNULL_
#endif
@@ -402,6 +404,22 @@ LIBHASHSUM_1_NONNULL_
int libhashsum_init_hasher(struct libhashsum_hasher *this, enum libhashsum_algorithm algorithm);
/**
+ * Create an initialised state for a hash algorithm
+ * and return hash functions and details
+ *
+ * @param this The output parameter for the functions, details, and state
+ * @param algorithm The hashing algorithm and parameters
+ * @return 0 on success, -1 on failure
+ *
+ * @throws EINVAL `algorithm` is not recognised or contains an invalid value
+ * @throws ENOSYS Support for `algorithm` was excluded at compile time
+ *
+ * @since 1.0
+ */
+LIBHASHSUM_NONNULL_
+int libhashsum_init_hasher_from_string(struct libhashsum_hasher *this, const char *algorithm);
+
+/**
* Create an initialised state for MD2
* hashing and return hash functions and details
*