aboutsummaryrefslogtreecommitdiffstats
path: root/libhashsum_init_blakes_hasher.c
diff options
context:
space:
mode:
Diffstat (limited to 'libhashsum_init_blakes_hasher.c')
-rw-r--r--libhashsum_init_blakes_hasher.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libhashsum_init_blakes_hasher.c b/libhashsum_init_blakes_hasher.c
new file mode 100644
index 0000000..f5e7c20
--- /dev/null
+++ b/libhashsum_init_blakes_hasher.c
@@ -0,0 +1,28 @@
+/* See LICENSE file for copyright and license details. */
+#include "common.h"
+#ifdef SUPPORT_BLAKES
+
+
+int
+libhashsum_init_blakes_hasher(struct libhashsum_hasher *this, size_t hashbits)
+{
+ if (hashbits == 224U)
+ return libhashsum_init_blake224_hasher(this);
+ if (hashbits == 256U)
+ return libhashsum_init_blake256_hasher(this);
+
+ errno = EINVAL;
+ return -1;
+}
+
+
+#else
+int
+libhashsum_init_blakes_hasher(struct libhashsum_hasher *this, size_t hashbits)
+{
+ (void) this;
+ (void) hashbits;
+ errno = ENOSYS;
+ return -1;
+}
+#endif