Coverage Report

Created: 2026-10-16 07:07

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl/providers/implementations/kem/ml_kem_kem.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
#include <string.h>
14
#include <openssl/params.h>
15
#include <openssl/e_os2.h>
16
#include "internal/common.h"
17
#include "prov/proverr.h"
18
19
/* Machine generated */
20
#ifndef ml_kem_set_ctx_params_list
21
static ossl_unused const OSSL_PARAM ml_kem_set_ctx_params_list[] = {
22
    OSSL_PARAM_octet_string(OSSL_KEM_PARAM_IKME, NULL, 0),
23
    OSSL_PARAM_END
24
};
25
#endif
26
27
#ifndef ml_kem_set_ctx_params_st
28
struct ml_kem_set_ctx_params_st {
29
    OSSL_PARAM *ikme;
30
};
31
#endif
32
33
#ifndef ml_kem_set_ctx_params_decoder
34
static ossl_unused int ml_kem_set_ctx_params_decoder
35
    (const OSSL_PARAM *p, struct ml_kem_set_ctx_params_st *r)
36
0
{
37
0
    const char *s;
38
39
0
    memset(r, 0, sizeof(*r));
40
0
    if (p != NULL)
41
0
        for (; (s = p->key) != NULL; p++)
42
0
            if (ossl_likely(strcmp("ikme", s + 0) == 0)) {
43
                /* OSSL_KEM_PARAM_IKME */
44
0
                if (ossl_unlikely(r->ikme != NULL)) {
45
0
                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
46
0
                                   "param %s is repeated", s);
47
0
                    return 0;
48
0
                }
49
0
                r->ikme = (OSSL_PARAM *)p;
50
0
            }
51
0
    return 1;
52
0
}
53
#endif
54
/* End of machine generated */
55
56
/* Machine generated */
57
#ifndef ml_kem_get_ctx_params_list
58
static ossl_unused const OSSL_PARAM ml_kem_get_ctx_params_list[] = {
59
# if defined(FIPS_MODULE)
60
    OSSL_PARAM_int(OSSL_KEM_PARAM_FIPS_APPROVED_INDICATOR, NULL),
61
# endif
62
    OSSL_PARAM_END
63
};
64
#endif
65
66
#ifndef ml_kem_get_ctx_params_st
67
struct ml_kem_get_ctx_params_st {
68
# if defined(FIPS_MODULE)
69
    OSSL_PARAM *ind;
70
# else
71
    int dummy; /* unused */
72
# endif
73
};
74
#endif
75
76
#ifndef ml_kem_get_ctx_params_decoder
77
static ossl_unused int ml_kem_get_ctx_params_decoder
78
    (const OSSL_PARAM *p, struct ml_kem_get_ctx_params_st *r)
79
0
{
80
0
    const char *s;
81
0
82
0
    memset(r, 0, sizeof(*r));
83
0
    if (p != NULL)
84
0
        for (; (s = p->key) != NULL; p++)
85
0
# if defined(FIPS_MODULE)
86
0
            if (ossl_likely(strcmp("fips-indicator", s + 0) == 0)) {
87
0
                /* OSSL_KEM_PARAM_FIPS_APPROVED_INDICATOR */
88
0
                if (ossl_unlikely(r->ind != NULL)) {
89
0
                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
90
0
                                   "param %s is repeated", s);
91
0
                    return 0;
92
0
                }
93
0
                r->ind = (OSSL_PARAM *)p;
94
0
            }
95
0
# else
96
0
            ;
97
0
# endif
98
0
    return 1;
99
0
}
100
#endif
101
/* End of machine generated */