diff options
Diffstat (limited to 'xchapolybox.h')
-rw-r--r-- | xchapolybox.h | 25 |
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 |