Coverage Report

Created: 2025-11-11 06:20

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl/providers/implementations/signature/slh_dsa_sig.inc
Line
Count
Source
1
/*
2
 * Copyright 2025 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
12
/* Machine generated by util/perl/OpenSSL/paramnames.pm */
13
#ifndef slh_dsa_set_ctx_params_list
14
static const OSSL_PARAM slh_dsa_set_ctx_params_list[] = {
15
    OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_CONTEXT_STRING, NULL, 0),
16
    OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_TEST_ENTROPY, NULL, 0),
17
    OSSL_PARAM_int(OSSL_SIGNATURE_PARAM_DETERMINISTIC, NULL),
18
    OSSL_PARAM_int(OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING, NULL),
19
    OSSL_PARAM_END
20
};
21
#endif
22
23
#ifndef slh_dsa_set_ctx_params_st
24
struct slh_dsa_set_ctx_params_st {
25
    OSSL_PARAM *context;
26
    OSSL_PARAM *det;
27
    OSSL_PARAM *entropy;
28
    OSSL_PARAM *msgenc;
29
};
30
#endif
31
32
#ifndef slh_dsa_set_ctx_params_decoder
33
static int slh_dsa_set_ctx_params_decoder
34
    (const OSSL_PARAM *p, struct slh_dsa_set_ctx_params_st *r)
35
0
{
36
0
    const char *s;
37
38
0
    memset(r, 0, sizeof(*r));
39
0
    if (p != NULL)
40
0
        for (; (s = p->key) != NULL; p++)
41
0
            switch(s[0]) {
42
0
            default:
43
0
                break;
44
0
            case 'c':
45
0
                if (ossl_likely(strcmp("ontext-string", s + 1) == 0)) {
46
                    /* OSSL_SIGNATURE_PARAM_CONTEXT_STRING */
47
0
                    if (ossl_unlikely(r->context != NULL)) {
48
0
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
49
0
                                       "param %s is repeated", s);
50
0
                        return 0;
51
0
                    }
52
0
                    r->context = (OSSL_PARAM *)p;
53
0
                }
54
0
                break;
55
0
            case 'd':
56
0
                if (ossl_likely(strcmp("eterministic", s + 1) == 0)) {
57
                    /* OSSL_SIGNATURE_PARAM_DETERMINISTIC */
58
0
                    if (ossl_unlikely(r->det != NULL)) {
59
0
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
60
0
                                       "param %s is repeated", s);
61
0
                        return 0;
62
0
                    }
63
0
                    r->det = (OSSL_PARAM *)p;
64
0
                }
65
0
                break;
66
0
            case 'm':
67
0
                if (ossl_likely(strcmp("essage-encoding", s + 1) == 0)) {
68
                    /* OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING */
69
0
                    if (ossl_unlikely(r->msgenc != NULL)) {
70
0
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
71
0
                                       "param %s is repeated", s);
72
0
                        return 0;
73
0
                    }
74
0
                    r->msgenc = (OSSL_PARAM *)p;
75
0
                }
76
0
                break;
77
0
            case 't':
78
0
                if (ossl_likely(strcmp("est-entropy", s + 1) == 0)) {
79
                    /* OSSL_SIGNATURE_PARAM_TEST_ENTROPY */
80
0
                    if (ossl_unlikely(r->entropy != NULL)) {
81
0
                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
82
0
                                       "param %s is repeated", s);
83
0
                        return 0;
84
0
                    }
85
0
                    r->entropy = (OSSL_PARAM *)p;
86
0
                }
87
0
            }
88
0
    return 1;
89
0
}
90
#endif
91
/* End of machine generated */
92
93
/* Machine generated by util/perl/OpenSSL/paramnames.pm */
94
#ifndef slh_dsa_get_ctx_params_list
95
static const OSSL_PARAM slh_dsa_get_ctx_params_list[] = {
96
    OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_ALGORITHM_ID, NULL, 0),
97
    OSSL_PARAM_END
98
};
99
#endif
100
101
#ifndef slh_dsa_get_ctx_params_st
102
struct slh_dsa_get_ctx_params_st {
103
    OSSL_PARAM *algid;
104
};
105
#endif
106
107
#ifndef slh_dsa_get_ctx_params_decoder
108
static int slh_dsa_get_ctx_params_decoder
109
    (const OSSL_PARAM *p, struct slh_dsa_get_ctx_params_st *r)
110
0
{
111
0
    const char *s;
112
113
0
    memset(r, 0, sizeof(*r));
114
0
    if (p != NULL)
115
0
        for (; (s = p->key) != NULL; p++)
116
0
            if (ossl_likely(strcmp("algorithm-id", s + 0) == 0)) {
117
                /* OSSL_SIGNATURE_PARAM_ALGORITHM_ID */
118
0
                if (ossl_unlikely(r->algid != 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->algid = (OSSL_PARAM *)p;
124
0
            }
125
0
    return 1;
126
0
}
127
#endif
128
/* End of machine generated */