]> git.meshlink.io Git - meshlink/blobdiff - src/chacha-poly1305/chacha-poly1305.h
Use the ChaCha-Poly1305 cipher for the SPTPS protocol.
[meshlink] / src / chacha-poly1305 / chacha-poly1305.h
diff --git a/src/chacha-poly1305/chacha-poly1305.h b/src/chacha-poly1305/chacha-poly1305.h
new file mode 100644 (file)
index 0000000..af7eaf5
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef CHACHA_POLY1305_H
+#define CHACHA_POLY1305_H
+
+#define CHACHA_POLY1305_KEYLEN 64
+
+typedef struct chacha_poly1305_ctx chacha_poly1305_ctx_t;
+
+extern chacha_poly1305_ctx_t *chacha_poly1305_init(void);
+extern void chacha_poly1305_exit(chacha_poly1305_ctx_t *);
+extern bool chacha_poly1305_set_key(chacha_poly1305_ctx_t *ctx, const void *key);
+
+extern bool chacha_poly1305_encrypt(chacha_poly1305_ctx_t *ctx, uint64_t seqnr, const void *indata, size_t inlen, void *outdata, size_t *outlen);
+extern bool chacha_poly1305_decrypt(chacha_poly1305_ctx_t *ctx, uint64_t seqnr, const void *indata, size_t inlen, void *outdata, size_t *outlen);
+
+#endif //CHACHA_POLY1305_H