Janos Follath | 4ced7c2 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 1 | /** |
Janos Follath | 58cf392 | 2016-11-01 13:22:05 +0000 | [diff] [blame] | 2 | * \file ecp_internal.h |
Janos Follath | 4ced7c2 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 3 | * |
Janos Follath | 61ea6ec | 2016-10-28 16:53:11 +0100 | [diff] [blame] | 4 | * \brief Function declarations for alternative implementation of elliptic curve |
| 5 | * point arithmetic. |
Janos Follath | 4ced7c2 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 6 | * |
Janos Follath | 61ea6ec | 2016-10-28 16:53:11 +0100 | [diff] [blame] | 7 | * Copyright (C) 2016, ARM Limited, All Rights Reserved |
Janos Follath | 4ced7c2 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 8 | * 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 Follath | 4ced7c2 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 27 | #if defined(MBEDTLS_ECP_FUNCTION_ALT) |
| 28 | |
Janos Follath | 466d207 | 2016-11-15 13:45:01 +0000 | [diff] [blame^] | 29 | unsigned char mbedtls_int_ecp_grp_capable( const mbedtls_ecp_group *grp ); |
Janos Follath | 4ced7c2 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 30 | |
Janos Follath | 466d207 | 2016-11-15 13:45:01 +0000 | [diff] [blame^] | 31 | int mbedtls_int_ecp_init( const mbedtls_ecp_group *grp ); |
Janos Follath | 4ced7c2 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 32 | |
Janos Follath | 466d207 | 2016-11-15 13:45:01 +0000 | [diff] [blame^] | 33 | void mbedtls_int_ecp_deinit( const mbedtls_ecp_group *grp ); |
Janos Follath | 4ced7c2 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 34 | |
| 35 | #if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) |
Janos Follath | 466d207 | 2016-11-15 13:45:01 +0000 | [diff] [blame^] | 36 | int 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 Follath | 4ced7c2 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 39 | #endif |
| 40 | |
| 41 | #if defined(MBEDTLS_ECP_ADD_MIXED_ALT) |
Janos Follath | 466d207 | 2016-11-15 13:45:01 +0000 | [diff] [blame^] | 42 | int 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 Follath | 4ced7c2 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 45 | #endif |
| 46 | |
| 47 | #if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) |
Janos Follath | 466d207 | 2016-11-15 13:45:01 +0000 | [diff] [blame^] | 48 | int mbedtls_int_ecp_double_jac( const mbedtls_ecp_group *grp, |
| 49 | mbedtls_ecp_point *R, const mbedtls_ecp_point *P ); |
Janos Follath | 4ced7c2 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 50 | #endif |
| 51 | |
| 52 | #if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT) |
Janos Follath | 466d207 | 2016-11-15 13:45:01 +0000 | [diff] [blame^] | 53 | int mbedtls_int_ecp_normalize_jac_many( const mbedtls_ecp_group *grp, |
| 54 | mbedtls_ecp_point *T[], size_t t_len ); |
Janos Follath | 4ced7c2 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 55 | #endif |
| 56 | |
| 57 | #if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT) |
Janos Follath | 466d207 | 2016-11-15 13:45:01 +0000 | [diff] [blame^] | 58 | int mbedtls_int_ecp_normalize_jac( const mbedtls_ecp_group *grp, |
| 59 | mbedtls_ecp_point *pt ); |
Janos Follath | 4ced7c2 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 60 | #endif |
| 61 | |
| 62 | #if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT) |
Janos Follath | 466d207 | 2016-11-15 13:45:01 +0000 | [diff] [blame^] | 63 | int 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 Follath | 4ced7c2 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 66 | #endif |
| 67 | |
| 68 | #if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT) |
Janos Follath | 466d207 | 2016-11-15 13:45:01 +0000 | [diff] [blame^] | 69 | int 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 Follath | 4ced7c2 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 72 | #endif |
| 73 | |
| 74 | #if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT) |
Janos Follath | 466d207 | 2016-11-15 13:45:01 +0000 | [diff] [blame^] | 75 | int mbedtls_int_ecp_normalize_mxz( const mbedtls_ecp_group *grp, |
| 76 | mbedtls_ecp_point *P ); |
Janos Follath | 4ced7c2 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 77 | #endif |
| 78 | |
Janos Follath | 61ea6ec | 2016-10-28 16:53:11 +0100 | [diff] [blame] | 79 | #endif /* MBEDTLS_ECP_FUNCTION_ALT */ |
Janos Follath | 4ced7c2 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 80 | |
| 81 | #endif /* ecp_function_alt.h */ |
| 82 | |