blob: eda07badd695822ce48f93a8228e6da18994936c [file] [log] [blame]
Janos Follath4ced7c22016-08-18 12:38:46 +01001/**
Janos Follath58cf3922016-11-01 13:22:05 +00002 * \file ecp_internal.h
Janos Follath4ced7c22016-08-18 12:38:46 +01003 *
Janos Follath61ea6ec2016-10-28 16:53:11 +01004 * \brief Function declarations for alternative implementation of elliptic curve
5 * point arithmetic.
Janos Follath4ced7c22016-08-18 12:38:46 +01006 *
Janos Follath61ea6ec2016-10-28 16:53:11 +01007 * Copyright (C) 2016, ARM Limited, All Rights Reserved
Janos Follath4ced7c22016-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 Follath4ced7c22016-08-18 12:38:46 +010027#if defined(MBEDTLS_ECP_FUNCTION_ALT)
28
Janos Follath466d2072016-11-15 13:45:01 +000029unsigned char mbedtls_int_ecp_grp_capable( const mbedtls_ecp_group *grp );
Janos Follath4ced7c22016-08-18 12:38:46 +010030
Janos Follath466d2072016-11-15 13:45:01 +000031int mbedtls_int_ecp_init( const mbedtls_ecp_group *grp );
Janos Follath4ced7c22016-08-18 12:38:46 +010032
Janos Follath466d2072016-11-15 13:45:01 +000033void mbedtls_int_ecp_deinit( const mbedtls_ecp_group *grp );
Janos Follath4ced7c22016-08-18 12:38:46 +010034
35#if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT)
Janos Follath466d2072016-11-15 13:45:01 +000036int mbedtls_int_ecp_randomize_jac( const mbedtls_ecp_group *grp,
37 mbedtls_ecp_point *pt, int (*f_rng)(void *, unsigned char *, size_t),
38 void *p_rng );
Janos Follath4ced7c22016-08-18 12:38:46 +010039#endif
40
41#if defined(MBEDTLS_ECP_ADD_MIXED_ALT)
Janos Follath466d2072016-11-15 13:45:01 +000042int mbedtls_int_ecp_add_mixed( const mbedtls_ecp_group *grp,
43 mbedtls_ecp_point *R, const mbedtls_ecp_point *P,
44 const mbedtls_ecp_point *Q );
Janos Follath4ced7c22016-08-18 12:38:46 +010045#endif
46
47#if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT)
Janos Follath466d2072016-11-15 13:45:01 +000048int mbedtls_int_ecp_double_jac( const mbedtls_ecp_group *grp,
49 mbedtls_ecp_point *R, const mbedtls_ecp_point *P );
Janos Follath4ced7c22016-08-18 12:38:46 +010050#endif
51
52#if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT)
Janos Follath466d2072016-11-15 13:45:01 +000053int mbedtls_int_ecp_normalize_jac_many( const mbedtls_ecp_group *grp,
54 mbedtls_ecp_point *T[], size_t t_len );
Janos Follath4ced7c22016-08-18 12:38:46 +010055#endif
56
57#if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT)
Janos Follath466d2072016-11-15 13:45:01 +000058int mbedtls_int_ecp_normalize_jac( const mbedtls_ecp_group *grp,
59 mbedtls_ecp_point *pt );
Janos Follath4ced7c22016-08-18 12:38:46 +010060#endif
61
62#if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT)
Janos Follath466d2072016-11-15 13:45:01 +000063int mbedtls_int_ecp_double_add_mxz( const mbedtls_ecp_group *grp,
64 mbedtls_ecp_point *R, mbedtls_ecp_point *S, const mbedtls_ecp_point *P,
65 const mbedtls_ecp_point *Q, const mbedtls_mpi *d );
Janos Follath4ced7c22016-08-18 12:38:46 +010066#endif
67
68#if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT)
Janos Follath466d2072016-11-15 13:45:01 +000069int mbedtls_int_ecp_randomize_mxz( const mbedtls_ecp_group *grp,
70 mbedtls_ecp_point *P, int (*f_rng)(void *, unsigned char *, size_t),
71 void *p_rng );
Janos Follath4ced7c22016-08-18 12:38:46 +010072#endif
73
74#if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT)
Janos Follath466d2072016-11-15 13:45:01 +000075int mbedtls_int_ecp_normalize_mxz( const mbedtls_ecp_group *grp,
76 mbedtls_ecp_point *P );
Janos Follath4ced7c22016-08-18 12:38:46 +010077#endif
78
Janos Follath61ea6ec2016-10-28 16:53:11 +010079#endif /* MBEDTLS_ECP_FUNCTION_ALT */
Janos Follath4ced7c22016-08-18 12:38:46 +010080
81#endif /* ecp_function_alt.h */
82