]> git.ipfire.org Git - thirdparty/strongswan.git/blob - src/libstrongswan/plugins/gcm/gcm_aead.h
Update copyright headers after acquisition by secunet
[thirdparty/strongswan.git] / src / libstrongswan / plugins / gcm / gcm_aead.h
1 /*
2 * Copyright (C) 2010 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 gcm_aead gcm_aead
19 * @{ @ingroup gcm
20 */
21
22 #ifndef GCM_AEAD_H_
23 #define GCM_AEAD_H_
24
25 #include <crypto/aead.h>
26
27 typedef struct gcm_aead_t gcm_aead_t;
28
29 /**
30 * Galois/Counter Mode (GCM).
31 *
32 * Implements GCM as specified in NIST 800-38D, using AEAD semantics from
33 * RFC 5282, based on RFC4106.
34 */
35 struct gcm_aead_t {
36
37 /**
38 * Implements aead_t interface.
39 */
40 aead_t aead;
41 };
42
43 /**
44 * Create a gcm_aead instance.
45 *
46 * @param algo algorithm to implement, a gcm mode
47 * @param key_size key size in bytes
48 * @param salt_size size of implicit salt length
49 * @return aead, NULL if not supported
50 */
51 gcm_aead_t *gcm_aead_create(encryption_algorithm_t algo, size_t key_size,
52 size_t salt_size);
53
54 #endif /** GCM_AEAD_H_ @}*/