1e1051a39Sopenharmony_ci/*
2e1051a39Sopenharmony_ci * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
3e1051a39Sopenharmony_ci *
4e1051a39Sopenharmony_ci * Licensed under the Apache License 2.0 (the "License").  You may not use
5e1051a39Sopenharmony_ci * this file except in compliance with the License.  You can obtain a copy
6e1051a39Sopenharmony_ci * in the file LICENSE in the source distribution or at
7e1051a39Sopenharmony_ci * https://www.openssl.org/source/license.html
8e1051a39Sopenharmony_ci */
9e1051a39Sopenharmony_ci
10e1051a39Sopenharmony_ci#include <openssl/core_names.h>
11e1051a39Sopenharmony_ci#include "crypto/rsa.h"
12e1051a39Sopenharmony_ci
13e1051a39Sopenharmony_ci/*
14e1051a39Sopenharmony_ci * The following tables are constants used during RSA parameter building
15e1051a39Sopenharmony_ci * operations. It is easier to point to one of these fixed strings than have
16e1051a39Sopenharmony_ci * to dynamically add and generate the names on the fly.
17e1051a39Sopenharmony_ci */
18e1051a39Sopenharmony_ci
19e1051a39Sopenharmony_ci/*
20e1051a39Sopenharmony_ci * A fixed table of names for the RSA prime factors starting with
21e1051a39Sopenharmony_ci * P,Q and up to 8 additional primes.
22e1051a39Sopenharmony_ci */
23e1051a39Sopenharmony_ciconst char *ossl_rsa_mp_factor_names[] = {
24e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_FACTOR1,
25e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_FACTOR2,
26e1051a39Sopenharmony_ci#ifndef FIPS_MODULE
27e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_FACTOR3,
28e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_FACTOR4,
29e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_FACTOR5,
30e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_FACTOR6,
31e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_FACTOR7,
32e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_FACTOR8,
33e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_FACTOR9,
34e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_FACTOR10,
35e1051a39Sopenharmony_ci#endif
36e1051a39Sopenharmony_ci    NULL
37e1051a39Sopenharmony_ci};
38e1051a39Sopenharmony_ci
39e1051a39Sopenharmony_ci/*
40e1051a39Sopenharmony_ci * A fixed table of names for the RSA exponents starting with
41e1051a39Sopenharmony_ci * DP,DQ and up to 8 additional exponents.
42e1051a39Sopenharmony_ci */
43e1051a39Sopenharmony_ciconst char *ossl_rsa_mp_exp_names[] = {
44e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_EXPONENT1,
45e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_EXPONENT2,
46e1051a39Sopenharmony_ci#ifndef FIPS_MODULE
47e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_EXPONENT3,
48e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_EXPONENT4,
49e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_EXPONENT5,
50e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_EXPONENT6,
51e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_EXPONENT7,
52e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_EXPONENT8,
53e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_EXPONENT9,
54e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_EXPONENT10,
55e1051a39Sopenharmony_ci#endif
56e1051a39Sopenharmony_ci    NULL
57e1051a39Sopenharmony_ci};
58e1051a39Sopenharmony_ci
59e1051a39Sopenharmony_ci/*
60e1051a39Sopenharmony_ci * A fixed table of names for the RSA coefficients starting with
61e1051a39Sopenharmony_ci * QINV and up to 8 additional exponents.
62e1051a39Sopenharmony_ci */
63e1051a39Sopenharmony_ciconst char *ossl_rsa_mp_coeff_names[] = {
64e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_COEFFICIENT1,
65e1051a39Sopenharmony_ci#ifndef FIPS_MODULE
66e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_COEFFICIENT2,
67e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_COEFFICIENT3,
68e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_COEFFICIENT4,
69e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_COEFFICIENT5,
70e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_COEFFICIENT6,
71e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_COEFFICIENT7,
72e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_COEFFICIENT8,
73e1051a39Sopenharmony_ci    OSSL_PKEY_PARAM_RSA_COEFFICIENT9,
74e1051a39Sopenharmony_ci#endif
75e1051a39Sopenharmony_ci    NULL
76e1051a39Sopenharmony_ci};
77