]> git.ipfire.org Git - thirdparty/strongswan.git/blob - src/libstrongswan/plugins/chapoly/chapoly_aead.h
Update copyright headers after acquisition by secunet
[thirdparty/strongswan.git] / src / libstrongswan / plugins / chapoly / chapoly_aead.h
1 /*
2 * Copyright (C) 2015 Martin Willi
3 *
4 * Copyright (C) secunet Security Networks AG
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 */
16
17 /**
18 * @defgroup chapoly_aead chapoly_aead
19 * @{ @ingroup chapoly
20 */
21
22 #ifndef CHAPOLY_AEAD_H_
23 #define CHAPOLY_AEAD_H_
24
25 #include <crypto/aead.h>
26
27 typedef struct chapoly_aead_t chapoly_aead_t;
28
29 /**
30 * ChaCha20/Poly1305 AEAD implementation.
31 *
32 * TODO-Chapoly: draft-ietf-ipsecme-chacha20-poly1305-05
33 */
34 struct chapoly_aead_t {
35
36 /**
37 * Implements aead_t interface.
38 */
39 aead_t aead;
40 };
41
42 /**
43 * Create a chapoly_aead instance.
44 *
45 * @param algo algorithm to implement, ENCR_CHACHA20_POLY1305
46 * @param key_size key size in bytes, 32
47 * @param salt_size size of implicit salt length, 0
48 * @return AEAD, NULL if not supported
49 */
50 chapoly_aead_t *chapoly_aead_create(encryption_algorithm_t algo,
51 size_t key_size, size_t salt_size);
52
53 #endif /** CHAPOLY_AEAD_H_ @}*/