]> git.ipfire.org Git - thirdparty/nettle.git/blame - gcm-internal.h
Add ChangeLog entry for nettle-3.10 release.
[thirdparty/nettle.git] / gcm-internal.h
CommitLineData
08b61857
NM
1/* gcm-internal.h
2
3 Copyright (C) 2024 Niels Möller
4
5 This file is part of GNU Nettle.
6
7 GNU Nettle is free software: you can redistribute it and/or
8 modify it under the terms of either:
9
10 * the GNU Lesser General Public License as published by the Free
11 Software Foundation; either version 3 of the License, or (at your
12 option) any later version.
13
14 or
15
16 * the GNU General Public License as published by the Free
17 Software Foundation; either version 2 of the License, or (at your
18 option) any later version.
19
20 or both in parallel, as here.
21
22 GNU Nettle is distributed in the hope that it will be useful,
23 but WITHOUT ANY WARRANTY; without even the implied warranty of
24 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 General Public License for more details.
26
27 You should have received copies of the GNU General Public License and
28 the GNU Lesser General Public License along with this program. If
29 not, see http://www.gnu.org/licenses/.
30*/
31
32#ifndef NETTLE_GCM_INTERNAL_H_INCLUDED
33#define NETTLE_GCM_INTERNAL_H_INCLUDED
34
35#include "gcm.h"
36
de8d84ce
NM
37#if HAVE_NATIVE_gcm_aes_encrypt
38
08b61857
NM
39/* Name mangling */
40#define _gcm_aes_encrypt _nettle_gcm_aes_encrypt
41#define _gcm_aes_decrypt _nettle_gcm_aes_decrypt
42
43/* To reduce the number of arguments (e.g., maximum of 6 register
44 arguments on x86_64), pass a pointer to gcm_key, which really is a
45 pointer to the first member of the appropriate gcm_aes*_ctx
46 struct. */
47size_t
48_gcm_aes_encrypt (struct gcm_key *key,
49 unsigned rounds,
50 size_t size, uint8_t *dst, const uint8_t *src);
51
52size_t
53_gcm_aes_decrypt (struct gcm_key *CTX,
54 unsigned rounds,
55 size_t size, uint8_t *dst, const uint8_t *src);
de8d84ce
NM
56#else /* !HAVE_NATIVE_gcm_aes_encrypt */
57#define _gcm_aes_encrypt(key, rounds, size, dst, src) 0
58#define _gcm_aes_decrypt(key, rounds, size, dst, src) 0
59#endif /* !HAVE_NATIVE_gcm_aes_encrypt */
08b61857
NM
60
61#endif /* NETTLE_GCM_INTERNAL_H_INCLUDED */