OPTIGA Trust M  1.1.0
C++ library for Optiga Trust M Chip Security Controller
rsa_internal.h
Go to the documentation of this file.
1 
37 /*
38  * Copyright (C) 2006-2017, ARM Limited, All Rights Reserved
39  * SPDX-License-Identifier: Apache-2.0
40  *
41  * Licensed under the Apache License, Version 2.0 (the "License"); you may
42  * not use this file except in compliance with the License.
43  * You may obtain a copy of the License at
44  *
45  * http://www.apache.org/licenses/LICENSE-2.0
46  *
47  * Unless required by applicable law or agreed to in writing, software
48  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
49  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
50  * See the License for the specific language governing permissions and
51  * limitations under the License.
52  *
53  * This file is part of mbed TLS (https://tls.mbed.org)
54  *
55  */
56 
57 #ifndef MBEDTLS_RSA_INTERNAL_H
58 #define MBEDTLS_RSA_INTERNAL_H
59 
60 #if !defined(MBEDTLS_CONFIG_FILE)
61 #include "config.h"
62 #else
63 #include MBEDTLS_CONFIG_FILE
64 #endif
65 
66 #include "bignum.h"
67 
68 #ifdef __cplusplus
69 extern "C" {
70 #endif
71 
72 
97 int mbedtls_rsa_deduce_primes( mbedtls_mpi const *N, mbedtls_mpi const *E,
98  mbedtls_mpi const *D,
99  mbedtls_mpi *P, mbedtls_mpi *Q );
100 
123  mbedtls_mpi const *Q,
124  mbedtls_mpi const *E,
125  mbedtls_mpi *D );
126 
127 
148 int mbedtls_rsa_deduce_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q,
149  const mbedtls_mpi *D, mbedtls_mpi *DP,
150  mbedtls_mpi *DQ, mbedtls_mpi *QP );
151 
152 
184  const mbedtls_mpi *Q, const mbedtls_mpi *D,
185  const mbedtls_mpi *E,
186  int (*f_rng)(void *, unsigned char *, size_t),
187  void *p_rng );
188 
218 int mbedtls_rsa_validate_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q,
219  const mbedtls_mpi *D, const mbedtls_mpi *DP,
220  const mbedtls_mpi *DQ, const mbedtls_mpi *QP );
221 
222 #ifdef __cplusplus
223 }
224 #endif
225 
226 #endif /* rsa_internal.h */
int mbedtls_rsa_validate_crt(const mbedtls_mpi *P, const mbedtls_mpi *Q, const mbedtls_mpi *D, const mbedtls_mpi *DP, const mbedtls_mpi *DQ, const mbedtls_mpi *QP)
Check validity of RSA CRT parameters.
int mbedtls_rsa_deduce_crt(const mbedtls_mpi *P, const mbedtls_mpi *Q, const mbedtls_mpi *D, mbedtls_mpi *DP, mbedtls_mpi *DQ, mbedtls_mpi *QP)
Generate RSA-CRT parameters.
int mbedtls_rsa_validate_params(const mbedtls_mpi *N, const mbedtls_mpi *P, const mbedtls_mpi *Q, const mbedtls_mpi *D, const mbedtls_mpi *E, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Check validity of core RSA parameters.
Configuration options (set of defines)
Multi-precision integer library.
#define P(a, b, c, d, e, f, g, h, x, K)
Definition: sha256.c:193
int mbedtls_rsa_deduce_private_exponent(mbedtls_mpi const *P, mbedtls_mpi const *Q, mbedtls_mpi const *E, mbedtls_mpi *D)
Compute RSA private exponent from prime moduli and public key.
int mbedtls_rsa_deduce_primes(mbedtls_mpi const *N, mbedtls_mpi const *E, mbedtls_mpi const *D, mbedtls_mpi *P, mbedtls_mpi *Q)
Compute RSA prime moduli P, Q from public modulus N=PQ and a pair of private and public key.
MPI structure.
Definition: bignum.h:180