Coverage Report

Created: 2026-09-12 06:55

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl41/providers/implementations/digests/blake2_prov.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 blake_get_ctx_params_list
21
static ossl_unused const OSSL_PARAM blake_get_ctx_params_list[] = {
22
    OSSL_PARAM_uint(OSSL_DIGEST_PARAM_SIZE, NULL),
23
    OSSL_PARAM_END
24
};
25
#endif
26
27
#ifndef blake_get_ctx_params_st
28
struct blake_get_ctx_params_st {
29
    OSSL_PARAM *size;
30
};
31
#endif
32
33
#ifndef blake_get_ctx_params_decoder
34
static ossl_unused int blake_get_ctx_params_decoder
35
    (const OSSL_PARAM *p, struct blake_get_ctx_params_st *r)
36
129k
{
37
129k
    const char *s;
38
39
129k
    memset(r, 0, sizeof(*r));
40
129k
    if (p != NULL)
41
259k
        for (; (s = p->key) != NULL; p++)
42
129k
            if (ossl_likely(strcmp("size", s + 0) == 0)) {
43
                /* OSSL_DIGEST_PARAM_SIZE */
44
129k
                if (ossl_unlikely(r->size != 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
129k
                r->size = (OSSL_PARAM *)p;
50
129k
            }
51
129k
    return 1;
52
129k
}
53
#endif
54
/* End of machine generated */
55
56
/* Machine generated */
57
#ifndef blake_set_ctx_params_list
58
static ossl_unused const OSSL_PARAM blake_set_ctx_params_list[] = {
59
    OSSL_PARAM_uint(OSSL_DIGEST_PARAM_SIZE, NULL),
60
    OSSL_PARAM_END
61
};
62
#endif
63
64
#ifndef blake_set_ctx_params_st
65
struct blake_set_ctx_params_st {
66
    OSSL_PARAM *size;
67
};
68
#endif
69
70
#ifndef blake_set_ctx_params_decoder
71
static ossl_unused int blake_set_ctx_params_decoder
72
    (const OSSL_PARAM *p, struct blake_set_ctx_params_st *r)
73
130k
{
74
130k
    const char *s;
75
76
130k
    memset(r, 0, sizeof(*r));
77
130k
    if (p != NULL)
78
170k
        for (; (s = p->key) != NULL; p++)
79
85.4k
            if (ossl_likely(strcmp("size", s + 0) == 0)) {
80
                /* OSSL_DIGEST_PARAM_SIZE */
81
85.4k
                if (ossl_unlikely(r->size != NULL)) {
82
0
                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
83
0
                                   "param %s is repeated", s);
84
0
                    return 0;
85
0
                }
86
85.4k
                r->size = (OSSL_PARAM *)p;
87
85.4k
            }
88
130k
    return 1;
89
130k
}
90
#endif
91
/* End of machine generated */