blob: 06475e9487151809c3c7999721bd59dd833c93bf [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 *
Gilles Peskine5cc7bc52017-11-03 11:58:25 +01006 * Copyright (C) 2006-2017, ARM Limited, All Rights Reserved
Manuel Pégourié-Gonnard37ff1402015-09-04 14:21:07 +02007 * SPDX-License-Identifier: Apache-2.0
8 *
9 * Licensed under the Apache License, Version 2.0 (the "License"); you may
10 * not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020020 *
Manuel Pégourié-Gonnardfe446432015-03-06 13:17:10 +000021 * This file is part of mbed TLS (https://tls.mbed.org)
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020022 */
23
Gilles Peskine5cc7bc52017-11-03 11:58:25 +010024#ifndef MBEDTLS_PK_INTERNAL_H
25#define MBEDTLS_PK_INTERNAL_H
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020026
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020027#if !defined(MBEDTLS_CONFIG_FILE)
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020028#include "config.h"
Manuel Pégourié-Gonnardcef4ad22014-04-29 12:39:06 +020029#else
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020030#include MBEDTLS_CONFIG_FILE
Manuel Pégourié-Gonnardcef4ad22014-04-29 12:39:06 +020031#endif
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020032
33#include "pk.h"
34
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020035#if defined(MBEDTLS_PK_RSA_ALT_SUPPORT)
Manuel Pégourié-Gonnard12c1ff02013-08-21 12:28:31 +020036/* Container for RSA-alt */
37typedef struct
38{
39 void *key;
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020040 mbedtls_pk_rsa_alt_decrypt_func decrypt_func;
41 mbedtls_pk_rsa_alt_sign_func sign_func;
42 mbedtls_pk_rsa_alt_key_len_func key_len_func;
43} mbedtls_rsa_alt_context;
Manuel Pégourié-Gonnard348bcb32015-03-31 14:01:33 +020044#endif
Manuel Pégourié-Gonnard12c1ff02013-08-21 12:28:31 +020045
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020046#if defined(MBEDTLS_RSA_C)
47extern const mbedtls_pk_info_t mbedtls_rsa_info;
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020048#endif
49
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020050#if defined(MBEDTLS_ECP_C)
51extern const mbedtls_pk_info_t mbedtls_eckey_info;
52extern const mbedtls_pk_info_t mbedtls_eckeydh_info;
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020053#endif
54
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020055#if defined(MBEDTLS_ECDSA_C)
56extern const mbedtls_pk_info_t mbedtls_ecdsa_info;
Manuel Pégourié-Gonnardd73b3c12013-08-12 17:06:05 +020057#endif
58
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020059#if defined(MBEDTLS_PK_RSA_ALT_SUPPORT)
60extern const mbedtls_pk_info_t mbedtls_rsa_alt_info;
Manuel Pégourié-Gonnard348bcb32015-03-31 14:01:33 +020061#endif
Manuel Pégourié-Gonnard12c1ff02013-08-21 12:28:31 +020062
Gilles Peskine5cc7bc52017-11-03 11:58:25 +010063#endif /* MBEDTLS_PK_INTERNAL_H */