/*
 * Copyright 2025 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 rsakem_get_ctx_params_list
static const OSSL_PARAM rsakem_get_ctx_params_list[] = {
# if defined(FIPS_MODULE)
    OSSL_PARAM_int(OSSL_KEM_PARAM_FIPS_APPROVED_INDICATOR, NULL),
# endif
    OSSL_PARAM_END
};
#endif

#ifndef rsakem_get_ctx_params_st
struct rsakem_get_ctx_params_st {
# if defined(FIPS_MODULE)
    OSSL_PARAM *ind;
# else
    int dummy; /* unused */
# endif
};
#endif

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

    memset(r, 0, sizeof(*r));
    if (p != NULL)
        for (; (s = p->key) != NULL; p++)
# if defined(FIPS_MODULE)
            if (ossl_likely(strcmp("fips-indicator", s + 0) == 0)) {
                /* OSSL_KEM_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;
            }
# else
            ;
# endif
    return 1;
}
#endif
/* End of machine generated */

/* Machine generated by util/perl/OpenSSL/paramnames.pm */
#ifndef rsakem_set_ctx_params_list
static const OSSL_PARAM rsakem_set_ctx_params_list[] = {
    OSSL_PARAM_utf8_string(OSSL_KEM_PARAM_OPERATION, NULL, 0),
# if defined(FIPS_MODULE)
    OSSL_PARAM_int(OSSL_KEM_PARAM_FIPS_KEY_CHECK, NULL),
# endif
    OSSL_PARAM_END
};
#endif

#ifndef rsakem_set_ctx_params_st
struct rsakem_set_ctx_params_st {
# if defined(FIPS_MODULE)
    OSSL_PARAM *ind_k;
# endif
    OSSL_PARAM *op;
};
#endif

#ifndef rsakem_set_ctx_params_decoder
static int rsakem_set_ctx_params_decoder
    (const OSSL_PARAM *p, struct rsakem_set_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 'k':
# if defined(FIPS_MODULE)
                if (ossl_likely(strcmp("ey-check", s + 1) == 0)) {
                    /* OSSL_KEM_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;
                    }
                    r->ind_k = (OSSL_PARAM *)p;
                }
# endif
                break;
            case 'o':
                if (ossl_likely(strcmp("peration", s + 1) == 0)) {
                    /* OSSL_KEM_PARAM_OPERATION */
                    if (ossl_unlikely(r->op != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->op = (OSSL_PARAM *)p;
                }
            }
    return 1;
}
#endif
/* End of machine generated */
