Coverage Report

Created: 2026-05-20 07:05

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl/providers/implementations/macs/poly1305_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 "internal/common.h"
16
#include "prov/proverr.h"
17
18
#ifndef poly1305_get_params_list
19
static const OSSL_PARAM poly1305_get_params_list[] = {
20
    OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
21
    OSSL_PARAM_END
22
};
23
#endif
24
25
#ifndef poly1305_get_params_st
26
struct poly1305_get_params_st {
27
    OSSL_PARAM *size;
28
};
29
#endif
30
31
#ifndef poly1305_get_params_decoder
32
static int poly1305_get_params_decoder
33
    (const OSSL_PARAM *p, struct poly1305_get_params_st *r)
34
0
{
35
0
    const char *s;
36
37
0
    memset(r, 0, sizeof(*r));
38
0
    if (p != NULL)
39
0
        for (; (s = p->key) != NULL; p++)
40
0
            if (ossl_likely(strcmp("size", s + 0) == 0)) {
41
                /* OSSL_MAC_PARAM_SIZE */
42
0
                if (ossl_unlikely(r->size != NULL)) {
43
0
                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
44
0
                                   "param %s is repeated", s);
45
0
                    return 0;
46
0
                }
47
0
                r->size = (OSSL_PARAM *)p;
48
0
            }
49
0
    return 1;
50
0
}
51
#endif
52
/* End of machine generated */
53
54
/* Machine generated by util/perl/OpenSSL/paramnames.pm */
55
#include <string.h>
56
#include <openssl/params.h>
57
#include "internal/common.h"
58
#include "prov/proverr.h"
59
60
#ifndef poly1305_set_ctx_params_list
61
static const OSSL_PARAM poly1305_set_ctx_params_list[] = {
62
    OSSL_PARAM_octet_string(OSSL_MAC_PARAM_KEY, NULL, 0),
63
    OSSL_PARAM_END
64
};
65
#endif
66
67
#ifndef poly1305_set_ctx_params_st
68
struct poly1305_set_ctx_params_st {
69
    OSSL_PARAM *key;
70
};
71
#endif
72
73
#ifndef poly1305_set_ctx_params_decoder
74
static int poly1305_set_ctx_params_decoder
75
    (const OSSL_PARAM *p, struct poly1305_set_ctx_params_st *r)
76
0
{
77
0
    const char *s;
78
79
0
    memset(r, 0, sizeof(*r));
80
0
    if (p != NULL)
81
0
        for (; (s = p->key) != NULL; p++)
82
0
            if (ossl_likely(strcmp("key", s + 0) == 0)) {
83
                /* OSSL_MAC_PARAM_KEY */
84
0
                if (ossl_unlikely(r->key != NULL)) {
85
0
                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
86
0
                                   "param %s is repeated", s);
87
0
                    return 0;
88
0
                }
89
0
                r->key = (OSSL_PARAM *)p;
90
0
            }
91
0
    return 1;
92
0
}
93
#endif
94
/* End of machine generated */