blob: 68a6989c8259a2f59a90f970a9f155a51394b34f [file] [log] [blame]
Manuel Pégourié-Gonnard0bad5c22013-01-26 15:30:46 +01001/**
2 * \file ecdh.h
3 *
Rose Zadik68993282018-03-27 11:12:25 +01004 * \brief This file contains ECDH definitions and functions.
Manuel Pégourié-Gonnard0bad5c22013-01-26 15:30:46 +01005 *
Darryl Green11999bb2018-03-13 15:22:58 +00006 * The Elliptic Curve Diffie-Hellman (ECDH) protocol is an anonymous
Rose Zadik68993282018-03-27 11:12:25 +01007 * key agreement protocol allowing two parties to establish a shared
8 * secret over an insecure channel. Each party must have an
Rose Zadikde2d6222018-01-25 21:57:43 +00009 * elliptic-curve public–private key pair.
10 *
11 * For more information, see <em>NIST SP 800-56A Rev. 2: Recommendation for
12 * Pair-Wise Key Establishment Schemes Using Discrete Logarithm
13 * Cryptography</em>.
Darryl Greena40a1012018-01-05 15:33:17 +000014 */
15/*
Rose Zadikde2d6222018-01-25 21:57:43 +000016 * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved
Manuel Pégourié-Gonnard37ff1402015-09-04 14:21:07 +020017 * SPDX-License-Identifier: Apache-2.0
18 *
19 * Licensed under the Apache License, Version 2.0 (the "License"); you may
20 * not use this file except in compliance with the License.
21 * You may obtain a copy of the License at
22 *
23 * http://www.apache.org/licenses/LICENSE-2.0
24 *
25 * Unless required by applicable law or agreed to in writing, software
26 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
27 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 * See the License for the specific language governing permissions and
29 * limitations under the License.
Manuel Pégourié-Gonnard0bad5c22013-01-26 15:30:46 +010030 *
Rose Zadikde2d6222018-01-25 21:57:43 +000031 * This file is part of Mbed TLS (https://tls.mbed.org)
Manuel Pégourié-Gonnard0bad5c22013-01-26 15:30:46 +010032 */
Rose Zadikde2d6222018-01-25 21:57:43 +000033
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020034#ifndef MBEDTLS_ECDH_H
35#define MBEDTLS_ECDH_H
Manuel Pégourié-Gonnard0bad5c22013-01-26 15:30:46 +010036
Manuel Pégourié-Gonnardbdc96762013-10-03 11:50:39 +020037#include "ecp.h"
Manuel Pégourié-Gonnard0bad5c22013-01-26 15:30:46 +010038
Paul Bakker407a0da2013-06-27 14:29:21 +020039#ifdef __cplusplus
40extern "C" {
41#endif
42
Manuel Pégourié-Gonnard63533e42013-02-10 14:21:04 +010043/**
Rose Zadik68993282018-03-27 11:12:25 +010044 * Defines the source of the imported EC key.
Manuel Pégourié-Gonnardcdff3cf2013-12-12 09:55:52 +010045 */
46typedef enum
47{
Rose Zadik7375b0f2018-04-16 16:04:57 +010048 MBEDTLS_ECDH_OURS, /**< Our key. */
Rose Zadik68993282018-03-27 11:12:25 +010049 MBEDTLS_ECDH_THEIRS, /**< The key of the peer. */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020050} mbedtls_ecdh_side;
Manuel Pégourié-Gonnardcdff3cf2013-12-12 09:55:52 +010051
52/**
Manuel Pégourié-Gonnardeaf55be2017-08-23 14:40:21 +020053 *
54 * \warning Performing multiple operations concurrently on the same
55 * ECDSA context is not supported; objects of this type
56 * should not be shared between multiple threads.
Rose Zadikde2d6222018-01-25 21:57:43 +000057 * \brief The ECDH context structure.
Manuel Pégourié-Gonnard63533e42013-02-10 14:21:04 +010058 */
Dawid Drozd428cc522018-07-24 10:02:47 +020059typedef struct mbedtls_ecdh_context
Manuel Pégourié-Gonnard63533e42013-02-10 14:21:04 +010060{
Rose Zadikde2d6222018-01-25 21:57:43 +000061 mbedtls_ecp_group grp; /*!< The elliptic curve used. */
62 mbedtls_mpi d; /*!< The private key. */
63 mbedtls_ecp_point Q; /*!< The public key. */
64 mbedtls_ecp_point Qp; /*!< The value of the public key of the peer. */
65 mbedtls_mpi z; /*!< The shared secret. */
66 int point_format; /*!< The format of point export in TLS messages. */
67 mbedtls_ecp_point Vi; /*!< The blinding value. */
68 mbedtls_ecp_point Vf; /*!< The unblinding value. */
69 mbedtls_mpi _d; /*!< The previous \p d. */
Manuel Pégourié-Gonnard66ba48a2017-04-27 11:38:26 +020070#if defined(MBEDTLS_ECP_RESTARTABLE)
Manuel Pégourié-Gonnardda19f4c2018-06-12 12:40:54 +020071 int restart_enabled; /*!< The flag for restartable mode. */
72 mbedtls_ecp_restart_ctx rs; /*!< The restart context for EC computations. */
Manuel Pégourié-Gonnard66ba48a2017-04-27 11:38:26 +020073#endif
Manuel Pégourié-Gonnard63533e42013-02-10 14:21:04 +010074}
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020075mbedtls_ecdh_context;
Manuel Pégourié-Gonnard63533e42013-02-10 14:21:04 +010076
Manuel Pégourié-Gonnard6545ca72013-01-26 16:05:22 +010077/**
Rose Zadikde2d6222018-01-25 21:57:43 +000078 * \brief This function generates an ECDH keypair on an elliptic
79 * curve.
Manuel Pégourié-Gonnard6545ca72013-01-26 16:05:22 +010080 *
Rose Zadikde2d6222018-01-25 21:57:43 +000081 * This function performs the first of two core computations
82 * implemented during the ECDH key exchange. The second core
83 * computation is performed by mbedtls_ecdh_compute_shared().
Manuel Pégourié-Gonnard6545ca72013-01-26 16:05:22 +010084 *
Rose Zadik68993282018-03-27 11:12:25 +010085 * \see ecp.h
86 *
Rose Zadikde2d6222018-01-25 21:57:43 +000087 * \param grp The ECP group.
88 * \param d The destination MPI (private key).
89 * \param Q The destination point (public key).
90 * \param f_rng The RNG function.
Rose Zadik68993282018-03-27 11:12:25 +010091 * \param p_rng The RNG context.
Rose Zadikde2d6222018-01-25 21:57:43 +000092 *
Rose Zadik68993282018-03-27 11:12:25 +010093 * \return \c 0 on success.
Manuel Pégourié-Gonnardf0bbd7e2018-10-15 13:22:41 +020094 * \return Another \c MBEDTLS_ERR_ECP_XXX or
95 * \c MBEDTLS_MPI_XXX error code on failure.
Manuel Pégourié-Gonnard6545ca72013-01-26 16:05:22 +010096 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020097int mbedtls_ecdh_gen_public( mbedtls_ecp_group *grp, mbedtls_mpi *d, mbedtls_ecp_point *Q,
Manuel Pégourié-Gonnard6545ca72013-01-26 16:05:22 +010098 int (*f_rng)(void *, unsigned char *, size_t),
99 void *p_rng );
100
101/**
Rose Zadikde2d6222018-01-25 21:57:43 +0000102 * \brief This function computes the shared secret.
Manuel Pégourié-Gonnard6545ca72013-01-26 16:05:22 +0100103 *
Rose Zadikde2d6222018-01-25 21:57:43 +0000104 * This function performs the second of two core computations
105 * implemented during the ECDH key exchange. The first core
106 * computation is performed by mbedtls_ecdh_gen_public().
Manuel Pégourié-Gonnard6545ca72013-01-26 16:05:22 +0100107 *
Rose Zadikde2d6222018-01-25 21:57:43 +0000108 * \see ecp.h
109 *
110 * \note If \p f_rng is not NULL, it is used to implement
Rose Zadik7375b0f2018-04-16 16:04:57 +0100111 * countermeasures against side-channel attacks.
112 * For more information, see mbedtls_ecp_mul().
Rose Zadik68993282018-03-27 11:12:25 +0100113 *
114 * \param grp The ECP group.
115 * \param z The destination MPI (shared secret).
116 * \param Q The public key from another party.
117 * \param d Our secret exponent (private key).
118 * \param f_rng The RNG function.
119 * \param p_rng The RNG context.
120 *
121 * \return \c 0 on success.
Manuel Pégourié-Gonnardf0bbd7e2018-10-15 13:22:41 +0200122 * \return Another \c MBEDTLS_ERR_ECP_XXX or
123 * \c MBEDTLS_MPI_XXX error code on failure.
Manuel Pégourié-Gonnard6545ca72013-01-26 16:05:22 +0100124 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200125int mbedtls_ecdh_compute_shared( mbedtls_ecp_group *grp, mbedtls_mpi *z,
126 const mbedtls_ecp_point *Q, const mbedtls_mpi *d,
Manuel Pégourié-Gonnarde09d2f82013-09-02 14:29:09 +0200127 int (*f_rng)(void *, unsigned char *, size_t),
128 void *p_rng );
Manuel Pégourié-Gonnard0bad5c22013-01-26 15:30:46 +0100129
130/**
Rose Zadikde2d6222018-01-25 21:57:43 +0000131 * \brief This function initializes an ECDH context.
Manuel Pégourié-Gonnard63533e42013-02-10 14:21:04 +0100132 *
Rose Zadikde2d6222018-01-25 21:57:43 +0000133 * \param ctx The ECDH context to initialize.
Manuel Pégourié-Gonnard63533e42013-02-10 14:21:04 +0100134 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200135void mbedtls_ecdh_init( mbedtls_ecdh_context *ctx );
Manuel Pégourié-Gonnard63533e42013-02-10 14:21:04 +0100136
137/**
Janos Follathf61e4862018-10-30 11:53:25 +0000138 * \brief This function sets up the ECDH context with the information
139 * given.
140 *
141 * This function should be called after mbedtls_ecdh_init() but
142 * before mbedtls_ecdh_make_params(). There is no need to call
143 * this function before mbedtls_ecdh_read_params().
144 *
145 * This is the first function used by a TLS server for ECDHE
146 * ciphersuites.
147 *
148 * \param ctx The ECDH context to set up.
149 * \param grp_id The group id of the group to set up the context for.
150 *
151 * \return \c 0 on success.
152 */
153int mbedtls_ecdh_setup( mbedtls_ecdh_context *ctx, mbedtls_ecp_group_id grp_id );
154
155/**
Rose Zadikde2d6222018-01-25 21:57:43 +0000156 * \brief This function frees a context.
Manuel Pégourié-Gonnard63533e42013-02-10 14:21:04 +0100157 *
Rose Zadikde2d6222018-01-25 21:57:43 +0000158 * \param ctx The context to free.
Manuel Pégourié-Gonnard63533e42013-02-10 14:21:04 +0100159 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200160void mbedtls_ecdh_free( mbedtls_ecdh_context *ctx );
Manuel Pégourié-Gonnard63533e42013-02-10 14:21:04 +0100161
162/**
Rose Zadikde2d6222018-01-25 21:57:43 +0000163 * \brief This function generates a public key and a TLS
164 * ServerKeyExchange payload.
Manuel Pégourié-Gonnard13724762013-02-10 15:01:54 +0100165 *
Janos Follathf61e4862018-10-30 11:53:25 +0000166 * This is the second function used by a TLS server for ECDHE
167 * ciphersuites. (It is called after mbedtls_ecdh_setup().)
Manuel Pégourié-Gonnard13724762013-02-10 15:01:54 +0100168 *
Rose Zadik68993282018-03-27 11:12:25 +0100169 * \note This function assumes that the ECP group (grp) of the
170 * \p ctx context has already been properly set,
171 * for example, using mbedtls_ecp_group_load().
Manuel Pégourié-Gonnard13724762013-02-10 15:01:54 +0100172 *
Rose Zadik68993282018-03-27 11:12:25 +0100173 * \see ecp.h
174 *
Rose Zadikde2d6222018-01-25 21:57:43 +0000175 * \param ctx The ECDH context.
176 * \param olen The number of characters written.
177 * \param buf The destination buffer.
178 * \param blen The length of the destination buffer.
179 * \param f_rng The RNG function.
Rose Zadik68993282018-03-27 11:12:25 +0100180 * \param p_rng The RNG context.
Manuel Pégourié-Gonnard13724762013-02-10 15:01:54 +0100181 *
Rose Zadik68993282018-03-27 11:12:25 +0100182 * \return \c 0 on success.
Manuel Pégourié-Gonnardda19f4c2018-06-12 12:40:54 +0200183 * \return #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of
Manuel Pégourié-Gonnardc90d3b02017-04-27 10:48:29 +0200184 * operations was reached: see \c mbedtls_ecp_set_max_ops().
Manuel Pégourié-Gonnardf0bbd7e2018-10-15 13:22:41 +0200185 * \return Another \c MBEDTLS_ERR_ECP_XXX error code on failure.
Manuel Pégourié-Gonnard13724762013-02-10 15:01:54 +0100186 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200187int mbedtls_ecdh_make_params( mbedtls_ecdh_context *ctx, size_t *olen,
Manuel Pégourié-Gonnard854fbd72013-02-11 20:28:55 +0100188 unsigned char *buf, size_t blen,
189 int (*f_rng)(void *, unsigned char *, size_t),
190 void *p_rng );
191
192/**
Rose Zadikde2d6222018-01-25 21:57:43 +0000193 * \brief This function parses and processes a TLS ServerKeyExhange
194 * payload.
Manuel Pégourié-Gonnard854fbd72013-02-11 20:28:55 +0100195 *
Rose Zadikde2d6222018-01-25 21:57:43 +0000196 * This is the first function used by a TLS client for ECDHE
197 * ciphersuites.
Manuel Pégourié-Gonnard854fbd72013-02-11 20:28:55 +0100198 *
Rose Zadik68993282018-03-27 11:12:25 +0100199 * \see ecp.h
200 *
Rose Zadikde2d6222018-01-25 21:57:43 +0000201 * \param ctx The ECDH context.
202 * \param buf The pointer to the start of the input buffer.
203 * \param end The address for one Byte past the end of the buffer.
204 *
Rose Zadik68993282018-03-27 11:12:25 +0100205 * \return \c 0 on success.
206 * \return An \c MBEDTLS_ERR_ECP_XXX error code on failure.
Rose Zadikde2d6222018-01-25 21:57:43 +0000207 *
Manuel Pégourié-Gonnard854fbd72013-02-11 20:28:55 +0100208 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200209int mbedtls_ecdh_read_params( mbedtls_ecdh_context *ctx,
Manuel Pégourié-Gonnard854fbd72013-02-11 20:28:55 +0100210 const unsigned char **buf, const unsigned char *end );
Manuel Pégourié-Gonnard13724762013-02-10 15:01:54 +0100211
212/**
Rose Zadikde2d6222018-01-25 21:57:43 +0000213 * \brief This function sets up an ECDH context from an EC key.
Manuel Pégourié-Gonnardcdff3cf2013-12-12 09:55:52 +0100214 *
Rose Zadikde2d6222018-01-25 21:57:43 +0000215 * It is used by clients and servers in place of the
216 * ServerKeyEchange for static ECDH, and imports ECDH
217 * parameters from the EC key information of a certificate.
Manuel Pégourié-Gonnardcdff3cf2013-12-12 09:55:52 +0100218 *
Rose Zadik68993282018-03-27 11:12:25 +0100219 * \see ecp.h
220 *
Rose Zadikde2d6222018-01-25 21:57:43 +0000221 * \param ctx The ECDH context to set up.
222 * \param key The EC key to use.
Rose Zadik68993282018-03-27 11:12:25 +0100223 * \param side Defines the source of the key: 1: Our key, or
224 * 0: The key of the peer.
Rose Zadikde2d6222018-01-25 21:57:43 +0000225 *
Rose Zadik68993282018-03-27 11:12:25 +0100226 * \return \c 0 on success.
Manuel Pégourié-Gonnardf0bbd7e2018-10-15 13:22:41 +0200227 * \return Another \c MBEDTLS_ERR_ECP_XXX error code on failure.
Rose Zadikde2d6222018-01-25 21:57:43 +0000228 *
Manuel Pégourié-Gonnardcdff3cf2013-12-12 09:55:52 +0100229 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200230int mbedtls_ecdh_get_params( mbedtls_ecdh_context *ctx, const mbedtls_ecp_keypair *key,
231 mbedtls_ecdh_side side );
Manuel Pégourié-Gonnardcdff3cf2013-12-12 09:55:52 +0100232
233/**
Rose Zadikde2d6222018-01-25 21:57:43 +0000234 * \brief This function generates a public key and a TLS
235 * ClientKeyExchange payload.
Manuel Pégourié-Gonnard5cceb412013-02-11 21:51:45 +0100236 *
Rose Zadikde2d6222018-01-25 21:57:43 +0000237 * This is the second function used by a TLS client for ECDH(E)
238 * ciphersuites.
Manuel Pégourié-Gonnard5cceb412013-02-11 21:51:45 +0100239 *
Rose Zadik68993282018-03-27 11:12:25 +0100240 * \see ecp.h
241 *
Rose Zadikde2d6222018-01-25 21:57:43 +0000242 * \param ctx The ECDH context.
243 * \param olen The number of Bytes written.
244 * \param buf The destination buffer.
245 * \param blen The size of the destination buffer.
246 * \param f_rng The RNG function.
Rose Zadik68993282018-03-27 11:12:25 +0100247 * \param p_rng The RNG context.
Rose Zadikde2d6222018-01-25 21:57:43 +0000248 *
Rose Zadik68993282018-03-27 11:12:25 +0100249 * \return \c 0 on success.
Manuel Pégourié-Gonnardda19f4c2018-06-12 12:40:54 +0200250 * \return #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of
Manuel Pégourié-Gonnardc90d3b02017-04-27 10:48:29 +0200251 * operations was reached: see \c mbedtls_ecp_set_max_ops().
Manuel Pégourié-Gonnardf0bbd7e2018-10-15 13:22:41 +0200252 * \return Another \c MBEDTLS_ERR_ECP_XXX error code on failure.
Manuel Pégourié-Gonnard5cceb412013-02-11 21:51:45 +0100253 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200254int mbedtls_ecdh_make_public( mbedtls_ecdh_context *ctx, size_t *olen,
Manuel Pégourié-Gonnard5cceb412013-02-11 21:51:45 +0100255 unsigned char *buf, size_t blen,
256 int (*f_rng)(void *, unsigned char *, size_t),
257 void *p_rng );
258
259/**
Rose Zadikde2d6222018-01-25 21:57:43 +0000260 * \brief This function parses and processes a TLS ClientKeyExchange
261 * payload.
Manuel Pégourié-Gonnard5cceb412013-02-11 21:51:45 +0100262 *
Janos Follathf61e4862018-10-30 11:53:25 +0000263 * This is the third function used by a TLS server for ECDH(E)
264 * ciphersuites. (It is called after mbedtls_ecdh_setup() and
265 * mbedtls_ecdh_make_params().)
Manuel Pégourié-Gonnard5cceb412013-02-11 21:51:45 +0100266 *
Rose Zadik68993282018-03-27 11:12:25 +0100267 * \see ecp.h
268 *
Rose Zadikde2d6222018-01-25 21:57:43 +0000269 * \param ctx The ECDH context.
270 * \param buf The start of the input buffer.
271 * \param blen The length of the input buffer.
272 *
Rose Zadik68993282018-03-27 11:12:25 +0100273 * \return \c 0 on success.
274 * \return An \c MBEDTLS_ERR_ECP_XXX error code on failure.
Manuel Pégourié-Gonnard5cceb412013-02-11 21:51:45 +0100275 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200276int mbedtls_ecdh_read_public( mbedtls_ecdh_context *ctx,
Manuel Pégourié-Gonnard5cceb412013-02-11 21:51:45 +0100277 const unsigned char *buf, size_t blen );
278
279/**
Rose Zadikde2d6222018-01-25 21:57:43 +0000280 * \brief This function derives and exports the shared secret.
Manuel Pégourié-Gonnard424fda52013-02-11 22:05:42 +0100281 *
Rose Zadikde2d6222018-01-25 21:57:43 +0000282 * This is the last function used by both TLS client
283 * and servers.
Manuel Pégourié-Gonnard424fda52013-02-11 22:05:42 +0100284 *
Rose Zadik68993282018-03-27 11:12:25 +0100285 * \note If \p f_rng is not NULL, it is used to implement
Rose Zadik7375b0f2018-04-16 16:04:57 +0100286 * countermeasures against side-channel attacks.
287 * For more information, see mbedtls_ecp_mul().
Rose Zadik68993282018-03-27 11:12:25 +0100288 *
289 * \see ecp.h
290 *
Rose Zadikde2d6222018-01-25 21:57:43 +0000291 * \param ctx The ECDH context.
292 * \param olen The number of Bytes written.
293 * \param buf The destination buffer.
294 * \param blen The length of the destination buffer.
295 * \param f_rng The RNG function.
Rose Zadik68993282018-03-27 11:12:25 +0100296 * \param p_rng The RNG context.
Rose Zadikde2d6222018-01-25 21:57:43 +0000297 *
Rose Zadik68993282018-03-27 11:12:25 +0100298 * \return \c 0 on success.
Manuel Pégourié-Gonnardda19f4c2018-06-12 12:40:54 +0200299 * \return #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of
Manuel Pégourié-Gonnardc90d3b02017-04-27 10:48:29 +0200300 * operations was reached: see \c mbedtls_ecp_set_max_ops().
Manuel Pégourié-Gonnardf0bbd7e2018-10-15 13:22:41 +0200301 * \return Another \c MBEDTLS_ERR_ECP_XXX error code on failure.
Manuel Pégourié-Gonnard424fda52013-02-11 22:05:42 +0100302 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200303int mbedtls_ecdh_calc_secret( mbedtls_ecdh_context *ctx, size_t *olen,
Manuel Pégourié-Gonnarde09d2f82013-09-02 14:29:09 +0200304 unsigned char *buf, size_t blen,
305 int (*f_rng)(void *, unsigned char *, size_t),
306 void *p_rng );
Manuel Pégourié-Gonnard424fda52013-02-11 22:05:42 +0100307
Manuel Pégourié-Gonnard23e41622017-05-18 12:35:37 +0200308#if defined(MBEDTLS_ECP_RESTARTABLE)
309/**
Manuel Pégourié-Gonnardda19f4c2018-06-12 12:40:54 +0200310 * \brief This function enables restartable EC computations for this
311 * context. (Default: disabled.)
Manuel Pégourié-Gonnard23e41622017-05-18 12:35:37 +0200312 *
Manuel Pégourié-Gonnardda19f4c2018-06-12 12:40:54 +0200313 * \see \c mbedtls_ecp_set_max_ops()
Manuel Pégourié-Gonnard23e41622017-05-18 12:35:37 +0200314 *
315 * \note It is not possible to safely disable restartable
316 * computations once enabled, except by free-ing the context,
317 * which cancels possible in-progress operations.
318 *
Manuel Pégourié-Gonnardda19f4c2018-06-12 12:40:54 +0200319 * \param ctx The ECDH context.
Manuel Pégourié-Gonnard23e41622017-05-18 12:35:37 +0200320 */
321void mbedtls_ecdh_enable_restart( mbedtls_ecdh_context *ctx );
322#endif /* MBEDTLS_ECP_RESTARTABLE */
323
Manuel Pégourié-Gonnard6545ca72013-01-26 16:05:22 +0100324#ifdef __cplusplus
325}
326#endif
327
Paul Bakker9af723c2014-05-01 13:03:14 +0200328#endif /* ecdh.h */