Coverage Report

Created: 2026-11-16 07:12

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl/providers/implementations/digests/turboshake_prov.inc
Line
Count
Source
1
/*
2
 * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
3
 *
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
8
 */
9
10
11
/* Machine generated by util/perl/OpenSSL/paramnames.pm */
12
#include <string.h>
13
#include <openssl/params.h>
14
#include <openssl/e_os2.h>
15
#include "internal/common.h"
16
#include "prov/proverr.h"
17
18
/* Machine generated */
19
#ifndef turboshake_get_ctx_params_list
20
static ossl_unused const OSSL_PARAM turboshake_get_ctx_params_list[] = {
21
    OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_XOFLEN, NULL),
22
    OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_SIZE, NULL),
23
    OSSL_PARAM_uint(OSSL_DIGEST_PARAM_DOMAIN_SEPARATOR, NULL),
24
    OSSL_PARAM_END
25
};
26
#endif
27
28
#ifndef turboshake_get_ctx_params_st
29
struct turboshake_get_ctx_params_st {
30
    OSSL_PARAM *domain;
31
    OSSL_PARAM *size;
32
    OSSL_PARAM *xoflen;
33
};
34
#endif
35
36
#ifndef turboshake_get_ctx_params_decoder
37
static ossl_unused int turboshake_get_ctx_params_decoder
38
    (const OSSL_PARAM *p, struct turboshake_get_ctx_params_st *r)
39
0
{
40
0
    const char *s;
41
42
0
    memset(r, 0, sizeof(*r));
43
0
    if (p != NULL)
44
0
        for (; (s = p->key) != NULL; p++)
45
0
            switch(s[0]) {
46
0
            default:
47
0
                break;
48
0
            case 'd':
49
0
                if (ossl_likely(strcmp("omain-separator", s + 1) == 0)) {
50
                    /* OSSL_DIGEST_PARAM_DOMAIN_SEPARATOR */
51
0
                    if (ossl_unlikely(r->domain != NULL)) {
52
0
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
53
0
                                       "param %s is repeated", s);
54
0
                        return 0;
55
0
                    }
56
0
                    r->domain = (OSSL_PARAM *)p;
57
0
                }
58
0
                break;
59
0
            case 's':
60
0
                if (ossl_likely(strcmp("ize", s + 1) == 0)) {
61
                    /* OSSL_DIGEST_PARAM_SIZE */
62
0
                    if (ossl_unlikely(r->size != NULL)) {
63
0
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
64
0
                                       "param %s is repeated", s);
65
0
                        return 0;
66
0
                    }
67
0
                    r->size = (OSSL_PARAM *)p;
68
0
                }
69
0
                break;
70
0
            case 'x':
71
0
                if (ossl_likely(strcmp("oflen", s + 1) == 0)) {
72
                    /* OSSL_DIGEST_PARAM_XOFLEN */
73
0
                    if (ossl_unlikely(r->xoflen != NULL)) {
74
0
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
75
0
                                       "param %s is repeated", s);
76
0
                        return 0;
77
0
                    }
78
0
                    r->xoflen = (OSSL_PARAM *)p;
79
0
                }
80
0
            }
81
0
    return 1;
82
0
}
83
#endif
84
/* End of machine generated */
85
86
/* Machine generated */
87
#ifndef turboshake_set_ctx_params_list
88
static ossl_unused const OSSL_PARAM turboshake_set_ctx_params_list[] = {
89
    OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_XOFLEN, NULL),
90
    OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_SIZE, NULL),
91
    OSSL_PARAM_uint(OSSL_DIGEST_PARAM_DOMAIN_SEPARATOR, NULL),
92
    OSSL_PARAM_END
93
};
94
#endif
95
96
#ifndef turboshake_set_ctx_params_st
97
struct turboshake_set_ctx_params_st {
98
    OSSL_PARAM *domain;
99
    OSSL_PARAM *xoflen;
100
};
101
#endif
102
103
#ifndef turboshake_set_ctx_params_decoder
104
static ossl_unused int turboshake_set_ctx_params_decoder
105
    (const OSSL_PARAM *p, struct turboshake_set_ctx_params_st *r)
106
0
{
107
0
    const char *s;
108
109
0
    memset(r, 0, sizeof(*r));
110
0
    if (p != NULL)
111
0
        for (; (s = p->key) != NULL; p++)
112
0
            switch(s[0]) {
113
0
            default:
114
0
                break;
115
0
            case 'd':
116
0
                if (ossl_likely(strcmp("omain-separator", s + 1) == 0)) {
117
                    /* OSSL_DIGEST_PARAM_DOMAIN_SEPARATOR */
118
0
                    if (ossl_unlikely(r->domain != NULL)) {
119
0
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
120
0
                                       "param %s is repeated", s);
121
0
                        return 0;
122
0
                    }
123
0
                    r->domain = (OSSL_PARAM *)p;
124
0
                }
125
0
                break;
126
0
            case 's':
127
0
                if (ossl_likely(strcmp("ize", s + 1) == 0)) {
128
                    /* OSSL_DIGEST_PARAM_SIZE */
129
0
                    if (ossl_unlikely(r->xoflen != NULL)) {
130
0
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
131
0
                                       "param %s is repeated", s);
132
0
                        return 0;
133
0
                    }
134
0
                    r->xoflen = (OSSL_PARAM *)p;
135
0
                }
136
0
                break;
137
0
            case 'x':
138
0
                if (ossl_likely(strcmp("oflen", s + 1) == 0)) {
139
                    /* OSSL_DIGEST_PARAM_XOFLEN */
140
0
                    if (ossl_unlikely(r->xoflen != NULL)) {
141
0
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
142
0
                                       "param %s is repeated", s);
143
0
                        return 0;
144
0
                    }
145
0
                    r->xoflen = (OSSL_PARAM *)p;
146
0
                }
147
0
            }
148
0
    return 1;
149
0
}
150
#endif
151
/* End of machine generated */