/*
 * 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 cshake_set_ctx_params_list
static const OSSL_PARAM cshake_set_ctx_params_list[] = {
    OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_XOFLEN, NULL),
    OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_SIZE, NULL),
    OSSL_PARAM_utf8_string(OSSL_DIGEST_PARAM_FUNCTION_NAME, NULL, 0),
    OSSL_PARAM_utf8_string(OSSL_DIGEST_PARAM_CUSTOMIZATION, NULL, 0),
    OSSL_PARAM_utf8_string(OSSL_DIGEST_PARAM_PROPERTIES, NULL, 0),
    OSSL_PARAM_END
};
#endif

#ifndef cshake_set_ctx_params_st
struct cshake_set_ctx_params_st {
    OSSL_PARAM *custom;
    OSSL_PARAM *func;
    OSSL_PARAM *propq;
    OSSL_PARAM *xoflen;
};
#endif

#ifndef cshake_set_ctx_params_decoder
static int cshake_set_ctx_params_decoder
    (const OSSL_PARAM *p, struct cshake_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 'c':
                if (ossl_likely(strcmp("ustomization", s + 1) == 0)) {
                    /* OSSL_DIGEST_PARAM_CUSTOMIZATION */
                    if (ossl_unlikely(r->custom != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->custom = (OSSL_PARAM *)p;
                }
                break;
            case 'f':
                if (ossl_likely(strcmp("unction-name", s + 1) == 0)) {
                    /* OSSL_DIGEST_PARAM_FUNCTION_NAME */
                    if (ossl_unlikely(r->func != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->func = (OSSL_PARAM *)p;
                }
                break;
            case 'p':
                if (ossl_likely(strcmp("roperties", s + 1) == 0)) {
                    /* OSSL_DIGEST_PARAM_PROPERTIES */
                    if (ossl_unlikely(r->propq != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->propq = (OSSL_PARAM *)p;
                }
                break;
            case 's':
                if (ossl_likely(strcmp("ize", s + 1) == 0)) {
                    /* OSSL_DIGEST_PARAM_SIZE */
                    if (ossl_unlikely(r->xoflen != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->xoflen = (OSSL_PARAM *)p;
                }
                break;
            case 'x':
                if (ossl_likely(strcmp("oflen", s + 1) == 0)) {
                    /* OSSL_DIGEST_PARAM_XOFLEN */
                    if (ossl_unlikely(r->xoflen != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->xoflen = (OSSL_PARAM *)p;
                }
            }
    return 1;
}
#endif
/* End of machine generated */

/* Machine generated by util/perl/OpenSSL/paramnames.pm */
#ifndef cshake_get_ctx_params_list
static const OSSL_PARAM cshake_get_ctx_params_list[] = {
    OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_XOFLEN, NULL),
    OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_SIZE, NULL),
    OSSL_PARAM_END
};
#endif

#ifndef cshake_get_ctx_params_st
struct cshake_get_ctx_params_st {
    OSSL_PARAM *size;
    OSSL_PARAM *xoflen;
};
#endif

#ifndef cshake_get_ctx_params_decoder
static int cshake_get_ctx_params_decoder
    (const OSSL_PARAM *p, struct cshake_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 's':
                if (ossl_likely(strcmp("ize", s + 1) == 0)) {
                    /* OSSL_DIGEST_PARAM_SIZE */
                    if (ossl_unlikely(r->size != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->size = (OSSL_PARAM *)p;
                }
                break;
            case 'x':
                if (ossl_likely(strcmp("oflen", s + 1) == 0)) {
                    /* OSSL_DIGEST_PARAM_XOFLEN */
                    if (ossl_unlikely(r->xoflen != NULL)) {
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
                                       "param %s is repeated", s);
                        return 0;
                    }
                    r->xoflen = (OSSL_PARAM *)p;
                }
            }
    return 1;
}
#endif
/* End of machine generated */
