aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox/cryptobox.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-06 17:15:32 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-06 17:15:32 +0000
commit87d450793780e9da74016277272b3a5b521f80ab (patch)
treec0270a57594a56943a03707c17ae6dd9e7a13b9e /src/libcryptobox/cryptobox.h
parent5773d9e998e626328bf49a655d49df4810e6f980 (diff)
downloadrspamd-87d450793780e9da74016277272b3a5b521f80ab.tar.gz
rspamd-87d450793780e9da74016277272b3a5b521f80ab.zip
Implement verification and keypair generation.
Diffstat (limited to 'src/libcryptobox/cryptobox.h')
-rw-r--r--src/libcryptobox/cryptobox.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/libcryptobox/cryptobox.h b/src/libcryptobox/cryptobox.h
index 565371b70..f0df9a188 100644
--- a/src/libcryptobox/cryptobox.h
+++ b/src/libcryptobox/cryptobox.h
@@ -35,6 +35,7 @@ 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];
/**
* Init cryptobox library
@@ -57,7 +58,8 @@ void rspamd_cryptobox_keypair (rspamd_pk_t pk, rspamd_sk_t sk);
* @param sig output signature
*/
void rspamd_cryptobox_encrypt_inplace (guchar *data, gsize len,
- gsize cnt, const rspamd_pk_t pk, const rspamd_sk_t sk, rspamd_sig_t sig);
+ const rspamd_nonce_t nonce,
+ const rspamd_pk_t pk, const rspamd_sk_t sk, rspamd_sig_t sig);
/**
@@ -70,7 +72,8 @@ void rspamd_cryptobox_encrypt_inplace (guchar *data, gsize len,
* @return TRUE if input has been verified successfully
*/
gboolean rspamd_cryptobox_decrypt_inplace (guchar *data, gsize len,
- const rspamd_pk_t pk, const rspamd_sk_t sk, const rspamd_sig_t sig);
+ const rspamd_nonce_t nonce,
+ const rspamd_pk_t pk, const rspamd_sk_t sk, const rspamd_sig_t sig);
/**
* Encrypt segments of data inplace adding signature to sig afterwards
@@ -81,7 +84,8 @@ gboolean rspamd_cryptobox_decrypt_inplace (guchar *data, gsize len,
* @param sig output signature
*/
void rspamd_cryptobox_encrypt_nm_inplace (guchar *data, gsize len,
- gsize cnt, const rspamd_nm_t nm, rspamd_sig_t sig);
+ const rspamd_nonce_t nonce,
+ const rspamd_nm_t nm, rspamd_sig_t sig);
/**
@@ -94,6 +98,7 @@ void rspamd_cryptobox_encrypt_nm_inplace (guchar *data, gsize len,
* @return TRUE if input has been verified successfully
*/
gboolean rspamd_cryptobox_decrypt_nm_inplace (guchar *data, gsize len,
+ const rspamd_nonce_t nonce,
const rspamd_nm_t nm, const rspamd_sig_t sig);
/**