Coverage Report

Created: 2025-12-04 06:33

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl36/include/crypto/sparse_array.h
Line
Count
Source
1
/*
2
 * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
3
 * Copyright (c) 2019, Oracle and/or its affiliates.  All rights reserved.
4
 *
5
 * Licensed under the Apache License 2.0 (the "License").  You may not use
6
 * this file except in compliance with the License.  You can obtain a copy
7
 * in the file LICENSE in the source distribution or at
8
 * https://www.openssl.org/source/license.html
9
 */
10
11
#ifndef OSSL_CRYPTO_SPARSE_ARRAY_H
12
# define OSSL_CRYPTO_SPARSE_ARRAY_H
13
# pragma once
14
15
# include <openssl/e_os2.h>
16
17
# ifdef __cplusplus
18
extern "C" {
19
# endif
20
21
171k
# define SPARSE_ARRAY_OF(type) struct sparse_array_st_ ## type
22
23
# define DEFINE_SPARSE_ARRAY_OF_INTERNAL(type, ctype) \
24
    SPARSE_ARRAY_OF(type); \
25
    static ossl_unused ossl_inline SPARSE_ARRAY_OF(type) * \
26
        ossl_sa_##type##_new(void) \
27
163k
    { \
28
163k
        return (SPARSE_ARRAY_OF(type) *)ossl_sa_new(); \
29
163k
    } \
threads_common.c:ossl_sa_CTX_TABLE_ENTRY_new
Line
Count
Source
27
172
    { \
28
172
        return (SPARSE_ARRAY_OF(type) *)ossl_sa_new(); \
29
172
    } \
property.c:ossl_sa_ALGORITHM_new
Line
Count
Source
27
1.73k
    { \
28
1.73k
        return (SPARSE_ARRAY_OF(type) *)ossl_sa_new(); \
29
1.73k
    } \
rsa_ossl.c:ossl_sa_BN_BLINDING_new
Line
Count
Source
27
161k
    { \
28
161k
        return (SPARSE_ARRAY_OF(type) *)ossl_sa_new(); \
29
161k
    } \
30
    static ossl_unused ossl_inline void \
31
    ossl_sa_##type##_free(SPARSE_ARRAY_OF(type) *sa) \
32
162k
    { \
33
162k
        ossl_sa_free((OPENSSL_SA *)sa); \
34
162k
    } \
threads_common.c:ossl_sa_CTX_TABLE_ENTRY_free
Line
Count
Source
32
172
    { \
33
172
        ossl_sa_free((OPENSSL_SA *)sa); \
34
172
    } \
property.c:ossl_sa_ALGORITHM_free
Line
Count
Source
32
1.14k
    { \
33
1.14k
        ossl_sa_free((OPENSSL_SA *)sa); \
34
1.14k
    } \
rsa_ossl.c:ossl_sa_BN_BLINDING_free
Line
Count
Source
32
161k
    { \
33
161k
        ossl_sa_free((OPENSSL_SA *)sa); \
34
161k
    } \
35
    static ossl_unused ossl_inline void \
36
    ossl_sa_##type##_free_leaves(SPARSE_ARRAY_OF(type) *sa) \
37
0
    { \
38
0
        ossl_sa_free_leaves((OPENSSL_SA *)sa); \
39
0
    } \
Unexecuted instantiation: threads_common.c:ossl_sa_CTX_TABLE_ENTRY_free_leaves
Unexecuted instantiation: property.c:ossl_sa_ALGORITHM_free_leaves
Unexecuted instantiation: rsa_ossl.c:ossl_sa_BN_BLINDING_free_leaves
40
    static ossl_unused ossl_inline size_t \
41
    ossl_sa_##type##_num(const SPARSE_ARRAY_OF(type) *sa) \
42
984k
    { \
43
984k
        return ossl_sa_num((OPENSSL_SA *)sa); \
44
984k
    } \
Unexecuted instantiation: threads_common.c:ossl_sa_CTX_TABLE_ENTRY_num
property.c:ossl_sa_ALGORITHM_num
Line
Count
Source
42
984k
    { \
43
984k
        return ossl_sa_num((OPENSSL_SA *)sa); \
44
984k
    } \
Unexecuted instantiation: rsa_ossl.c:ossl_sa_BN_BLINDING_num
45
    static ossl_unused ossl_inline void \
46
    ossl_sa_##type##_doall(const SPARSE_ARRAY_OF(type) *sa, \
47
                           void (*leaf)(ossl_uintmax_t, type *)) \
48
600
    { \
49
600
        ossl_sa_doall((OPENSSL_SA *)sa, \
50
600
                      (void (*)(ossl_uintmax_t, void *))leaf); \
51
600
    } \
Unexecuted instantiation: threads_common.c:ossl_sa_CTX_TABLE_ENTRY_doall
property.c:ossl_sa_ALGORITHM_doall
Line
Count
Source
48
600
    { \
49
600
        ossl_sa_doall((OPENSSL_SA *)sa, \
50
600
                      (void (*)(ossl_uintmax_t, void *))leaf); \
51
600
    } \
Unexecuted instantiation: rsa_ossl.c:ossl_sa_BN_BLINDING_doall
52
    static ossl_unused ossl_inline void \
53
    ossl_sa_##type##_doall_arg(const SPARSE_ARRAY_OF(type) *sa, \
54
                               void (*leaf)(ossl_uintmax_t, type *, void *), \
55
                               void *arg) \
56
1.14M
    { \
57
1.14M
        ossl_sa_doall_arg((OPENSSL_SA *)sa, \
58
1.14M
                          (void (*)(ossl_uintmax_t, void *, void *))leaf, arg); \
59
1.14M
    } \
Unexecuted instantiation: threads_common.c:ossl_sa_CTX_TABLE_ENTRY_doall_arg
property.c:ossl_sa_ALGORITHM_doall_arg
Line
Count
Source
56
985k
    { \
57
985k
        ossl_sa_doall_arg((OPENSSL_SA *)sa, \
58
985k
                          (void (*)(ossl_uintmax_t, void *, void *))leaf, arg); \
59
985k
    } \
rsa_ossl.c:ossl_sa_BN_BLINDING_doall_arg
Line
Count
Source
56
161k
    { \
57
161k
        ossl_sa_doall_arg((OPENSSL_SA *)sa, \
58
161k
                          (void (*)(ossl_uintmax_t, void *, void *))leaf, arg); \
59
161k
    } \
60
    static ossl_unused ossl_inline ctype \
61
    *ossl_sa_##type##_get(const SPARSE_ARRAY_OF(type) *sa, ossl_uintmax_t n) \
62
530M
    { \
63
530M
        return (type *)ossl_sa_get((OPENSSL_SA *)sa, n); \
64
530M
    } \
threads_common.c:ossl_sa_CTX_TABLE_ENTRY_get
Line
Count
Source
62
504M
    { \
63
504M
        return (type *)ossl_sa_get((OPENSSL_SA *)sa, n); \
64
504M
    } \
property.c:ossl_sa_ALGORITHM_get
Line
Count
Source
62
26.6M
    { \
63
26.6M
        return (type *)ossl_sa_get((OPENSSL_SA *)sa, n); \
64
26.6M
    } \
rsa_ossl.c:ossl_sa_BN_BLINDING_get
Line
Count
Source
62
4.81k
    { \
63
4.81k
        return (type *)ossl_sa_get((OPENSSL_SA *)sa, n); \
64
4.81k
    } \
65
    static ossl_unused ossl_inline int \
66
    ossl_sa_##type##_set(SPARSE_ARRAY_OF(type) *sa, \
67
                         ossl_uintmax_t n, ctype *val) \
68
44.1k
    { \
69
44.1k
        return ossl_sa_set((OPENSSL_SA *)sa, n, (void *)val); \
70
44.1k
    } \
threads_common.c:ossl_sa_CTX_TABLE_ENTRY_set
Line
Count
Source
68
649
    { \
69
649
        return ossl_sa_set((OPENSSL_SA *)sa, n, (void *)val); \
70
649
    } \
property.c:ossl_sa_ALGORITHM_set
Line
Count
Source
68
38.6k
    { \
69
38.6k
        return ossl_sa_set((OPENSSL_SA *)sa, n, (void *)val); \
70
38.6k
    } \
rsa_ossl.c:ossl_sa_BN_BLINDING_set
Line
Count
Source
68
4.81k
    { \
69
4.81k
        return ossl_sa_set((OPENSSL_SA *)sa, n, (void *)val); \
70
4.81k
    } \
71
    SPARSE_ARRAY_OF(type)
72
73
# define DEFINE_SPARSE_ARRAY_OF(type) \
74
    DEFINE_SPARSE_ARRAY_OF_INTERNAL(type, type)
75
# define DEFINE_SPARSE_ARRAY_OF_CONST(type) \
76
    DEFINE_SPARSE_ARRAY_OF_INTERNAL(type, const type)
77
78
typedef struct sparse_array_st OPENSSL_SA;
79
OPENSSL_SA *ossl_sa_new(void);
80
void ossl_sa_free(OPENSSL_SA *sa);
81
void ossl_sa_free_leaves(OPENSSL_SA *sa);
82
size_t ossl_sa_num(const OPENSSL_SA *sa);
83
void ossl_sa_doall(const OPENSSL_SA *sa, void (*leaf)(ossl_uintmax_t, void *));
84
void ossl_sa_doall_arg(const OPENSSL_SA *sa,
85
                       void (*leaf)(ossl_uintmax_t, void *, void *), void *);
86
void *ossl_sa_get(const OPENSSL_SA *sa, ossl_uintmax_t n);
87
int ossl_sa_set(OPENSSL_SA *sa, ossl_uintmax_t n, void *val);
88
89
# ifdef  __cplusplus
90
}
91
# endif
92
#endif