blob: 42d6bc0b698bf5325e2a77dda93cbc3b626bbf11 [file] [log] [blame]
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +02001/**
Gilles Peskine5cc7bc52017-11-03 11:58:25 +01002 * \file pk_internal.h
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +02003 *
Andrzej Kurekbba09272018-02-14 07:16:27 -05004 * \brief Public Key cryptography abstraction layer: internal definitions
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +02005 *
Andrzej Kurekbba09272018-02-14 07:16:27 -05006 * This file contains built-in types for handling natively supported key types
7 * using the interface defined in pk_info.h.
Unknown60b25f02018-02-06 03:17:59 -05008 *
Andrzej Kurekbba09272018-02-14 07:16:27 -05009 * \warning This file contains internal definitions for the library.
10 * The interfaces in this file may change in future versions of the
11 * library without notice.
12 */
13/*
Unknown60b25f02018-02-06 03:17:59 -050014 * Copyright (C) 2006-2018, ARM Limited, All Rights Reserved
Manuel Pégourié-Gonnard37ff1402015-09-04 14:21:07 +020015 * SPDX-License-Identifier: Apache-2.0
16 *
17 * Licensed under the Apache License, Version 2.0 (the "License"); you may
18 * not use this file except in compliance with the License.
19 * You may obtain a copy of the License at
20 *
21 * http://www.apache.org/licenses/LICENSE-2.0
22 *
23 * Unless required by applicable law or agreed to in writing, software
24 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
25 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26 * See the License for the specific language governing permissions and
27 * limitations under the License.
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020028 *
Manuel Pégourié-Gonnardfe446432015-03-06 13:17:10 +000029 * This file is part of mbed TLS (https://tls.mbed.org)
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020030 */
31
Gilles Peskine5cc7bc52017-11-03 11:58:25 +010032#ifndef MBEDTLS_PK_INTERNAL_H
33#define MBEDTLS_PK_INTERNAL_H
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020034
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020035#if !defined(MBEDTLS_CONFIG_FILE)
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020036#include "config.h"
Manuel Pégourié-Gonnardcef4ad22014-04-29 12:39:06 +020037#else
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020038#include MBEDTLS_CONFIG_FILE
Manuel Pégourié-Gonnardcef4ad22014-04-29 12:39:06 +020039#endif
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020040
41#include "pk.h"
42
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020043#if defined(MBEDTLS_PK_RSA_ALT_SUPPORT)
Manuel Pégourié-Gonnard12c1ff02013-08-21 12:28:31 +020044/* Container for RSA-alt */
45typedef struct
46{
47 void *key;
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020048 mbedtls_pk_rsa_alt_decrypt_func decrypt_func;
49 mbedtls_pk_rsa_alt_sign_func sign_func;
50 mbedtls_pk_rsa_alt_key_len_func key_len_func;
51} mbedtls_rsa_alt_context;
Manuel Pégourié-Gonnard348bcb32015-03-31 14:01:33 +020052#endif
Manuel Pégourié-Gonnard12c1ff02013-08-21 12:28:31 +020053
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020054#if defined(MBEDTLS_RSA_C)
55extern const mbedtls_pk_info_t mbedtls_rsa_info;
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020056#endif
57
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020058#if defined(MBEDTLS_ECP_C)
59extern const mbedtls_pk_info_t mbedtls_eckey_info;
60extern const mbedtls_pk_info_t mbedtls_eckeydh_info;
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020061#endif
62
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020063#if defined(MBEDTLS_ECDSA_C)
64extern const mbedtls_pk_info_t mbedtls_ecdsa_info;
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020065#endif
66
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020067#if defined(MBEDTLS_PK_RSA_ALT_SUPPORT)
68extern const mbedtls_pk_info_t mbedtls_rsa_alt_info;
Manuel Pégourié-Gonnard348bcb32015-03-31 14:01:33 +020069#endif
Manuel Pégourié-Gonnard12c1ff02013-08-21 12:28:31 +020070
Gilles Peskine5cc7bc52017-11-03 11:58:25 +010071#endif /* MBEDTLS_PK_INTERNAL_H */