1 /* gmp-glue.h
2 
3    Copyright (C) 2013 Niels Möller
4    Copyright (C) 2013 Red Hat
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_GMP_GLUE_H_INCLUDED
34 #define NETTLE_GMP_GLUE_H_INCLUDED
35 
36 #include <nettle/bignum.h>
37 
38 /* Like mpn_set_str, but always writes rn limbs. If input is larger,
39    higher bits are ignored. */
40 void
41 mpn_set_base256 (mp_limb_t *rp, mp_size_t rn,
42 		 const uint8_t *xp, size_t xn);
43 
44 void
45 mpn_get_base256 (uint8_t *rp, size_t rn,
46 	         const mp_limb_t *xp, mp_size_t xn);
47 
48 #endif /* NETTLE_GMP_GLUE_H_INCLUDED */
49