Coverage Report

Created: 2025-11-11 06:20

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl/providers/implementations/include/prov/digestcommon.h
Line
Count
Source
1
/*
2
 * Copyright 2019-2021 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
#ifndef OSSL_PROVIDERS_DIGESTCOMMON_H
11
# define OSSL_PROVIDERS_DIGESTCOMMON_H
12
13
# include <openssl/core_dispatch.h>
14
# include <openssl/core_names.h>
15
# include <openssl/params.h>
16
# include "prov/providercommon.h"
17
18
/* Internal flags that can be queried */
19
120
#define PROV_DIGEST_FLAG_XOF             0x0001
20
120
#define PROV_DIGEST_FLAG_ALGID_ABSENT    0x0002
21
22
# ifdef __cplusplus
23
extern "C" {
24
# endif
25
26
#define PROV_FUNC_DIGEST_GET_PARAM(name, blksize, dgstsize, flags)             \
27
static OSSL_FUNC_digest_get_params_fn name##_get_params;                       \
28
112
static int name##_get_params(OSSL_PARAM params[])                              \
29
112
{                                                                              \
30
112
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
112
}
md5_prov.c:md5_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
md5_sha1_prov.c:md5_sha1_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
null_prov.c:nullmd_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
ripemd_prov.c:ripemd160_get_params
Line
Count
Source
28
7
static int name##_get_params(OSSL_PARAM params[])                              \
29
7
{                                                                              \
30
7
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
7
}
sha2_prov.c:sha1_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
sha2_prov.c:sha224_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
sha2_prov.c:sha256_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
sha2_prov.c:sha256_192_internal_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
sha2_prov.c:sha384_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
sha2_prov.c:sha512_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
sha2_prov.c:sha512_224_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
sha2_prov.c:sha512_256_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
sha3_prov.c:sha3_224_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
sha3_prov.c:sha3_256_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
sha3_prov.c:sha3_384_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
sha3_prov.c:sha3_512_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
sha3_prov.c:keccak_224_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
sha3_prov.c:keccak_256_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
sha3_prov.c:keccak_384_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
sha3_prov.c:keccak_512_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
sha3_prov.c:shake_128_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
sha3_prov.c:shake_256_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
sha3_prov.c:keccak_kmac_128_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
sha3_prov.c:keccak_kmac_256_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
sm3_prov.c:sm3_get_params
Line
Count
Source
28
4
static int name##_get_params(OSSL_PARAM params[])                              \
29
4
{                                                                              \
30
4
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
4
}
md4_prov.c:md4_get_params
Line
Count
Source
28
3
static int name##_get_params(OSSL_PARAM params[])                              \
29
3
{                                                                              \
30
3
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
3
}
mdc2_prov.c:mdc2_get_params
Line
Count
Source
28
3
static int name##_get_params(OSSL_PARAM params[])                              \
29
3
{                                                                              \
30
3
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
3
}
wp_prov.c:wp_get_params
Line
Count
Source
28
3
static int name##_get_params(OSSL_PARAM params[])                              \
29
3
{                                                                              \
30
3
    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
31
3
}
32
33
#define PROV_DISPATCH_FUNC_DIGEST_GET_PARAMS(name)                             \
34
{ OSSL_FUNC_DIGEST_GET_PARAMS, (void (*)(void))name##_get_params },            \
35
{ OSSL_FUNC_DIGEST_GETTABLE_PARAMS,                                            \
36
  (void (*)(void))ossl_digest_default_gettable_params }
37
38
# define PROV_FUNC_DIGEST_FINAL(name, dgstsize, fin)                           \
39
static OSSL_FUNC_digest_final_fn name##_internal_final;                        \
40
static int name##_internal_final(void *ctx, unsigned char *out, size_t *outl,  \
41
18.1k
                                 size_t outsz)                                 \
42
18.1k
{                                                                              \
43
18.1k
    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
44
18.1k
        *outl = dgstsize;                                                      \
45
18.1k
        return 1;                                                              \
46
18.1k
    }                                                                          \
47
18.1k
    return 0;                                                                  \
48
18.1k
}
md5_prov.c:md5_internal_final
Line
Count
Source
41
83
                                 size_t outsz)                                 \
42
83
{                                                                              \
43
83
    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
44
83
        *outl = dgstsize;                                                      \
45
83
        return 1;                                                              \
46
83
    }                                                                          \
47
83
    return 0;                                                                  \
48
83
}
md5_sha1_prov.c:md5_sha1_internal_final
Line
Count
Source
41
30
                                 size_t outsz)                                 \
42
30
{                                                                              \
43
30
    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
44
30
        *outl = dgstsize;                                                      \
45
30
        return 1;                                                              \
46
30
    }                                                                          \
47
30
    return 0;                                                                  \
48
30
}
ripemd_prov.c:ripemd160_internal_final
Line
Count
Source
41
60
                                 size_t outsz)                                 \
42
60
{                                                                              \
43
60
    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
44
60
        *outl = dgstsize;                                                      \
45
60
        return 1;                                                              \
46
60
    }                                                                          \
47
60
    return 0;                                                                  \
48
60
}
sha2_prov.c:sha1_internal_final
Line
Count
Source
41
63
                                 size_t outsz)                                 \
42
63
{                                                                              \
43
63
    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
44
63
        *outl = dgstsize;                                                      \
45
63
        return 1;                                                              \
46
63
    }                                                                          \
47
63
    return 0;                                                                  \
48
63
}
sha2_prov.c:sha224_internal_final
Line
Count
Source
41
23
                                 size_t outsz)                                 \
42
23
{                                                                              \
43
23
    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
44
23
        *outl = dgstsize;                                                      \
45
23
        return 1;                                                              \
46
23
    }                                                                          \
47
23
    return 0;                                                                  \
48
23
}
sha2_prov.c:sha256_internal_final
Line
Count
Source
41
13.9k
                                 size_t outsz)                                 \
42
13.9k
{                                                                              \
43
13.9k
    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
44
13.9k
        *outl = dgstsize;                                                      \
45
13.9k
        return 1;                                                              \
46
13.9k
    }                                                                          \
47
13.9k
    return 0;                                                                  \
48
13.9k
}
Unexecuted instantiation: sha2_prov.c:sha256_192_internal_internal_final
sha2_prov.c:sha384_internal_final
Line
Count
Source
41
8
                                 size_t outsz)                                 \
42
8
{                                                                              \
43
8
    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
44
8
        *outl = dgstsize;                                                      \
45
8
        return 1;                                                              \
46
8
    }                                                                          \
47
8
    return 0;                                                                  \
48
8
}
sha2_prov.c:sha512_internal_final
Line
Count
Source
41
3.68k
                                 size_t outsz)                                 \
42
3.68k
{                                                                              \
43
3.68k
    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
44
3.68k
        *outl = dgstsize;                                                      \
45
3.68k
        return 1;                                                              \
46
3.68k
    }                                                                          \
47
3.68k
    return 0;                                                                  \
48
3.68k
}
sha2_prov.c:sha512_224_internal_final
Line
Count
Source
41
1
                                 size_t outsz)                                 \
42
1
{                                                                              \
43
1
    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
44
1
        *outl = dgstsize;                                                      \
45
1
        return 1;                                                              \
46
1
    }                                                                          \
47
1
    return 0;                                                                  \
48
1
}
sha2_prov.c:sha512_256_internal_final
Line
Count
Source
41
1
                                 size_t outsz)                                 \
42
1
{                                                                              \
43
1
    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
44
1
        *outl = dgstsize;                                                      \
45
1
        return 1;                                                              \
46
1
    }                                                                          \
47
1
    return 0;                                                                  \
48
1
}
sm3_prov.c:sm3_internal_final
Line
Count
Source
41
84
                                 size_t outsz)                                 \
42
84
{                                                                              \
43
84
    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
44
84
        *outl = dgstsize;                                                      \
45
84
        return 1;                                                              \
46
84
    }                                                                          \
47
84
    return 0;                                                                  \
48
84
}
md4_prov.c:md4_internal_final
Line
Count
Source
41
60
                                 size_t outsz)                                 \
42
60
{                                                                              \
43
60
    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
44
60
        *outl = dgstsize;                                                      \
45
60
        return 1;                                                              \
46
60
    }                                                                          \
47
60
    return 0;                                                                  \
48
60
}
mdc2_prov.c:mdc2_internal_final
Line
Count
Source
41
31
                                 size_t outsz)                                 \
42
31
{                                                                              \
43
31
    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
44
31
        *outl = dgstsize;                                                      \
45
31
        return 1;                                                              \
46
31
    }                                                                          \
47
31
    return 0;                                                                  \
48
31
}
Unexecuted instantiation: wp_prov.c:wp_internal_final
49
50
# define PROV_DISPATCH_FUNC_DIGEST_CONSTRUCT_START(                            \
51
    name, CTX, blksize, dgstsize, flags, upd, fin)                             \
52
static OSSL_FUNC_digest_newctx_fn name##_newctx;                               \
53
static OSSL_FUNC_digest_freectx_fn name##_freectx;                             \
54
static OSSL_FUNC_digest_dupctx_fn name##_dupctx;                               \
55
18.5k
static void *name##_newctx(void *prov_ctx)                                     \
56
18.5k
{                                                                              \
57
18.5k
    CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) : NULL;   \
58
18.5k
    return ctx;                                                                \
59
18.5k
}                                                                              \
60
18.5k
static void name##_freectx(void *vctx)                                         \
61
18.5k
{                                                                              \
62
18.5k
    CTX *ctx = (CTX *)vctx;                                                    \
63
18.5k
    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
64
18.5k
}                                                                              \
md5_prov.c:md5_freectx
Line
Count
Source
60
83
static void name##_freectx(void *vctx)                                         \
61
83
{                                                                              \
62
83
    CTX *ctx = (CTX *)vctx;                                                    \
63
83
    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
64
83
}                                                                              \
md5_sha1_prov.c:md5_sha1_freectx
Line
Count
Source
60
30
static void name##_freectx(void *vctx)                                         \
61
30
{                                                                              \
62
30
    CTX *ctx = (CTX *)vctx;                                                    \
63
30
    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
64
30
}                                                                              \
Unexecuted instantiation: null_prov.c:nullmd_freectx
ripemd_prov.c:ripemd160_freectx
Line
Count
Source
60
60
static void name##_freectx(void *vctx)                                         \
61
60
{                                                                              \
62
60
    CTX *ctx = (CTX *)vctx;                                                    \
63
60
    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
64
60
}                                                                              \
sha2_prov.c:sha1_freectx
Line
Count
Source
60
63
static void name##_freectx(void *vctx)                                         \
61
63
{                                                                              \
62
63
    CTX *ctx = (CTX *)vctx;                                                    \
63
63
    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
64
63
}                                                                              \
sha2_prov.c:sha224_freectx
Line
Count
Source
60
23
static void name##_freectx(void *vctx)                                         \
61
23
{                                                                              \
62
23
    CTX *ctx = (CTX *)vctx;                                                    \
63
23
    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
64
23
}                                                                              \
sha2_prov.c:sha256_freectx
Line
Count
Source
60
14.3k
static void name##_freectx(void *vctx)                                         \
61
14.3k
{                                                                              \
62
14.3k
    CTX *ctx = (CTX *)vctx;                                                    \
63
14.3k
    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
64
14.3k
}                                                                              \
Unexecuted instantiation: sha2_prov.c:sha256_192_internal_freectx
sha2_prov.c:sha384_freectx
Line
Count
Source
60
8
static void name##_freectx(void *vctx)                                         \
61
8
{                                                                              \
62
8
    CTX *ctx = (CTX *)vctx;                                                    \
63
8
    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
64
8
}                                                                              \
sha2_prov.c:sha512_freectx
Line
Count
Source
60
3.68k
static void name##_freectx(void *vctx)                                         \
61
3.68k
{                                                                              \
62
3.68k
    CTX *ctx = (CTX *)vctx;                                                    \
63
3.68k
    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
64
3.68k
}                                                                              \
sha2_prov.c:sha512_224_freectx
Line
Count
Source
60
1
static void name##_freectx(void *vctx)                                         \
61
1
{                                                                              \
62
1
    CTX *ctx = (CTX *)vctx;                                                    \
63
1
    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
64
1
}                                                                              \
sha2_prov.c:sha512_256_freectx
Line
Count
Source
60
1
static void name##_freectx(void *vctx)                                         \
61
1
{                                                                              \
62
1
    CTX *ctx = (CTX *)vctx;                                                    \
63
1
    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
64
1
}                                                                              \
sm3_prov.c:sm3_freectx
Line
Count
Source
60
84
static void name##_freectx(void *vctx)                                         \
61
84
{                                                                              \
62
84
    CTX *ctx = (CTX *)vctx;                                                    \
63
84
    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
64
84
}                                                                              \
md4_prov.c:md4_freectx
Line
Count
Source
60
60
static void name##_freectx(void *vctx)                                         \
61
60
{                                                                              \
62
60
    CTX *ctx = (CTX *)vctx;                                                    \
63
60
    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
64
60
}                                                                              \
mdc2_prov.c:mdc2_freectx
Line
Count
Source
60
31
static void name##_freectx(void *vctx)                                         \
61
31
{                                                                              \
62
31
    CTX *ctx = (CTX *)vctx;                                                    \
63
31
    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
64
31
}                                                                              \
Unexecuted instantiation: wp_prov.c:wp_freectx
65
0
static void *name##_dupctx(void *ctx)                                          \
66
0
{                                                                              \
67
0
    CTX *in = (CTX *)ctx;                                                      \
68
0
    CTX *ret = ossl_prov_is_running() ? OPENSSL_malloc(sizeof(*ret)) : NULL;   \
69
0
    if (ret != NULL)                                                           \
70
0
        *ret = *in;                                                            \
71
0
    return ret;                                                                \
72
0
}                                                                              \
73
0
static void name##_copyctx(void *voutctx, void *vinctx)                        \
74
0
{                                                                              \
75
0
    CTX *outctx = (CTX *)voutctx;                                              \
76
0
    CTX *inctx = (CTX *)vinctx;                                                \
77
0
    *outctx = *inctx;                                                          \
78
0
}                                                                              \
Unexecuted instantiation: md5_prov.c:md5_copyctx
Unexecuted instantiation: md5_sha1_prov.c:md5_sha1_copyctx
Unexecuted instantiation: null_prov.c:nullmd_copyctx
Unexecuted instantiation: ripemd_prov.c:ripemd160_copyctx
Unexecuted instantiation: sha2_prov.c:sha1_copyctx
Unexecuted instantiation: sha2_prov.c:sha224_copyctx
Unexecuted instantiation: sha2_prov.c:sha256_copyctx
Unexecuted instantiation: sha2_prov.c:sha256_192_internal_copyctx
Unexecuted instantiation: sha2_prov.c:sha384_copyctx
Unexecuted instantiation: sha2_prov.c:sha512_copyctx
Unexecuted instantiation: sha2_prov.c:sha512_224_copyctx
Unexecuted instantiation: sha2_prov.c:sha512_256_copyctx
Unexecuted instantiation: sm3_prov.c:sm3_copyctx
Unexecuted instantiation: md4_prov.c:md4_copyctx
Unexecuted instantiation: mdc2_prov.c:mdc2_copyctx
Unexecuted instantiation: wp_prov.c:wp_copyctx
79
PROV_FUNC_DIGEST_FINAL(name, dgstsize, fin)                                    \
80
PROV_FUNC_DIGEST_GET_PARAM(name, blksize, dgstsize, flags)                     \
81
const OSSL_DISPATCH ossl_##name##_functions[] = {                              \
82
    { OSSL_FUNC_DIGEST_NEWCTX, (void (*)(void))name##_newctx },                \
83
    { OSSL_FUNC_DIGEST_UPDATE, (void (*)(void))upd },                          \
84
    { OSSL_FUNC_DIGEST_FINAL, (void (*)(void))name##_internal_final },         \
85
    { OSSL_FUNC_DIGEST_FREECTX, (void (*)(void))name##_freectx },              \
86
    { OSSL_FUNC_DIGEST_DUPCTX, (void (*)(void))name##_dupctx },                \
87
    { OSSL_FUNC_DIGEST_COPYCTX, (void (*)(void))name##_copyctx },              \
88
    PROV_DISPATCH_FUNC_DIGEST_GET_PARAMS(name)
89
90
# define PROV_DISPATCH_FUNC_DIGEST_CONSTRUCT_END                               \
91
    { 0, NULL }                                                                \
92
};
93
94
# define IMPLEMENT_digest_functions(                                           \
95
    name, CTX, blksize, dgstsize, flags, init, upd, fin)                       \
96
static OSSL_FUNC_digest_init_fn name##_internal_init;                          \
97
static int name##_internal_init(void *ctx,                                     \
98
36.3k
                                ossl_unused const OSSL_PARAM params[])         \
99
36.3k
{                                                                              \
100
36.3k
    return ossl_prov_is_running() && init(ctx);                                \
101
36.3k
}                                                                              \
md5_prov.c:md5_internal_init
Line
Count
Source
98
166
                                ossl_unused const OSSL_PARAM params[])         \
99
166
{                                                                              \
100
166
    return ossl_prov_is_running() && init(ctx);                                \
101
166
}                                                                              \
Unexecuted instantiation: null_prov.c:nullmd_internal_init
ripemd_prov.c:ripemd160_internal_init
Line
Count
Source
98
120
                                ossl_unused const OSSL_PARAM params[])         \
99
120
{                                                                              \
100
120
    return ossl_prov_is_running() && init(ctx);                                \
101
120
}                                                                              \
sha2_prov.c:sha224_internal_init
Line
Count
Source
98
46
                                ossl_unused const OSSL_PARAM params[])         \
99
46
{                                                                              \
100
46
    return ossl_prov_is_running() && init(ctx);                                \
101
46
}                                                                              \
sha2_prov.c:sha256_internal_init
Line
Count
Source
98
28.3k
                                ossl_unused const OSSL_PARAM params[])         \
99
28.3k
{                                                                              \
100
28.3k
    return ossl_prov_is_running() && init(ctx);                                \
101
28.3k
}                                                                              \
Unexecuted instantiation: sha2_prov.c:sha256_192_internal_internal_init
sha2_prov.c:sha384_internal_init
Line
Count
Source
98
16
                                ossl_unused const OSSL_PARAM params[])         \
99
16
{                                                                              \
100
16
    return ossl_prov_is_running() && init(ctx);                                \
101
16
}                                                                              \
sha2_prov.c:sha512_internal_init
Line
Count
Source
98
7.37k
                                ossl_unused const OSSL_PARAM params[])         \
99
7.37k
{                                                                              \
100
7.37k
    return ossl_prov_is_running() && init(ctx);                                \
101
7.37k
}                                                                              \
sha2_prov.c:sha512_224_internal_init
Line
Count
Source
98
2
                                ossl_unused const OSSL_PARAM params[])         \
99
2
{                                                                              \
100
2
    return ossl_prov_is_running() && init(ctx);                                \
101
2
}                                                                              \
sha2_prov.c:sha512_256_internal_init
Line
Count
Source
98
2
                                ossl_unused const OSSL_PARAM params[])         \
99
2
{                                                                              \
100
2
    return ossl_prov_is_running() && init(ctx);                                \
101
2
}                                                                              \
sm3_prov.c:sm3_internal_init
Line
Count
Source
98
168
                                ossl_unused const OSSL_PARAM params[])         \
99
168
{                                                                              \
100
168
    return ossl_prov_is_running() && init(ctx);                                \
101
168
}                                                                              \
md4_prov.c:md4_internal_init
Line
Count
Source
98
120
                                ossl_unused const OSSL_PARAM params[])         \
99
120
{                                                                              \
100
120
    return ossl_prov_is_running() && init(ctx);                                \
101
120
}                                                                              \
Unexecuted instantiation: wp_prov.c:wp_internal_init
102
PROV_DISPATCH_FUNC_DIGEST_CONSTRUCT_START(name, CTX, blksize, dgstsize, flags, \
103
                                          upd, fin),                           \
104
    { OSSL_FUNC_DIGEST_INIT, (void (*)(void))name##_internal_init },           \
105
PROV_DISPATCH_FUNC_DIGEST_CONSTRUCT_END
106
107
# define IMPLEMENT_digest_functions_with_settable_ctx(                         \
108
    name, CTX, blksize, dgstsize, flags, init, upd, fin,                       \
109
    settable_ctx_params, set_ctx_params)                                       \
110
static OSSL_FUNC_digest_init_fn name##_internal_init;                          \
111
248
static int name##_internal_init(void *ctx, const OSSL_PARAM params[])          \
112
248
{                                                                              \
113
248
    return ossl_prov_is_running()                                              \
114
248
           && init(ctx)                                                        \
115
248
           && set_ctx_params(ctx, params);                                     \
116
248
}                                                                              \
md5_sha1_prov.c:md5_sha1_internal_init
Line
Count
Source
111
60
static int name##_internal_init(void *ctx, const OSSL_PARAM params[])          \
112
60
{                                                                              \
113
60
    return ossl_prov_is_running()                                              \
114
60
           && init(ctx)                                                        \
115
60
           && set_ctx_params(ctx, params);                                     \
116
60
}                                                                              \
sha2_prov.c:sha1_internal_init
Line
Count
Source
111
126
static int name##_internal_init(void *ctx, const OSSL_PARAM params[])          \
112
126
{                                                                              \
113
126
    return ossl_prov_is_running()                                              \
114
126
           && init(ctx)                                                        \
115
126
           && set_ctx_params(ctx, params);                                     \
116
126
}                                                                              \
mdc2_prov.c:mdc2_internal_init
Line
Count
Source
111
62
static int name##_internal_init(void *ctx, const OSSL_PARAM params[])          \
112
62
{                                                                              \
113
62
    return ossl_prov_is_running()                                              \
114
62
           && init(ctx)                                                        \
115
62
           && set_ctx_params(ctx, params);                                     \
116
62
}                                                                              \
117
PROV_DISPATCH_FUNC_DIGEST_CONSTRUCT_START(name, CTX, blksize, dgstsize, flags, \
118
                                          upd, fin),                           \
119
    { OSSL_FUNC_DIGEST_INIT, (void (*)(void))name##_internal_init },           \
120
    { OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS, (void (*)(void))settable_ctx_params }, \
121
    { OSSL_FUNC_DIGEST_SET_CTX_PARAMS, (void (*)(void))set_ctx_params },       \
122
PROV_DISPATCH_FUNC_DIGEST_CONSTRUCT_END
123
124
125
const OSSL_PARAM *ossl_digest_default_gettable_params(void *provctx);
126
int ossl_digest_default_get_params(OSSL_PARAM params[], size_t blksz,
127
                                   size_t paramsz, unsigned long flags);
128
129
# ifdef __cplusplus
130
}
131
# endif
132
133
#endif /* OSSL_PROVIDERS_DIGESTCOMMON_H */