blob: 46e595a65a51266dc6ed13c8b4466663bb8fb7ea [file] [log] [blame]
Janos Follathb0697532016-08-18 12:38:46 +01001/**
Janos Follath47d28f02016-11-01 13:22:05 +00002 * \file ecp_internal.h
Janos Follathb0697532016-08-18 12:38:46 +01003 *
Janos Follath372697b2016-10-28 16:53:11 +01004 * \brief Function declarations for alternative implementation of elliptic curve
5 * point arithmetic.
Janos Follathb0697532016-08-18 12:38:46 +01006 *
Janos Follath372697b2016-10-28 16:53:11 +01007 * Copyright (C) 2016, ARM Limited, All Rights Reserved
Janos Follathb0697532016-08-18 12:38:46 +01008 * SPDX-License-Identifier: Apache-2.0
9 *
10 * Licensed under the Apache License, Version 2.0 (the "License"); you may
11 * not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
13 *
14 * http://www.apache.org/licenses/LICENSE-2.0
15 *
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
21 *
22 * This file is part of mbed TLS (https://tls.mbed.org)
23 */
24#ifndef MBEDTLS_ECP_FUNCTION_ALT_H
25#define MBEDTLS_ECP_FUNCTION_ALT_H
26
Janos Follathb0697532016-08-18 12:38:46 +010027#if defined(MBEDTLS_ECP_FUNCTION_ALT)
28
Janos Follath16e63ea2016-11-01 14:34:51 +000029unsigned char mbedtls_ecp_alt_grp_capable( const mbedtls_ecp_group *grp );
Janos Follathb0697532016-08-18 12:38:46 +010030
Janos Follath4d9c69d2016-11-01 13:27:03 +000031#if defined(MBEDTLS_ECP_INIT_ALT)
Janos Follath16e63ea2016-11-01 14:34:51 +000032int mbedtls_ecp_alt_init( const mbedtls_ecp_group *grp );
Janos Follathb0697532016-08-18 12:38:46 +010033#endif
34
Janos Follath4d9c69d2016-11-01 13:27:03 +000035#if defined(MBEDTLS_ECP_DEINIT_ALT)
Janos Follath16e63ea2016-11-01 14:34:51 +000036void mbedtls_ecp_alt_deinit( const mbedtls_ecp_group *grp );
Janos Follath4d9c69d2016-11-01 13:27:03 +000037#endif
Janos Follathb0697532016-08-18 12:38:46 +010038
39#if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT)
Janos Follath16e63ea2016-11-01 14:34:51 +000040int mbedtls_ecp_randomize_jac_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *pt,
Janos Follath372697b2016-10-28 16:53:11 +010041 int (*f_rng)(void *, unsigned char *, size_t),
42 void *p_rng );
Janos Follathb0697532016-08-18 12:38:46 +010043#endif
44
45#if defined(MBEDTLS_ECP_ADD_MIXED_ALT)
Janos Follath16e63ea2016-11-01 14:34:51 +000046int mbedtls_ecp_add_mixed_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
Janos Follath372697b2016-10-28 16:53:11 +010047 const mbedtls_ecp_point *P, const mbedtls_ecp_point *Q );
Janos Follathb0697532016-08-18 12:38:46 +010048#endif
49
50#if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT)
Janos Follath16e63ea2016-11-01 14:34:51 +000051int mbedtls_ecp_double_jac_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
Janos Follath372697b2016-10-28 16:53:11 +010052 const mbedtls_ecp_point *P );
Janos Follathb0697532016-08-18 12:38:46 +010053#endif
54
55#if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT)
Janos Follath16e63ea2016-11-01 14:34:51 +000056int mbedtls_ecp_normalize_jac_many_alt( const mbedtls_ecp_group *grp,
Janos Follath372697b2016-10-28 16:53:11 +010057 mbedtls_ecp_point *T[], size_t t_len );
Janos Follathb0697532016-08-18 12:38:46 +010058#endif
59
60#if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT)
Janos Follath16e63ea2016-11-01 14:34:51 +000061int mbedtls_ecp_normalize_jac_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *pt );
Janos Follathb0697532016-08-18 12:38:46 +010062#endif
63
64#if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT)
Janos Follath16e63ea2016-11-01 14:34:51 +000065int mbedtls_ecp_double_add_mxz_alt( const mbedtls_ecp_group *grp,
Janos Follath372697b2016-10-28 16:53:11 +010066 mbedtls_ecp_point *R, mbedtls_ecp_point *S,
67 const mbedtls_ecp_point *P,
68 const mbedtls_ecp_point *Q, const mbedtls_mpi *d );
Janos Follathb0697532016-08-18 12:38:46 +010069#endif
70
71#if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT)
Janos Follath16e63ea2016-11-01 14:34:51 +000072int mbedtls_ecp_randomize_mxz_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *P,
Janos Follath372697b2016-10-28 16:53:11 +010073 int (*f_rng)(void *, unsigned char *, size_t),
74 void *p_rng );
Janos Follathb0697532016-08-18 12:38:46 +010075#endif
76
77#if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT)
Janos Follath16e63ea2016-11-01 14:34:51 +000078int mbedtls_ecp_normalize_mxz_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *P );
Janos Follathb0697532016-08-18 12:38:46 +010079#endif
80
Janos Follath372697b2016-10-28 16:53:11 +010081#endif /* MBEDTLS_ECP_FUNCTION_ALT */
Janos Follathb0697532016-08-18 12:38:46 +010082
83#endif /* ecp_function_alt.h */
84