XiaokangQian | 7807f9f | 2022-02-15 10:04:37 +0000 | [diff] [blame] | 1 | |
| 2 | /** |
| 3 | * \file ecp_internal.h |
| 4 | * |
| 5 | * \brief ECC-related functions with external linkage but which are |
| 6 | * not part of the public API. |
| 7 | */ |
| 8 | /* |
| 9 | * Copyright The Mbed TLS Contributors |
| 10 | * 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. |
| 23 | */ |
| 24 | #ifndef MBEDTLS_ECP_INTERNAL_H |
| 25 | #define MBEDTLS_ECP_INTERNAL_H |
| 26 | |
| 27 | #include "common.h" |
| 28 | #include "mbedtls/ecp.h" |
| 29 | #include "mbedtls/ecdh.h" |
| 30 | |
| 31 | static inline mbedtls_ecp_group_id mbedtls_ecp_named_group_to_id( |
| 32 | uint16_t named_curve ) |
| 33 | { |
| 34 | const mbedtls_ecp_curve_info *curve_info; |
| 35 | curve_info = mbedtls_ecp_curve_info_from_tls_id( named_curve ); |
| 36 | if( curve_info == NULL ) |
| 37 | return( MBEDTLS_ECP_DP_NONE ); |
| 38 | return( curve_info->grp_id ); |
| 39 | } |
| 40 | |
| 41 | int mbedtls_ecdh_import_public_raw( mbedtls_ecdh_context *ctx, |
| 42 | const unsigned char *buf, |
| 43 | const unsigned char *end ); |
| 44 | |
| 45 | #endif /* MBEDTLS_ECP_INTERNAL_H */ |