blob: 0a330876e23b6140c16ca09d2134fb51618bcdcb [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 *
Gilles Peskine5cc7bc52017-11-03 11:58:25 +01004 * \brief Public Key cryptography abstraction layer: built-in key types
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +02005 *
Unknown60b25f02018-02-06 03:17:59 -05006 * This file contains built-in types for handling various key types using
7 * the interface defined in pk_info.h.
8 *
9 * Copyright (C) 2006-2018, ARM Limited, All Rights Reserved
Manuel Pégourié-Gonnard37ff1402015-09-04 14:21:07 +020010 * SPDX-License-Identifier: Apache-2.0
11 *
12 * Licensed under the Apache License, Version 2.0 (the "License"); you may
13 * not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
15 *
16 * http://www.apache.org/licenses/LICENSE-2.0
17 *
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
20 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020023 *
Manuel Pégourié-Gonnardfe446432015-03-06 13:17:10 +000024 * This file is part of mbed TLS (https://tls.mbed.org)
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020025 */
26
Gilles Peskine5cc7bc52017-11-03 11:58:25 +010027#ifndef MBEDTLS_PK_INTERNAL_H
28#define MBEDTLS_PK_INTERNAL_H
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020029
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020030#if !defined(MBEDTLS_CONFIG_FILE)
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020031#include "config.h"
Manuel Pégourié-Gonnardcef4ad22014-04-29 12:39:06 +020032#else
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020033#include MBEDTLS_CONFIG_FILE
Manuel Pégourié-Gonnardcef4ad22014-04-29 12:39:06 +020034#endif
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020035
36#include "pk.h"
37
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020038#if defined(MBEDTLS_PK_RSA_ALT_SUPPORT)
Manuel Pégourié-Gonnard12c1ff02013-08-21 12:28:31 +020039/* Container for RSA-alt */
40typedef struct
41{
42 void *key;
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020043 mbedtls_pk_rsa_alt_decrypt_func decrypt_func;
44 mbedtls_pk_rsa_alt_sign_func sign_func;
45 mbedtls_pk_rsa_alt_key_len_func key_len_func;
46} mbedtls_rsa_alt_context;
Manuel Pégourié-Gonnard348bcb32015-03-31 14:01:33 +020047#endif
Manuel Pégourié-Gonnard12c1ff02013-08-21 12:28:31 +020048
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020049#if defined(MBEDTLS_RSA_C)
50extern const mbedtls_pk_info_t mbedtls_rsa_info;
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020051#endif
52
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020053#if defined(MBEDTLS_ECP_C)
54extern const mbedtls_pk_info_t mbedtls_eckey_info;
55extern const mbedtls_pk_info_t mbedtls_eckeydh_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_ECDSA_C)
59extern const mbedtls_pk_info_t mbedtls_ecdsa_info;
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020060#endif
61
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020062#if defined(MBEDTLS_PK_RSA_ALT_SUPPORT)
63extern const mbedtls_pk_info_t mbedtls_rsa_alt_info;
Manuel Pégourié-Gonnard348bcb32015-03-31 14:01:33 +020064#endif
Manuel Pégourié-Gonnard12c1ff02013-08-21 12:28:31 +020065
Gilles Peskine5cc7bc52017-11-03 11:58:25 +010066#endif /* MBEDTLS_PK_INTERNAL_H */