OPTIGA Trust M  1.1.0
C++ library for Optiga Trust M Chip Security Controller
ecp_internal.h
Go to the documentation of this file.
1 
7 /*
8  * Copyright (C) 2016, ARM Limited, All Rights Reserved
9  * SPDX-License-Identifier: Apache-2.0
10  *
11  * Licensed under the Apache License, Version 2.0 (the "License"); you may
12  * not use this file except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  * http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
19  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  *
23  * This file is part of mbed TLS (https://tls.mbed.org)
24  */
25 
26 /*
27  * References:
28  *
29  * [1] BERNSTEIN, Daniel J. Curve25519: new Diffie-Hellman speed records.
30  * <http://cr.yp.to/ecdh/curve25519-20060209.pdf>
31  *
32  * [2] CORON, Jean-S'ebastien. Resistance against differential power analysis
33  * for elliptic curve cryptosystems. In : Cryptographic Hardware and
34  * Embedded Systems. Springer Berlin Heidelberg, 1999. p. 292-302.
35  * <http://link.springer.com/chapter/10.1007/3-540-48059-5_25>
36  *
37  * [3] HEDABOU, Mustapha, PINEL, Pierre, et B'EN'ETEAU, Lucien. A comb method to
38  * render ECC resistant against Side Channel Attacks. IACR Cryptology
39  * ePrint Archive, 2004, vol. 2004, p. 342.
40  * <http://eprint.iacr.org/2004/342.pdf>
41  *
42  * [4] Certicom Research. SEC 2: Recommended Elliptic Curve Domain Parameters.
43  * <http://www.secg.org/sec2-v2.pdf>
44  *
45  * [5] HANKERSON, Darrel, MENEZES, Alfred J., VANSTONE, Scott. Guide to Elliptic
46  * Curve Cryptography.
47  *
48  * [6] Digital Signature Standard (DSS), FIPS 186-4.
49  * <http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf>
50  *
51  * [7] Elliptic Curve Cryptography (ECC) Cipher Suites for Transport Layer
52  * Security (TLS), RFC 4492.
53  * <https://tools.ietf.org/search/rfc4492>
54  *
55  * [8] <http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html>
56  *
57  * [9] COHEN, Henri. A Course in Computational Algebraic Number Theory.
58  * Springer Science & Business Media, 1 Aug 2000
59  */
60 
61 #ifndef MBEDTLS_ECP_INTERNAL_H
62 #define MBEDTLS_ECP_INTERNAL_H
63 
64 #if defined(MBEDTLS_ECP_INTERNAL_ALT)
65 
75 unsigned char mbedtls_internal_ecp_grp_capable( const mbedtls_ecp_group *grp );
76 
92 int mbedtls_internal_ecp_init( const mbedtls_ecp_group *grp );
93 
100 void mbedtls_internal_ecp_free( const mbedtls_ecp_group *grp );
101 
102 #if defined(ECP_SHORTWEIERSTRASS)
103 
104 #if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT)
105 
120 int mbedtls_internal_ecp_randomize_jac( const mbedtls_ecp_group *grp,
121  mbedtls_ecp_point *pt, int (*f_rng)(void *, unsigned char *, size_t),
122  void *p_rng );
123 #endif
124 
125 #if defined(MBEDTLS_ECP_ADD_MIXED_ALT)
126 
165 int mbedtls_internal_ecp_add_mixed( const mbedtls_ecp_group *grp,
167  const mbedtls_ecp_point *Q );
168 #endif
169 
189 #if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT)
190 int mbedtls_internal_ecp_double_jac( const mbedtls_ecp_group *grp,
192 #endif
193 
219 #if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT)
220 int mbedtls_internal_ecp_normalize_jac_many( const mbedtls_ecp_group *grp,
221  mbedtls_ecp_point *T[], size_t t_len );
222 #endif
223 
237 #if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT)
238 int mbedtls_internal_ecp_normalize_jac( const mbedtls_ecp_group *grp,
239  mbedtls_ecp_point *pt );
240 #endif
241 
242 #endif /* ECP_SHORTWEIERSTRASS */
243 
244 #if defined(ECP_MONTGOMERY)
245 
246 #if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT)
247 int mbedtls_internal_ecp_double_add_mxz( const mbedtls_ecp_group *grp,
249  const mbedtls_ecp_point *Q, const mbedtls_mpi *d );
250 #endif
251 
267 #if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT)
268 int mbedtls_internal_ecp_randomize_mxz( const mbedtls_ecp_group *grp,
269  mbedtls_ecp_point *P, int (*f_rng)(void *, unsigned char *, size_t),
270  void *p_rng );
271 #endif
272 
283 #if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT)
284 int mbedtls_internal_ecp_normalize_mxz( const mbedtls_ecp_group *grp,
285  mbedtls_ecp_point *P );
286 #endif
287 
288 #endif /* ECP_MONTGOMERY */
289 
290 #endif /* MBEDTLS_ECP_INTERNAL_ALT */
291 
292 #endif /* ecp_internal.h */
293 
The ECP group structure.
Definition: ecp.h:167
#define P(a, b, c, d, e, f, g, h, x, K)
Definition: sha256.c:193
MPI structure.
Definition: bignum.h:180
#define R(t)
Definition: sha256.c:187
The ECP point structure, in Jacobian coordinates.
Definition: ecp.h:118