aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox/chacha20/chacha.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcryptobox/chacha20/chacha.h')
-rw-r--r--src/libcryptobox/chacha20/chacha.h27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/libcryptobox/chacha20/chacha.h b/src/libcryptobox/chacha20/chacha.h
index 7f93a4517..02d6dba00 100644
--- a/src/libcryptobox/chacha20/chacha.h
+++ b/src/libcryptobox/chacha20/chacha.h
@@ -29,6 +29,10 @@
#define CHACHA_BLOCKBYTES 64
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct chacha_state_internal_t {
unsigned char s[48];
size_t rounds;
@@ -53,26 +57,31 @@ typedef struct chacha_iv24_t {
} chacha_iv24;
void hchacha (const unsigned char key[32], const unsigned char iv[16],
- unsigned char out[32], size_t rounds);
+ unsigned char out[32], size_t rounds);
void chacha_init (chacha_state *S, const chacha_key *key, const chacha_iv *iv,
- size_t rounds);
+ size_t rounds);
void xchacha_init (chacha_state *S, const chacha_key *key,
- const chacha_iv24 *iv, size_t rounds);
+ const chacha_iv24 *iv, size_t rounds);
size_t chacha_update (chacha_state *S, const unsigned char *in,
- unsigned char *out, size_t inlen);
+ unsigned char *out, size_t inlen);
size_t chacha_final (chacha_state *S, unsigned char *out);
void chacha (const chacha_key *key, const chacha_iv *iv,
- const unsigned char *in, unsigned char *out, size_t inlen,
- size_t rounds);
+ const unsigned char *in, unsigned char *out, size_t inlen,
+ size_t rounds);
+
void xchacha (const chacha_key *key, const chacha_iv24 *iv,
- const unsigned char *in, unsigned char *out, size_t inlen,
- size_t rounds);
+ const unsigned char *in, unsigned char *out, size_t inlen,
+ size_t rounds);
+
+const char *chacha_load (void);
-const char* chacha_load (void);
+#ifdef __cplusplus
+}
+#endif
#endif /* CHACHA_H_ */