aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox/cryptobox.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-08 13:32:53 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-08 13:32:53 +0100
commit4cc70328cf728643450ad25eb4c8718942a19e1d (patch)
treed724a566b7e4dbcbecf6118194f05f854389976e /src/libcryptobox/cryptobox.h
parentf33dfad9746ac11d187fc2b1d6330106c8d59d17 (diff)
downloadrspamd-4cc70328cf728643450ad25eb4c8718942a19e1d.tar.gz
rspamd-4cc70328cf728643450ad25eb4c8718942a19e1d.zip
Use new siphash implementation.
Diffstat (limited to 'src/libcryptobox/cryptobox.h')
-rw-r--r--src/libcryptobox/cryptobox.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libcryptobox/cryptobox.h b/src/libcryptobox/cryptobox.h
index 0a689d7de..b60af5619 100644
--- a/src/libcryptobox/cryptobox.h
+++ b/src/libcryptobox/cryptobox.h
@@ -30,12 +30,14 @@
#define rspamd_cryptobox_SKBYTES 32
#define rspamd_cryptobox_MACBYTES 16
#define rspamd_cryptobox_NMBYTES 32
+#define rspamd_cryptobox_SIPKEYBYTES 16
typedef guchar rspamd_pk_t[rspamd_cryptobox_PKBYTES];
typedef guchar rspamd_sk_t[rspamd_cryptobox_SKBYTES];
typedef guchar rspamd_sig_t[rspamd_cryptobox_MACBYTES];
typedef guchar rspamd_nm_t[rspamd_cryptobox_NMBYTES];
typedef guchar rspamd_nonce_t[rspamd_cryptobox_NONCEBYTES];
+typedef guchar rspamd_sipkey_t[rspamd_cryptobox_SIPKEYBYTES];
/**
* Init cryptobox library
@@ -116,4 +118,15 @@ void rspamd_cryptobox_nm (rspamd_nm_t nm, const rspamd_pk_t pk, const rspamd_sk_
*/
void rspamd_explicit_memzero (void * const buf, gsize buflen);
+/**
+ * Calculates siphash-2-4 for a message
+ * @param out (8 bytes output)
+ * @param in
+ * @param inlen
+ * @param k key (must be 16 bytes)
+ */
+void rspamd_cryptobox_siphash (unsigned char *out, const unsigned char *in,
+ unsigned long long inlen,
+ const rspamd_sipkey_t k);
+
#endif /* CRYPTOBOX_H_ */