ReactOS  0.4.15-dev-3428-g0609db5
pk_internal.h
Go to the documentation of this file.
1 
6 /*
7  * Copyright The Mbed TLS Contributors
8  * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
9  *
10  * This file is provided under the Apache License 2.0, or the
11  * GNU General Public License v2.0 or later.
12  *
13  * **********
14  * Apache License 2.0:
15  *
16  * Licensed under the Apache License, Version 2.0 (the "License"); you may
17  * not use this file except in compliance with the License.
18  * You may obtain a copy of the License at
19  *
20  * http://www.apache.org/licenses/LICENSE-2.0
21  *
22  * Unless required by applicable law or agreed to in writing, software
23  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
24  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25  * See the License for the specific language governing permissions and
26  * limitations under the License.
27  *
28  * **********
29  *
30  * **********
31  * GNU General Public License v2.0 or later:
32  *
33  * This program is free software; you can redistribute it and/or modify
34  * it under the terms of the GNU General Public License as published by
35  * the Free Software Foundation; either version 2 of the License, or
36  * (at your option) any later version.
37  *
38  * This program is distributed in the hope that it will be useful,
39  * but WITHOUT ANY WARRANTY; without even the implied warranty of
40  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41  * GNU General Public License for more details.
42  *
43  * You should have received a copy of the GNU General Public License along
44  * with this program; if not, write to the Free Software Foundation, Inc.,
45  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
46  *
47  * **********
48  */
49 
50 #ifndef MBEDTLS_PK_WRAP_H
51 #define MBEDTLS_PK_WRAP_H
52 
53 #if !defined(MBEDTLS_CONFIG_FILE)
54 #include "config.h"
55 #else
56 #include MBEDTLS_CONFIG_FILE
57 #endif
58 
59 #include "pk.h"
60 
62 {
65 
67  const char *name;
68 
70  size_t (*get_bitlen)( const void * );
71 
74 
76  int (*verify_func)( void *ctx, mbedtls_md_type_t md_alg,
77  const unsigned char *hash, size_t hash_len,
78  const unsigned char *sig, size_t sig_len );
79 
81  int (*sign_func)( void *ctx, mbedtls_md_type_t md_alg,
82  const unsigned char *hash, size_t hash_len,
83  unsigned char *sig, size_t *sig_len,
84  int (*f_rng)(void *, unsigned char *, size_t),
85  void *p_rng );
86 
87 #if defined(MBEDTLS_ECDSA_C) && defined(MBEDTLS_ECP_RESTARTABLE)
88 
89  int (*verify_rs_func)( void *ctx, mbedtls_md_type_t md_alg,
90  const unsigned char *hash, size_t hash_len,
91  const unsigned char *sig, size_t sig_len,
92  void *rs_ctx );
93 
95  int (*sign_rs_func)( void *ctx, mbedtls_md_type_t md_alg,
96  const unsigned char *hash, size_t hash_len,
97  unsigned char *sig, size_t *sig_len,
98  int (*f_rng)(void *, unsigned char *, size_t),
99  void *p_rng, void *rs_ctx );
100 #endif /* MBEDTLS_ECDSA_C && MBEDTLS_ECP_RESTARTABLE */
101 
103  int (*decrypt_func)( void *ctx, const unsigned char *input, size_t ilen,
104  unsigned char *output, size_t *olen, size_t osize,
105  int (*f_rng)(void *, unsigned char *, size_t),
106  void *p_rng );
107 
109  int (*encrypt_func)( void *ctx, const unsigned char *input, size_t ilen,
110  unsigned char *output, size_t *olen, size_t osize,
111  int (*f_rng)(void *, unsigned char *, size_t),
112  void *p_rng );
113 
115  int (*check_pair_func)( const void *pub, const void *prv );
116 
118  void * (*ctx_alloc_func)( void );
119 
121  void (*ctx_free_func)( void *ctx );
122 
123 #if defined(MBEDTLS_ECDSA_C) && defined(MBEDTLS_ECP_RESTARTABLE)
124 
125  void * (*rs_alloc_func)( void );
126 
128  void (*rs_free_func)( void *rs_ctx );
129 #endif /* MBEDTLS_ECDSA_C && MBEDTLS_ECP_RESTARTABLE */
130 
133 
134 };
135 #if defined(MBEDTLS_PK_RSA_ALT_SUPPORT)
136 /* Container for RSA-alt */
137 typedef struct
138 {
139  void *key;
144 #endif
145 
146 #if defined(MBEDTLS_RSA_C)
148 #endif
149 
150 #if defined(MBEDTLS_ECP_C)
153 #endif
154 
155 #if defined(MBEDTLS_ECDSA_C)
157 #endif
158 
159 #if defined(MBEDTLS_PK_RSA_ALT_SUPPORT)
161 #endif
162 
163 #endif /* MBEDTLS_PK_WRAP_H */
static UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
const mbedtls_pk_info_t mbedtls_ecdsa_info
int(* encrypt_func)(void *ctx, const unsigned char *input, size_t ilen, unsigned char *output, size_t *olen, size_t osize, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Definition: pk_internal.h:109
const mbedtls_pk_info_t mbedtls_rsa_alt_info
mbedtls_pk_rsa_alt_decrypt_func decrypt_func
Definition: pk_internal.h:140
mbedtls_pk_type_t
Public key types.
Definition: pk.h:103
mbedtls_pk_type_t type
Definition: pk_internal.h:64
Public Key abstraction layer.
int(* decrypt_func)(void *ctx, const unsigned char *input, size_t ilen, unsigned char *output, size_t *olen, size_t osize, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Definition: pk_internal.h:103
size_t(* mbedtls_pk_rsa_alt_key_len_func)(void *ctx)
Definition: pk.h:212
int hash
Definition: main.c:58
mbedtls_pk_rsa_alt_key_len_func key_len_func
Definition: pk_internal.h:142
const char * name
Definition: pk_internal.h:67
__kernel_size_t size_t
Definition: linux.h:237
mbedtls_pk_rsa_alt_sign_func sign_func
Definition: pk_internal.h:141
int(* check_pair_func)(const void *pub, const void *prv)
Definition: pk_internal.h:115
size_t(* get_bitlen)(const void *)
Definition: pk_internal.h:70
const mbedtls_pk_info_t mbedtls_rsa_info
void(* debug_func)(const void *ctx, mbedtls_pk_debug_item *items)
Definition: pk_internal.h:132
GLenum GLenum GLenum input
Definition: glext.h:9031
int(* can_do)(mbedtls_pk_type_t type)
Definition: pk_internal.h:73
int(* verify_func)(void *ctx, mbedtls_md_type_t md_alg, const unsigned char *hash, size_t hash_len, const unsigned char *sig, size_t sig_len)
Definition: pk_internal.h:76
int(* mbedtls_pk_rsa_alt_sign_func)(void *ctx, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode, mbedtls_md_type_t md_alg, unsigned int hashlen, const unsigned char *hash, unsigned char *sig)
Definition: pk.h:208
int(* mbedtls_pk_rsa_alt_decrypt_func)(void *ctx, int mode, size_t *olen, const unsigned char *input, unsigned char *output, size_t output_max_len)
Types for RSA-alt abstraction.
Definition: pk.h:205
const mbedtls_pk_info_t mbedtls_eckeydh_info
const mbedtls_pk_info_t mbedtls_eckey_info
mbedtls_md_type_t
Supported message digests.
Definition: md.h:83
static TCHAR * items[]
Definition: page1.c:45
Item to send to the debug module.
Definition: pk.h:137
void(* ctx_free_func)(void *ctx)
Definition: pk_internal.h:121
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
int(* sign_func)(void *ctx, mbedtls_md_type_t md_alg, const unsigned char *hash, size_t hash_len, unsigned char *sig, size_t *sig_len, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Definition: pk_internal.h:81