blob: a91e9d80dcd134ddfefa4b98c090344ed92537f5 [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
27
28#if defined(MBEDTLS_ECP_FUNCTION_ALT)
29
Janos Follath16e63ea2016-11-01 14:34:51 +000030unsigned char mbedtls_ecp_alt_grp_capable( const mbedtls_ecp_group *grp );
Janos Follathb0697532016-08-18 12:38:46 +010031
Janos Follath4d9c69d2016-11-01 13:27:03 +000032#if defined(MBEDTLS_ECP_INIT_ALT)
Janos Follath16e63ea2016-11-01 14:34:51 +000033int mbedtls_ecp_alt_init( const mbedtls_ecp_group *grp );
Janos Follathb0697532016-08-18 12:38:46 +010034#endif
35
Janos Follath4d9c69d2016-11-01 13:27:03 +000036#if defined(MBEDTLS_ECP_DEINIT_ALT)
Janos Follath16e63ea2016-11-01 14:34:51 +000037void mbedtls_ecp_alt_deinit( const mbedtls_ecp_group *grp );
Janos Follath4d9c69d2016-11-01 13:27:03 +000038#endif
Janos Follathb0697532016-08-18 12:38:46 +010039
40#if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT)
Janos Follath16e63ea2016-11-01 14:34:51 +000041int mbedtls_ecp_randomize_jac_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *pt,
Janos Follath372697b2016-10-28 16:53:11 +010042 int (*f_rng)(void *, unsigned char *, size_t),
43 void *p_rng );
Janos Follathb0697532016-08-18 12:38:46 +010044#endif
45
46#if defined(MBEDTLS_ECP_ADD_MIXED_ALT)
Janos Follath16e63ea2016-11-01 14:34:51 +000047int mbedtls_ecp_add_mixed_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
Janos Follath372697b2016-10-28 16:53:11 +010048 const mbedtls_ecp_point *P, const mbedtls_ecp_point *Q );
Janos Follathb0697532016-08-18 12:38:46 +010049#endif
50
51#if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT)
Janos Follath16e63ea2016-11-01 14:34:51 +000052int mbedtls_ecp_double_jac_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
Janos Follath372697b2016-10-28 16:53:11 +010053 const mbedtls_ecp_point *P );
Janos Follathb0697532016-08-18 12:38:46 +010054#endif
55
56#if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT)
Janos Follath16e63ea2016-11-01 14:34:51 +000057int mbedtls_ecp_normalize_jac_many_alt( const mbedtls_ecp_group *grp,
Janos Follath372697b2016-10-28 16:53:11 +010058 mbedtls_ecp_point *T[], size_t t_len );
Janos Follathb0697532016-08-18 12:38:46 +010059#endif
60
61#if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT)
Janos Follath16e63ea2016-11-01 14:34:51 +000062int mbedtls_ecp_normalize_jac_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *pt );
Janos Follathb0697532016-08-18 12:38:46 +010063#endif
64
65#if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT)
Janos Follath16e63ea2016-11-01 14:34:51 +000066int mbedtls_ecp_double_add_mxz_alt( const mbedtls_ecp_group *grp,
Janos Follath372697b2016-10-28 16:53:11 +010067 mbedtls_ecp_point *R, mbedtls_ecp_point *S,
68 const mbedtls_ecp_point *P,
69 const mbedtls_ecp_point *Q, const mbedtls_mpi *d );
Janos Follathb0697532016-08-18 12:38:46 +010070#endif
71
72#if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT)
Janos Follath16e63ea2016-11-01 14:34:51 +000073int mbedtls_ecp_randomize_mxz_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *P,
Janos Follath372697b2016-10-28 16:53:11 +010074 int (*f_rng)(void *, unsigned char *, size_t),
75 void *p_rng );
Janos Follathb0697532016-08-18 12:38:46 +010076#endif
77
78#if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT)
Janos Follath16e63ea2016-11-01 14:34:51 +000079int mbedtls_ecp_normalize_mxz_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *P );
Janos Follathb0697532016-08-18 12:38:46 +010080#endif
81
Janos Follath372697b2016-10-28 16:53:11 +010082#endif /* MBEDTLS_ECP_FUNCTION_ALT */
Janos Follathb0697532016-08-18 12:38:46 +010083
84#endif /* ecp_function_alt.h */
85