pubkey: Move sexp parsing for gcry_pk_getkey to the modules.
[libgcrypt.git] / cipher / pubkey-internal.h
1 /* pubkey-internal.h  - Internal defs for pubkey.c
2  * Copyright (C) 2013 g10 code GmbH
3  *
4  * This file is part of Libgcrypt.
5  *
6  * Libgcrypt is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser general Public License as
8  * published by the Free Software Foundation; either version 2.1 of
9  * the License, or (at your option) any later version.
10  *
11  * Libgcrypt is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this program; if not, see <http://www.gnu.org/licenses/>.
18  */
19
20 #ifndef GCRY_PUBKEY_INTERNAL_H
21 #define GCRY_PUBKEY_INTERNAL_H
22
23 /*-- pubkey-util.c --*/
24 gpg_err_code_t _gcry_pk_util_get_nbits (gcry_sexp_t list,
25                                         unsigned int *r_nbits);
26 gpg_err_code_t _gcry_pk_util_get_rsa_use_e (gcry_sexp_t list,
27                                             unsigned long *r_e);
28
29
30
31 /*-- rsa-common.c --*/
32 gpg_err_code_t
33 _gcry_rsa_pkcs1_encode_for_enc (gcry_mpi_t *r_result, unsigned int nbits,
34                                 const unsigned char *value, size_t valuelen,
35                                 const unsigned char *random_override,
36                                 size_t random_override_len);
37 gpg_err_code_t
38 _gcry_rsa_pkcs1_decode_for_enc (unsigned char **r_result, size_t *r_resultlen,
39                                 unsigned int nbits, gcry_mpi_t value);
40 gpg_err_code_t
41 _gcry_rsa_pkcs1_encode_for_sig (gcry_mpi_t *r_result, unsigned int nbits,
42                                 const unsigned char *value, size_t valuelen,
43                                 int algo);
44 gpg_err_code_t
45 _gcry_rsa_oaep_encode (gcry_mpi_t *r_result, unsigned int nbits, int algo,
46                        const unsigned char *value, size_t valuelen,
47                        const unsigned char *label, size_t labellen,
48                        const void *random_override, size_t random_override_len);
49 gpg_err_code_t
50 _gcry_rsa_oaep_decode (unsigned char **r_result, size_t *r_resultlen,
51                        unsigned int nbits, int algo,
52                        gcry_mpi_t value,
53                        const unsigned char *label, size_t labellen);
54 gpg_err_code_t
55 _gcry_rsa_pss_encode (gcry_mpi_t *r_result, unsigned int nbits, int algo,
56                       const unsigned char *value, size_t valuelen, int saltlen,
57                       const void *random_override, size_t random_override_len);
58 gpg_err_code_t
59 _gcry_rsa_pss_verify (gcry_mpi_t value, gcry_mpi_t encoded,
60                       unsigned int nbits, int algo, size_t saltlen);
61
62
63
64 /*-- dsa-common.c --*/
65 gcry_mpi_t _gcry_dsa_gen_k (gcry_mpi_t q, int security_level);
66 gpg_err_code_t _gcry_dsa_gen_rfc6979_k (gcry_mpi_t *r_k,
67                                         gcry_mpi_t dsa_q, gcry_mpi_t dsa_x,
68                                         const unsigned char *h1,
69                                         unsigned int h1len,
70                                         int halgo,
71                                         unsigned int extraloops);
72
73
74 /*-- ecc.c --*/
75 gpg_err_code_t _gcry_pk_ecc_get_sexp (gcry_sexp_t *r_sexp, int mode,
76                                       mpi_ec_t ec);
77
78
79 #endif /*GCRY_PUBKEY_INTERNAL_H*/