blob: 835b0cc511fe09a4d9050e13b21a0cbf3aad9108 [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
30unsigned char ecp_alt_grp_capable( const mbedtls_ecp_group *grp );
31
32#if defined(MBEDTLS_ECP_ALT_INIT)
33int ecp_alt_init( const mbedtls_ecp_group *grp );
34#endif
35
36#if defined(MBEDTLS_ECP_ALT_DEINIT)
37void ecp_alt_deinit( const mbedtls_ecp_group *grp );
Janos Follathb0697532016-08-18 12:38:46 +010038
39#if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT)
40int 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)
46int 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)
51int 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)
56int 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)
61int ecp_normalize_jac_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *pt );
62#endif
63
64#if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT)
65int 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)
72int 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)
78int ecp_normalize_mxz_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *P );
79#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