aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox/cryptobox.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-21 23:17:26 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-21 23:17:26 +0100
commitc6d26c6ded5bd55a6201f14b027308538c6bf24b (patch)
tree5e3ef2459f3f6e87821ea2b25d8d08e7a75103f2 /src/libcryptobox/cryptobox.h
parent40071fa8499384b0edf8084e4abae4113c0b8ddc (diff)
downloadrspamd-c6d26c6ded5bd55a6201f14b027308538c6bf24b.tar.gz
rspamd-c6d26c6ded5bd55a6201f14b027308538c6bf24b.zip
Add PBKDF2-HMAC-Blake2 function.
Diffstat (limited to 'src/libcryptobox/cryptobox.h')
-rw-r--r--src/libcryptobox/cryptobox.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libcryptobox/cryptobox.h b/src/libcryptobox/cryptobox.h
index b60af5619..57fb0d3ab 100644
--- a/src/libcryptobox/cryptobox.h
+++ b/src/libcryptobox/cryptobox.h
@@ -129,4 +129,19 @@ void rspamd_cryptobox_siphash (unsigned char *out, const unsigned char *in,
unsigned long long inlen,
const rspamd_sipkey_t k);
+/**
+ * Derive key from password using PKCS#5 and HMAC-blake2
+ * @param pass input password
+ * @param pass_len length of the password
+ * @param salt input salt
+ * @param salt_len length of salt
+ * @param key output key
+ * @param key_len size of the key
+ * @param rounds number of rounds (should be reasonably high)
+ * @return TRUE in case of success and FALSE if failed
+ */
+gboolean rspamd_cryptobox_pbkdf(const char *pass, gsize pass_len,
+ const guint8 *salt, gsize salt_len, guint8 *key, gsize key_len,
+ unsigned int rounds);
+
#endif /* CRYPTOBOX_H_ */