/*
 * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
 *
 * Licensed under the Apache License 2.0 (the \"License\").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
 */



/* Machine generated by util/perl/OpenSSL/paramnames.pm */
#ifndef rsa_get_ctx_params_list
static const OSSL_PARAM rsa_get_ctx_params_list[] = {
    OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST, NULL, 0),
    OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_PAD_MODE, NULL, 0),
    OSSL_PARAM_int(OSSL_ASYM_CIPHER_PARAM_PAD_MODE, NULL),
    OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST, NULL, 0),
    OSSL_PARAM_octet_ptr(OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL, NULL, 0),
    OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION, NULL),
    OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION, NULL),
    OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION, NULL),
# if defined(FIPS_MODULE)
    OSSL_PARAM_int(OSSL_ASYM_CIPHER_PARAM_FIPS_APPROVED_INDICATOR, NULL),
# endif
    OSSL_PARAM_END
};
#endif

#ifndef rsa_get_ctx_params_st
struct rsa_get_ctx_params_st {
    OSSL_PARAM *imrej;
# if defined(FIPS_MODULE)
    OSSL_PARAM *ind;
# endif
    OSSL_PARAM *label;
    OSSL_PARAM *mgf1;
    OSSL_PARAM *negver;
    OSSL_PARAM *oaep;
    OSSL_PARAM *pad;
    OSSL_PARAM *tlsver;
};
#endif

#ifndef rsa_get_ctx_params_decoder
static int rsa_get_ctx_params_decoder
    (const OSSL_PARAM *p, struct rsa_get_ctx_params_st *r)
{
    const char *s;

    memset(r, 0, sizeof(*r));
    if (p != NULL)
        for (; (s = p->key) != NULL; p++)
            switch(s[0]) {
            default:
                break;
            case 'd':
                if (ossl_likely(strcmp("igest", s + 1) == 0)) {
                    /* OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST */
                    if (ossl_unlikely(r->oaep != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->oaep = (OSSL_PARAM *)p;
                }
                break;
            case 'f':
# if defined(FIPS_MODULE)
                if (ossl_likely(strcmp("ips-indicator", s + 1) == 0)) {
                    /* OSSL_ASYM_CIPHER_PARAM_FIPS_APPROVED_INDICATOR */
                    if (ossl_unlikely(r->ind != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->ind = (OSSL_PARAM *)p;
                }
# endif
                break;
            case 'i':
                if (ossl_likely(strcmp("mplicit-rejection", s + 1) == 0)) {
                    /* OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION */
                    if (ossl_unlikely(r->imrej != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->imrej = (OSSL_PARAM *)p;
                }
                break;
            case 'm':
                if (ossl_likely(strcmp("gf1-digest", s + 1) == 0)) {
                    /* OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST */
                    if (ossl_unlikely(r->mgf1 != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->mgf1 = (OSSL_PARAM *)p;
                }
                break;
            case 'o':
                if (ossl_likely(strcmp("aep-label", s + 1) == 0)) {
                    /* OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL */
                    if (ossl_unlikely(r->label != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->label = (OSSL_PARAM *)p;
                }
                break;
            case 'p':
                if (ossl_likely(strcmp("ad-mode", s + 1) == 0)) {
                    /* OSSL_ASYM_CIPHER_PARAM_PAD_MODE */
                    if (ossl_unlikely(r->pad != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->pad = (OSSL_PARAM *)p;
                }
                break;
            case 't':
                switch(s[1]) {
                default:
                    break;
                case 'l':
                    switch(s[2]) {
                    default:
                        break;
                    case 's':
                        switch(s[3]) {
                        default:
                            break;
                        case '-':
                            switch(s[4]) {
                            default:
                                break;
                            case 'c':
                                if (ossl_likely(strcmp("lient-version", s + 5) == 0)) {
                                    /* OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION */
                                    if (ossl_unlikely(r->tlsver != NULL)) {
                                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                                       "param %s is repeated", s);
                                        return 0;
                                    }
                                    r->tlsver = (OSSL_PARAM *)p;
                                }
                                break;
                            case 'n':
                                if (ossl_likely(strcmp("egotiated-version", s + 5) == 0)) {
                                    /* OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION */
                                    if (ossl_unlikely(r->negver != NULL)) {
                                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                                       "param %s is repeated", s);
                                        return 0;
                                    }
                                    r->negver = (OSSL_PARAM *)p;
                                }
                            }
                        }
                    }
                }
            }
    return 1;
}
#endif
/* End of machine generated */

/* Machine generated by util/perl/OpenSSL/paramnames.pm */
#ifndef rsa_set_ctx_params_list
static const OSSL_PARAM rsa_set_ctx_params_list[] = {
    OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST, NULL, 0),
    OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST_PROPS, NULL, 0),
    OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_PAD_MODE, NULL, 0),
    OSSL_PARAM_int(OSSL_ASYM_CIPHER_PARAM_PAD_MODE, NULL),
    OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST, NULL, 0),
    OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST_PROPS, NULL, 0),
    OSSL_PARAM_octet_string(OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL, NULL, 0),
    OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION, NULL),
    OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION, NULL),
    OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION, NULL),
# if defined(FIPS_MODULE)
    OSSL_PARAM_int(OSSL_ASYM_CIPHER_PARAM_FIPS_KEY_CHECK, NULL),
# endif
# if defined(FIPS_MODULE)
    OSSL_PARAM_int(OSSL_ASYM_CIPHER_PARAM_FIPS_RSA_PKCS15_PAD_DISABLED, NULL),
# endif
    OSSL_PARAM_END
};
#endif

#ifndef rsa_set_ctx_params_st
struct rsa_set_ctx_params_st {
    OSSL_PARAM *imrej;
# if defined(FIPS_MODULE)
    OSSL_PARAM *ind_k;
# endif
# if defined(FIPS_MODULE)
    OSSL_PARAM *ind_pad;
# endif
    OSSL_PARAM *label;
    OSSL_PARAM *mgf1;
    OSSL_PARAM *mgf1_pq;
    OSSL_PARAM *negver;
    OSSL_PARAM *oaep;
    OSSL_PARAM *oaep_pq;
    OSSL_PARAM *pad;
    OSSL_PARAM *tlsver;
};
#endif

#ifndef rsa_set_ctx_params_decoder
static int rsa_set_ctx_params_decoder
    (const OSSL_PARAM *p, struct rsa_set_ctx_params_st *r, int *count)
{
    const char *s;

    *count = 0;
    memset(r, 0, sizeof(*r));
    if (p != NULL)
        for (; (s = p->key) != NULL; p++)
            switch(s[0]) {
            default:
                break;
            case 'd':
                switch(s[1]) {
                default:
                    break;
                case 'i':
                    switch(s[2]) {
                    default:
                        break;
                    case 'g':
                        switch(s[3]) {
                        default:
                            break;
                        case 'e':
                            switch(s[4]) {
                            default:
                                break;
                            case 's':
                                switch(s[5]) {
                                default:
                                    break;
                                case 't':
                                    switch(s[6]) {
                                    default:
                                        break;
                                    case '-':
                                        if (ossl_likely(strcmp("props", s + 7) == 0)) {
                                            /* OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST_PROPS */
                                            if (ossl_unlikely(r->oaep_pq != NULL)) {
                                                ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                                               "param %s is repeated", s);
                                                return 0;
                                            }
                                            ++*count;
                                            r->oaep_pq = (OSSL_PARAM *)p;
                                        }
                                        break;
                                    case '\0':
                                        if (ossl_unlikely(r->oaep != NULL)) {
                                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                                           "param %s is repeated", s);
                                            return 0;
                                        }
                                        ++*count;
                                        r->oaep = (OSSL_PARAM *)p;
                                    }
                                }
                            }
                        }
                    }
                }
                break;
            case 'i':
                if (ossl_likely(strcmp("mplicit-rejection", s + 1) == 0)) {
                    /* OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION */
                    if (ossl_unlikely(r->imrej != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    ++*count;
                    r->imrej = (OSSL_PARAM *)p;
                }
                break;
            case 'k':
# if defined(FIPS_MODULE)
                if (ossl_likely(strcmp("ey-check", s + 1) == 0)) {
                    /* OSSL_ASYM_CIPHER_PARAM_FIPS_KEY_CHECK */
                    if (ossl_unlikely(r->ind_k != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    ++*count;
                    r->ind_k = (OSSL_PARAM *)p;
                }
# endif
                break;
            case 'm':
                switch(s[1]) {
                default:
                    break;
                case 'g':
                    switch(s[2]) {
                    default:
                        break;
                    case 'f':
                        switch(s[3]) {
                        default:
                            break;
                        case '1':
                            switch(s[4]) {
                            default:
                                break;
                            case '-':
                                switch(s[5]) {
                                default:
                                    break;
                                case 'd':
                                    if (ossl_likely(strcmp("igest", s + 6) == 0)) {
                                        /* OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST */
                                        if (ossl_unlikely(r->mgf1 != NULL)) {
                                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                                           "param %s is repeated", s);
                                            return 0;
                                        }
                                        ++*count;
                                        r->mgf1 = (OSSL_PARAM *)p;
                                    }
                                    break;
                                case 'p':
                                    if (ossl_likely(strcmp("roperties", s + 6) == 0)) {
                                        /* OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST_PROPS */
                                        if (ossl_unlikely(r->mgf1_pq != NULL)) {
                                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                                           "param %s is repeated", s);
                                            return 0;
                                        }
                                        ++*count;
                                        r->mgf1_pq = (OSSL_PARAM *)p;
                                    }
                                }
                            }
                        }
                    }
                }
                break;
            case 'o':
                if (ossl_likely(strcmp("aep-label", s + 1) == 0)) {
                    /* OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL */
                    if (ossl_unlikely(r->label != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    ++*count;
                    r->label = (OSSL_PARAM *)p;
                }
                break;
            case 'p':
                if (ossl_likely(strcmp("ad-mode", s + 1) == 0)) {
                    /* OSSL_ASYM_CIPHER_PARAM_PAD_MODE */
                    if (ossl_unlikely(r->pad != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    ++*count;
                    r->pad = (OSSL_PARAM *)p;
                }
                break;
            case 'r':
# if defined(FIPS_MODULE)
                if (ossl_likely(strcmp("sa-pkcs15-pad-disabled", s + 1) == 0)) {
                    /* OSSL_ASYM_CIPHER_PARAM_FIPS_RSA_PKCS15_PAD_DISABLED */
                    if (ossl_unlikely(r->ind_pad != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    ++*count;
                    r->ind_pad = (OSSL_PARAM *)p;
                }
# endif
                break;
            case 't':
                switch(s[1]) {
                default:
                    break;
                case 'l':
                    switch(s[2]) {
                    default:
                        break;
                    case 's':
                        switch(s[3]) {
                        default:
                            break;
                        case '-':
                            switch(s[4]) {
                            default:
                                break;
                            case 'c':
                                if (ossl_likely(strcmp("lient-version", s + 5) == 0)) {
                                    /* OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION */
                                    if (ossl_unlikely(r->tlsver != NULL)) {
                                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                                       "param %s is repeated", s);
                                        return 0;
                                    }
                                    ++*count;
                                    r->tlsver = (OSSL_PARAM *)p;
                                }
                                break;
                            case 'n':
                                if (ossl_likely(strcmp("egotiated-version", s + 5) == 0)) {
                                    /* OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION */
                                    if (ossl_unlikely(r->negver != NULL)) {
                                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                                       "param %s is repeated", s);
                                        return 0;
                                    }
                                    ++*count;
                                    r->negver = (OSSL_PARAM *)p;
                                }
                            }
                        }
                    }
                }
            }
    return 1;
}
#endif
/* End of machine generated */
