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