blob: 5619c013c91a46eb503188234f1e94ff40113b9b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
|