New header file pkcs1-internal.h
[gd/nettle] / pkcs1-internal.h
1 /* pkcs1-internal.h
2
3    Copyright (C) 2018 Niels Möller
4    Copyright (C) 2018 Red Hat, Inc.
5
6    This file is part of GNU Nettle.
7
8    GNU Nettle is free software: you can redistribute it and/or
9    modify it under the terms of either:
10
11      * the GNU Lesser General Public License as published by the Free
12        Software Foundation; either version 3 of the License, or (at your
13        option) any later version.
14
15    or
16
17      * the GNU General Public License as published by the Free
18        Software Foundation; either version 2 of the License, or (at your
19        option) any later version.
20
21    or both in parallel, as here.
22
23    GNU Nettle is distributed in the hope that it will be useful,
24    but WITHOUT ANY WARRANTY; without even the implied warranty of
25    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
26    General Public License for more details.
27
28    You should have received copies of the GNU General Public License and
29    the GNU Lesser General Public License along with this program.  If
30    not, see http://www.gnu.org/licenses/.
31 */
32
33 #ifndef NETTLE_PKCS1_INTERNAL_H_INCLUDED
34 #define NETTLE_PKCS1_INTERNAL_H_INCLUDED
35
36 #include "nettle-types.h"
37
38 #define _pkcs1_sec_decrypt _nettle_pkcs1_sec_decrypt
39 #define _pkcs1_sec_decrypt_variable _nettle_pkcs1_sec_decrypt_variable
40
41 /* additional resistance to memory access side-channel attacks.
42  * Note: message buffer is returned unchanged on error */
43 int
44 _pkcs1_sec_decrypt (size_t length, uint8_t *message,
45                     size_t padded_message_length,
46                     const volatile uint8_t *padded_message);
47
48 int
49 _pkcs1_sec_decrypt_variable(size_t *length, uint8_t *message,
50                             size_t padded_message_length,
51                             const volatile uint8_t *padded_message);
52
53 #endif /* NETTLE_PKCS1_INTERNAL_H_INCLUDED */