2021-09-14 13:30:36 +02:00
|
|
|
/**
|
|
|
|
* \file ecdh_misc.h
|
|
|
|
*
|
|
|
|
* \brief Internal functions shared by the ECDH module
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* Copyright The Mbed TLS Contributors
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 ( the "License" ); you may
|
|
|
|
* not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
#if !defined(MBEDTLS_ECDH_MISC_H)
|
|
|
|
#define MBEDTLS_ECDH_MISC_H
|
|
|
|
|
2021-09-15 05:10:15 +02:00
|
|
|
#include "mbedtls/ecdh.h"
|
|
|
|
#include "mbedtls/ecp.h"
|
|
|
|
|
2021-09-14 13:30:36 +02:00
|
|
|
#if defined(MBEDTLS_ECDH_C)
|
|
|
|
|
2021-12-08 16:57:54 +01:00
|
|
|
#if defined(MBEDTLS_SSL_PROTO_TLS1_3)
|
2021-09-14 13:30:36 +02:00
|
|
|
|
2021-09-15 05:10:15 +02:00
|
|
|
/*
|
2021-09-15 12:41:02 +02:00
|
|
|
* Setup context without Everest
|
2021-09-15 05:10:15 +02:00
|
|
|
*/
|
|
|
|
int mbedtls_ecdh_setup_no_everest( mbedtls_ecdh_context *ctx,
|
|
|
|
mbedtls_ecp_group_id grp_id );
|
|
|
|
|
2021-09-14 13:30:36 +02:00
|
|
|
/*
|
2021-10-13 07:36:05 +02:00
|
|
|
* TLS 1.3 version of mbedtls_ecdh_make_params
|
2021-09-14 13:30:36 +02:00
|
|
|
*/
|
|
|
|
int mbedtls_ecdh_tls13_make_params( mbedtls_ecdh_context *ctx, size_t *olen,
|
2021-10-13 07:36:05 +02:00
|
|
|
unsigned char *buf, size_t buf_len,
|
2021-09-14 13:30:36 +02:00
|
|
|
int ( *f_rng )( void *, unsigned char *, size_t ),
|
|
|
|
void *p_rng );
|
|
|
|
|
2021-09-09 09:42:32 +02:00
|
|
|
/*
|
2021-10-13 07:36:05 +02:00
|
|
|
* TLS 1.3 version of mbedtls_ecdh_read_public
|
2021-09-09 09:42:32 +02:00
|
|
|
*/
|
2021-10-11 16:30:19 +02:00
|
|
|
int mbedtls_ecdh_tls13_read_public( mbedtls_ecdh_context *ctx,
|
|
|
|
const unsigned char *buf,
|
2021-10-13 07:36:05 +02:00
|
|
|
size_t buf_len );
|
2021-09-15 05:10:15 +02:00
|
|
|
|
2021-12-08 16:57:54 +01:00
|
|
|
#endif /* MBEDTLS_SSL_PROTO_TLS1_3 */
|
2021-09-14 13:30:36 +02:00
|
|
|
|
|
|
|
#endif /* MBEDTLS_ECDH_C */
|
|
|
|
|
|
|
|
#endif /* !MBEDTLS_ECDH_MISC_H */
|