blob: a9f5bc5e207a9894414befbdd54abf3a5558f9d9 [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 */
Janos Follathc44ab972016-11-18 16:38:23 +000024#ifndef MBEDTLS_ECP_INTERNAL_H
25#define MBEDTLS_ECP_INTERNAL_H
Janos Follathb0697532016-08-18 12:38:46 +010026
Janos Follathc44ab972016-11-18 16:38:23 +000027#if defined(MBEDTLS_ECP_INTERNAL_ALT)
Janos Follathb0697532016-08-18 12:38:46 +010028
Janos Follathc44ab972016-11-18 16:38:23 +000029unsigned char mbedtls_internal_ecp_grp_capable( const mbedtls_ecp_group *grp );
Janos Follathb0697532016-08-18 12:38:46 +010030
Janos Follathc44ab972016-11-18 16:38:23 +000031int mbedtls_internal_ecp_init( const mbedtls_ecp_group *grp );
Janos Follathb0697532016-08-18 12:38:46 +010032
Janos Follathc44ab972016-11-18 16:38:23 +000033void mbedtls_internal_ecp_free( const mbedtls_ecp_group *grp );
Janos Follathb0697532016-08-18 12:38:46 +010034
35#if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT)
Janos Follathc44ab972016-11-18 16:38:23 +000036int mbedtls_internal_ecp_randomize_jac( const mbedtls_ecp_group *grp,
Janos Follathb8a90fb2016-11-15 13:45:01 +000037 mbedtls_ecp_point *pt, int (*f_rng)(void *, unsigned char *, size_t),
38 void *p_rng );
Janos Follathb0697532016-08-18 12:38:46 +010039#endif
40
41#if defined(MBEDTLS_ECP_ADD_MIXED_ALT)
Janos Follathc44ab972016-11-18 16:38:23 +000042int mbedtls_internal_ecp_add_mixed( const mbedtls_ecp_group *grp,
Janos Follathb8a90fb2016-11-15 13:45:01 +000043 mbedtls_ecp_point *R, const mbedtls_ecp_point *P,
44 const mbedtls_ecp_point *Q );
Janos Follathb0697532016-08-18 12:38:46 +010045#endif
46
47#if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT)
Janos Follathc44ab972016-11-18 16:38:23 +000048int mbedtls_internal_ecp_double_jac( const mbedtls_ecp_group *grp,
Janos Follathb8a90fb2016-11-15 13:45:01 +000049 mbedtls_ecp_point *R, const mbedtls_ecp_point *P );
Janos Follathb0697532016-08-18 12:38:46 +010050#endif
51
52#if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT)
Janos Follathc44ab972016-11-18 16:38:23 +000053int mbedtls_internal_ecp_normalize_jac_many( const mbedtls_ecp_group *grp,
Janos Follathb8a90fb2016-11-15 13:45:01 +000054 mbedtls_ecp_point *T[], size_t t_len );
Janos Follathb0697532016-08-18 12:38:46 +010055#endif
56
57#if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT)
Janos Follathc44ab972016-11-18 16:38:23 +000058int mbedtls_internal_ecp_normalize_jac( const mbedtls_ecp_group *grp,
Janos Follathb8a90fb2016-11-15 13:45:01 +000059 mbedtls_ecp_point *pt );
Janos Follathb0697532016-08-18 12:38:46 +010060#endif
61
62#if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT)
Janos Follathc44ab972016-11-18 16:38:23 +000063int mbedtls_internal_ecp_double_add_mxz( const mbedtls_ecp_group *grp,
Janos Follathb8a90fb2016-11-15 13:45:01 +000064 mbedtls_ecp_point *R, mbedtls_ecp_point *S, const mbedtls_ecp_point *P,
65 const mbedtls_ecp_point *Q, const mbedtls_mpi *d );
Janos Follathb0697532016-08-18 12:38:46 +010066#endif
67
68#if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT)
Janos Follathc44ab972016-11-18 16:38:23 +000069int mbedtls_internal_ecp_randomize_mxz( const mbedtls_ecp_group *grp,
Janos Follathb8a90fb2016-11-15 13:45:01 +000070 mbedtls_ecp_point *P, int (*f_rng)(void *, unsigned char *, size_t),
71 void *p_rng );
Janos Follathb0697532016-08-18 12:38:46 +010072#endif
73
74#if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT)
Janos Follathc44ab972016-11-18 16:38:23 +000075int mbedtls_internal_ecp_normalize_mxz( const mbedtls_ecp_group *grp,
Janos Follathb8a90fb2016-11-15 13:45:01 +000076 mbedtls_ecp_point *P );
Janos Follathb0697532016-08-18 12:38:46 +010077#endif
78
Janos Follathc44ab972016-11-18 16:38:23 +000079#endif /* MBEDTLS_ECP_INTERNAL_ALT */
Janos Follathb0697532016-08-18 12:38:46 +010080
Janos Follathc44ab972016-11-18 16:38:23 +000081#endif /* ecp_internal.h */
Janos Follathb0697532016-08-18 12:38:46 +010082