/*
 * 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 test_rng_get_ctx_params_list
static const OSSL_PARAM test_rng_get_ctx_params_list[] = {
    OSSL_PARAM_int(OSSL_RAND_PARAM_STATE, NULL),
    OSSL_PARAM_uint(OSSL_RAND_PARAM_STRENGTH, NULL),
    OSSL_PARAM_size_t(OSSL_RAND_PARAM_MAX_REQUEST, NULL),
    OSSL_PARAM_uint(OSSL_RAND_PARAM_GENERATE, NULL),
# if defined(FIPS_MODULE)
    OSSL_PARAM_int(OSSL_RAND_PARAM_FIPS_APPROVED_INDICATOR, NULL),
# endif
    OSSL_PARAM_END
};
#endif

#ifndef test_rng_get_ctx_params_st
struct test_rng_get_ctx_params_st {
    OSSL_PARAM *gen;
# if defined(FIPS_MODULE)
    OSSL_PARAM *ind;
# endif
    OSSL_PARAM *maxreq;
    OSSL_PARAM *state;
    OSSL_PARAM *str;
};
#endif

#ifndef test_rng_get_ctx_params_decoder
static int test_rng_get_ctx_params_decoder
    (const OSSL_PARAM *p, struct test_rng_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 'f':
# if defined(FIPS_MODULE)
                if (ossl_likely(strcmp("ips-indicator", s + 1) == 0)) {
                    /* OSSL_RAND_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 'g':
                if (ossl_likely(strcmp("enerate", s + 1) == 0)) {
                    /* OSSL_RAND_PARAM_GENERATE */
                    if (ossl_unlikely(r->gen != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->gen = (OSSL_PARAM *)p;
                }
                break;
            case 'm':
                if (ossl_likely(strcmp("ax_request", s + 1) == 0)) {
                    /* OSSL_RAND_PARAM_MAX_REQUEST */
                    if (ossl_unlikely(r->maxreq != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->maxreq = (OSSL_PARAM *)p;
                }
                break;
            case 's':
                switch(s[1]) {
                default:
                    break;
                case 't':
                    switch(s[2]) {
                    default:
                        break;
                    case 'a':
                        if (ossl_likely(strcmp("te", s + 3) == 0)) {
                            /* OSSL_RAND_PARAM_STATE */
                            if (ossl_unlikely(r->state != NULL)) {
                                ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                               "param %s is repeated", s);
                                return 0;
                            }
                            r->state = (OSSL_PARAM *)p;
                        }
                        break;
                    case 'r':
                        if (ossl_likely(strcmp("ength", s + 3) == 0)) {
                            /* OSSL_RAND_PARAM_STRENGTH */
                            if (ossl_unlikely(r->str != NULL)) {
                                ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                               "param %s is repeated", s);
                                return 0;
                            }
                            r->str = (OSSL_PARAM *)p;
                        }
                    }
                }
            }
    return 1;
}
#endif
/* End of machine generated */

/* Machine generated by util/perl/OpenSSL/paramnames.pm */
#ifndef test_rng_set_ctx_params_list
static const OSSL_PARAM test_rng_set_ctx_params_list[] = {
    OSSL_PARAM_octet_string(OSSL_RAND_PARAM_TEST_ENTROPY, NULL, 0),
    OSSL_PARAM_octet_string(OSSL_RAND_PARAM_TEST_NONCE, NULL, 0),
    OSSL_PARAM_uint(OSSL_RAND_PARAM_STRENGTH, NULL),
    OSSL_PARAM_size_t(OSSL_RAND_PARAM_MAX_REQUEST, NULL),
    OSSL_PARAM_uint(OSSL_RAND_PARAM_GENERATE, NULL),
    OSSL_PARAM_END
};
#endif

#ifndef test_rng_set_ctx_params_st
struct test_rng_set_ctx_params_st {
    OSSL_PARAM *ent;
    OSSL_PARAM *gen;
    OSSL_PARAM *maxreq;
    OSSL_PARAM *nonce;
    OSSL_PARAM *str;
};
#endif

#ifndef test_rng_set_ctx_params_decoder
static int test_rng_set_ctx_params_decoder
    (const OSSL_PARAM *p, struct test_rng_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 'g':
                if (ossl_likely(strcmp("enerate", s + 1) == 0)) {
                    /* OSSL_RAND_PARAM_GENERATE */
                    if (ossl_unlikely(r->gen != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->gen = (OSSL_PARAM *)p;
                }
                break;
            case 'm':
                if (ossl_likely(strcmp("ax_request", s + 1) == 0)) {
                    /* OSSL_RAND_PARAM_MAX_REQUEST */
                    if (ossl_unlikely(r->maxreq != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->maxreq = (OSSL_PARAM *)p;
                }
                break;
            case 's':
                if (ossl_likely(strcmp("trength", s + 1) == 0)) {
                    /* OSSL_RAND_PARAM_STRENGTH */
                    if (ossl_unlikely(r->str != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->str = (OSSL_PARAM *)p;
                }
                break;
            case 't':
                switch(s[1]) {
                default:
                    break;
                case 'e':
                    switch(s[2]) {
                    default:
                        break;
                    case 's':
                        switch(s[3]) {
                        default:
                            break;
                        case 't':
                            switch(s[4]) {
                            default:
                                break;
                            case '_':
                                switch(s[5]) {
                                default:
                                    break;
                                case 'e':
                                    if (ossl_likely(strcmp("ntropy", s + 6) == 0)) {
                                        /* OSSL_RAND_PARAM_TEST_ENTROPY */
                                        if (ossl_unlikely(r->ent != NULL)) {
                                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                                           "param %s is repeated", s);
                                            return 0;
                                        }
                                        r->ent = (OSSL_PARAM *)p;
                                    }
                                    break;
                                case 'n':
                                    if (ossl_likely(strcmp("once", s + 6) == 0)) {
                                        /* OSSL_RAND_PARAM_TEST_NONCE */
                                        if (ossl_unlikely(r->nonce != NULL)) {
                                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                                           "param %s is repeated", s);
                                            return 0;
                                        }
                                        r->nonce = (OSSL_PARAM *)p;
                                    }
                                }
                            }
                        }
                    }
                }
            }
    return 1;
}
#endif
/* End of machine generated */
