]> git.meshlink.io Git - meshlink/blob - src/chacha-poly1305/chacha-poly1305.h
af7eaf5efd4cde08b1b470092add23b11fd9ad5a
[meshlink] / src / chacha-poly1305 / chacha-poly1305.h
1 #ifndef CHACHA_POLY1305_H
2 #define CHACHA_POLY1305_H
3
4 #define CHACHA_POLY1305_KEYLEN 64
5
6 typedef struct chacha_poly1305_ctx chacha_poly1305_ctx_t;
7
8 extern chacha_poly1305_ctx_t *chacha_poly1305_init(void);
9 extern void chacha_poly1305_exit(chacha_poly1305_ctx_t *);
10 extern bool chacha_poly1305_set_key(chacha_poly1305_ctx_t *ctx, const void *key);
11
12 extern bool chacha_poly1305_encrypt(chacha_poly1305_ctx_t *ctx, uint64_t seqnr, const void *indata, size_t inlen, void *outdata, size_t *outlen);
13 extern bool chacha_poly1305_decrypt(chacha_poly1305_ctx_t *ctx, uint64_t seqnr, const void *indata, size_t inlen, void *outdata, size_t *outlen);
14
15 #endif //CHACHA_POLY1305_H