Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 1 | /** |
Janos Follath | 47d28f0 | 2016-11-01 13:22:05 +0000 | [diff] [blame] | 2 | * \file ecp_internal.h |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 3 | * |
Janos Follath | 372697b | 2016-10-28 16:53:11 +0100 | [diff] [blame] | 4 | * \brief Function declarations for alternative implementation of elliptic curve |
| 5 | * point arithmetic. |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 6 | * |
Janos Follath | 372697b | 2016-10-28 16:53:11 +0100 | [diff] [blame] | 7 | * Copyright (C) 2016, ARM Limited, All Rights Reserved |
Janos Follath | b069753 | 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 | |
| 27 | |
| 28 | #if defined(MBEDTLS_ECP_FUNCTION_ALT) |
| 29 | |
Janos Follath | 16e63ea | 2016-11-01 14:34:51 +0000 | [diff] [blame^] | 30 | unsigned char mbedtls_ecp_alt_grp_capable( const mbedtls_ecp_group *grp ); |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 31 | |
Janos Follath | 4d9c69d | 2016-11-01 13:27:03 +0000 | [diff] [blame] | 32 | #if defined(MBEDTLS_ECP_INIT_ALT) |
Janos Follath | 16e63ea | 2016-11-01 14:34:51 +0000 | [diff] [blame^] | 33 | int mbedtls_ecp_alt_init( const mbedtls_ecp_group *grp ); |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 34 | #endif |
| 35 | |
Janos Follath | 4d9c69d | 2016-11-01 13:27:03 +0000 | [diff] [blame] | 36 | #if defined(MBEDTLS_ECP_DEINIT_ALT) |
Janos Follath | 16e63ea | 2016-11-01 14:34:51 +0000 | [diff] [blame^] | 37 | void mbedtls_ecp_alt_deinit( const mbedtls_ecp_group *grp ); |
Janos Follath | 4d9c69d | 2016-11-01 13:27:03 +0000 | [diff] [blame] | 38 | #endif |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 39 | |
| 40 | #if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) |
Janos Follath | 16e63ea | 2016-11-01 14:34:51 +0000 | [diff] [blame^] | 41 | int mbedtls_ecp_randomize_jac_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *pt, |
Janos Follath | 372697b | 2016-10-28 16:53:11 +0100 | [diff] [blame] | 42 | int (*f_rng)(void *, unsigned char *, size_t), |
| 43 | void *p_rng ); |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 44 | #endif |
| 45 | |
| 46 | #if defined(MBEDTLS_ECP_ADD_MIXED_ALT) |
Janos Follath | 16e63ea | 2016-11-01 14:34:51 +0000 | [diff] [blame^] | 47 | int mbedtls_ecp_add_mixed_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *R, |
Janos Follath | 372697b | 2016-10-28 16:53:11 +0100 | [diff] [blame] | 48 | const mbedtls_ecp_point *P, const mbedtls_ecp_point *Q ); |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 49 | #endif |
| 50 | |
| 51 | #if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) |
Janos Follath | 16e63ea | 2016-11-01 14:34:51 +0000 | [diff] [blame^] | 52 | int mbedtls_ecp_double_jac_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *R, |
Janos Follath | 372697b | 2016-10-28 16:53:11 +0100 | [diff] [blame] | 53 | const mbedtls_ecp_point *P ); |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 54 | #endif |
| 55 | |
| 56 | #if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT) |
Janos Follath | 16e63ea | 2016-11-01 14:34:51 +0000 | [diff] [blame^] | 57 | int mbedtls_ecp_normalize_jac_many_alt( const mbedtls_ecp_group *grp, |
Janos Follath | 372697b | 2016-10-28 16:53:11 +0100 | [diff] [blame] | 58 | mbedtls_ecp_point *T[], size_t t_len ); |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 59 | #endif |
| 60 | |
| 61 | #if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT) |
Janos Follath | 16e63ea | 2016-11-01 14:34:51 +0000 | [diff] [blame^] | 62 | int mbedtls_ecp_normalize_jac_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *pt ); |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 63 | #endif |
| 64 | |
| 65 | #if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT) |
Janos Follath | 16e63ea | 2016-11-01 14:34:51 +0000 | [diff] [blame^] | 66 | int mbedtls_ecp_double_add_mxz_alt( const mbedtls_ecp_group *grp, |
Janos Follath | 372697b | 2016-10-28 16:53:11 +0100 | [diff] [blame] | 67 | 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 Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 70 | #endif |
| 71 | |
| 72 | #if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT) |
Janos Follath | 16e63ea | 2016-11-01 14:34:51 +0000 | [diff] [blame^] | 73 | int mbedtls_ecp_randomize_mxz_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *P, |
Janos Follath | 372697b | 2016-10-28 16:53:11 +0100 | [diff] [blame] | 74 | int (*f_rng)(void *, unsigned char *, size_t), |
| 75 | void *p_rng ); |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 76 | #endif |
| 77 | |
| 78 | #if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT) |
Janos Follath | 16e63ea | 2016-11-01 14:34:51 +0000 | [diff] [blame^] | 79 | int mbedtls_ecp_normalize_mxz_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *P ); |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 80 | #endif |
| 81 | |
Janos Follath | 372697b | 2016-10-28 16:53:11 +0100 | [diff] [blame] | 82 | #endif /* MBEDTLS_ECP_FUNCTION_ALT */ |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 83 | |
| 84 | #endif /* ecp_function_alt.h */ |
| 85 | |