aboutsummaryrefslogtreecommitdiffstats
path: root/xchapolybox.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-02-06 04:28:11 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-02-06 04:53:20 +0100
commit1a36870b778da19e4699f921697a8d500a67c821 (patch)
tree6fb54e656a559019eb60e7d6fdb47222b604514d /xchapolybox.h
downloadxchapolybox-master.tar.xz
xchapolybox-master.zip
Import random encryption codeHEADmaster
Diffstat (limited to 'xchapolybox.h')
-rw-r--r--xchapolybox.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/xchapolybox.h b/xchapolybox.h
new file mode 100644
index 0000000..5619c01
--- /dev/null
+++ b/xchapolybox.h
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: MIT
+ *
+ * Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
+ */
+
+#ifndef XCHAPOLYBOX_H
+#define XCHAPOLYBOX_H
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <sys/types.h>
+
+enum {
+ XCHAPOLYBOX_OVERHEAD_LEN = 24 + 16,
+ XCHAPOLYBOX_KEY_LEN = 32
+};
+
+void xchapolybox_seal(uint8_t *dst, const uint8_t *src, size_t src_len,
+ const uint8_t key[static XCHAPOLYBOX_KEY_LEN]);
+bool __attribute__((__warn_unused_result__))
+xchapolybox_open(uint8_t *dst, const uint8_t *src, size_t src_len,
+ const uint8_t key[static XCHAPOLYBOX_KEY_LEN]);
+void xchapolybox_genkey(uint8_t key[static XCHAPOLYBOX_KEY_LEN]);
+
+#endif