nettle  3.7.3
About: Nettle is a low-level cryptographic library.
  Fossies Dox: nettle-3.7.3.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

rsa-internal.h
Go to the documentation of this file.
1 /* rsa-internal.h
2 
3  The RSA publickey algorithm.
4 
5  Copyright (C) 2001, 2002 Niels Möller
6 
7  This file is part of GNU Nettle.
8 
9  GNU Nettle is free software: you can redistribute it and/or
10  modify it under the terms of either:
11 
12  * the GNU Lesser General Public License as published by the Free
13  Software Foundation; either version 3 of the License, or (at your
14  option) any later version.
15 
16  or
17 
18  * the GNU General Public License as published by the Free
19  Software Foundation; either version 2 of the License, or (at your
20  option) any later version.
21 
22  or both in parallel, as here.
23 
24  GNU Nettle is distributed in the hope that it will be useful,
25  but WITHOUT ANY WARRANTY; without even the implied warranty of
26  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27  General Public License for more details.
28 
29  You should have received copies of the GNU General Public License and
30  the GNU Lesser General Public License along with this program. If
31  not, see http://www.gnu.org/licenses/.
32 */
33 
34 #ifndef NETTLE_RSA_INTERNAL_H_INCLUDED
35 #define NETTLE_RSA_INTERNAL_H_INCLUDED
36 
37 #include "rsa.h"
38 
39 #define _rsa_verify _nettle_rsa_verify
40 #define _rsa_verify_recover _nettle_rsa_verify_recover
41 #define _rsa_check_size _nettle_rsa_check_size
42 #define _rsa_blind _nettle_rsa_blind
43 #define _rsa_unblind _nettle_rsa_unblind
44 #define _rsa_sec_compute_root_itch _nettle_rsa_sec_compute_root_itch
45 #define _rsa_sec_compute_root _nettle_rsa_sec_compute_root
46 #define _rsa_sec_compute_root_tr _nettle_rsa_sec_compute_root_tr
47 
48 /* Internal functions. */
49 int
50 _rsa_verify(const struct rsa_public_key *key,
51  const mpz_t m,
52  const mpz_t s);
53 
54 int
55 _rsa_verify_recover(const struct rsa_public_key *key,
56  mpz_t m,
57  const mpz_t s);
58 
59 size_t
61 
62 /* _rsa_blind and _rsa_unblind are deprecated, unused in the library,
63  and will likely be removed with the next ABI break. */
64 void
65 _rsa_blind (const struct rsa_public_key *pub,
66  void *random_ctx, nettle_random_func *random,
68 void
69 _rsa_unblind (const struct rsa_public_key *pub, mpz_t c, const mpz_t ri)
71 
72 /* side-channel silent root computation */
75 void
76 _rsa_sec_compute_root(const struct rsa_private_key *key,
77  mp_limb_t *rp, const mp_limb_t *mp,
78  mp_limb_t *scratch);
79 
80 /* Safe side-channel silent variant, using RSA blinding, and checking the
81  * result after CRT. In-place calls, with x == m, is allowed. */
82 int
84  const struct rsa_private_key *key,
85  void *random_ctx, nettle_random_func *random,
86  mp_limb_t *x, const mp_limb_t *m);
87 
88 #endif /* NETTLE_RSA_INTERNAL_H_INCLUDED */
#define _NETTLE_ATTRIBUTE_DEPRECATED
#define x
#define rp
__mpz_struct mpz_t[1]
Definition: mini-gmp.h:77
long mp_size_t
Definition: mini-gmp.h:61
unsigned long mp_limb_t
Definition: mini-gmp.h:60
void nettle_random_func(void *ctx, size_t length, uint8_t *dst)
Definition: nettle-types.h:75
#define _rsa_verify_recover
Definition: rsa-internal.h:40
#define _rsa_verify
Definition: rsa-internal.h:39
#define _rsa_sec_compute_root_itch
Definition: rsa-internal.h:44
#define _rsa_blind
Definition: rsa-internal.h:42
#define _rsa_sec_compute_root_tr
Definition: rsa-internal.h:46
#define _rsa_check_size
Definition: rsa-internal.h:41
#define _rsa_sec_compute_root
Definition: rsa-internal.h:45
#define _rsa_unblind
Definition: rsa-internal.h:43