aboutsummaryrefslogtreecommitdiffstats
path: root/librecrypt_context_set_pepper.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-05-20 23:04:11 +0200
committerMattias Andrée <m@maandree.se>2026-05-20 23:04:11 +0200
commitc35b47228f5494f4d806e9166628110af6dd2469 (patch)
tree3b5a123af999a5e047b8565efee293a5d95c3f6c /librecrypt_context_set_pepper.c
parentPrepare for supporting custom algorithms (diff)
downloadlibrecrypt-master.tar.gz
librecrypt-master.tar.bz2
librecrypt-master.tar.xz
Add (so far untested and undocument) support for pepperHEADmaster
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'librecrypt_context_set_pepper.c')
-rw-r--r--librecrypt_context_set_pepper.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/librecrypt_context_set_pepper.c b/librecrypt_context_set_pepper.c
new file mode 100644
index 0000000..a5d6151
--- /dev/null
+++ b/librecrypt_context_set_pepper.c
@@ -0,0 +1,37 @@
+/* See LICENSE file for copyright and license details. */
+#include "common.h"
+#ifndef TEST
+
+
+int
+librecrypt_context_set_pepper(LIBRECRYPT_CONTEXT *ctx, enum librecrypt_hash_algorithm algo, const void *data, size_t len)
+{
+ struct pepper *pepper;
+
+ pepper = librecrypt_context_get_pepper_(ctx, algo, len);
+ if (!pepper)
+ return -1;
+
+ pepper->data = data;
+ pepper->len = len;
+ return 0;
+}
+
+
+#else
+
+
+int
+main(void)
+{
+ SET_UP_ALARM();
+ INIT_RESOURCE_TEST();
+
+ /* TODO test */
+
+ STOP_RESOURCE_TEST();
+ return 0;
+}
+
+
+#endif