Coverage Report

Created: 2026-10-28 06:28

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl40/providers/implementations/include/prov/ciphercommon_aead.h
Line
Count
Source
1
/*
2
 * Copyright 2019-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
#ifndef OSSL_PROV_CIPHERCOMMON_AEAD_H
11
#define OSSL_PROV_CIPHERCOMMON_AEAD_H
12
#pragma once
13
14
9.45M
#define UNINITIALISED_SIZET ((size_t)-1)
15
16
#define AEAD_FLAGS (PROV_CIPHER_FLAG_AEAD | PROV_CIPHER_FLAG_CUSTOM_IV)
17
18
#define IMPLEMENT_aead_cipher(alg, lc, UCMODE, flags, kbits, blkbits, ivbits)   \
19
    static OSSL_FUNC_cipher_get_params_fn alg##_##kbits##_##lc##_get_params;    \
20
    static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])           \
21
1.54M
    {                                                                           \
22
1.54M
        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
23
1.54M
            flags, kbits, blkbits, ivbits);                                     \
24
1.54M
    }                                                                           \
cipher_aes_ccm.c:aes_128_ccm_get_params
Line
Count
Source
21
345k
    {                                                                           \
22
345k
        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
23
345k
            flags, kbits, blkbits, ivbits);                                     \
24
345k
    }                                                                           \
cipher_aes_ccm.c:aes_192_ccm_get_params
Line
Count
Source
21
85
    {                                                                           \
22
85
        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
23
85
            flags, kbits, blkbits, ivbits);                                     \
24
85
    }                                                                           \
cipher_aes_ccm.c:aes_256_ccm_get_params
Line
Count
Source
21
345k
    {                                                                           \
22
345k
        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
23
345k
            flags, kbits, blkbits, ivbits);                                     \
24
345k
    }                                                                           \
cipher_aes_gcm.c:aes_128_gcm_get_params
Line
Count
Source
21
172k
    {                                                                           \
22
172k
        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
23
172k
            flags, kbits, blkbits, ivbits);                                     \
24
172k
    }                                                                           \
cipher_aes_gcm.c:aes_192_gcm_get_params
Line
Count
Source
21
85
    {                                                                           \
22
85
        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
23
85
            flags, kbits, blkbits, ivbits);                                     \
24
85
    }                                                                           \
cipher_aes_gcm.c:aes_256_gcm_get_params
Line
Count
Source
21
172k
    {                                                                           \
22
172k
        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
23
172k
            flags, kbits, blkbits, ivbits);                                     \
24
172k
    }                                                                           \
cipher_aria_ccm.c:aria_128_ccm_get_params
Line
Count
Source
21
85
    {                                                                           \
22
85
        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
23
85
            flags, kbits, blkbits, ivbits);                                     \
24
85
    }                                                                           \
cipher_aria_ccm.c:aria_192_ccm_get_params
Line
Count
Source
21
85
    {                                                                           \
22
85
        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
23
85
            flags, kbits, blkbits, ivbits);                                     \
24
85
    }                                                                           \
cipher_aria_ccm.c:aria_256_ccm_get_params
Line
Count
Source
21
85
    {                                                                           \
22
85
        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
23
85
            flags, kbits, blkbits, ivbits);                                     \
24
85
    }                                                                           \
cipher_aria_gcm.c:aria_128_gcm_get_params
Line
Count
Source
21
172k
    {                                                                           \
22
172k
        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
23
172k
            flags, kbits, blkbits, ivbits);                                     \
24
172k
    }                                                                           \
cipher_aria_gcm.c:aria_192_gcm_get_params
Line
Count
Source
21
85
    {                                                                           \
22
85
        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
23
85
            flags, kbits, blkbits, ivbits);                                     \
24
85
    }                                                                           \
cipher_aria_gcm.c:aria_256_gcm_get_params
Line
Count
Source
21
172k
    {                                                                           \
22
172k
        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
23
172k
            flags, kbits, blkbits, ivbits);                                     \
24
172k
    }                                                                           \
cipher_sm4_ccm.c:sm4_128_ccm_get_params
Line
Count
Source
21
82.8k
    {                                                                           \
22
82.8k
        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
23
82.8k
            flags, kbits, blkbits, ivbits);                                     \
24
82.8k
    }                                                                           \
cipher_sm4_gcm.c:sm4_128_gcm_get_params
Line
Count
Source
21
82.8k
    {                                                                           \
22
82.8k
        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
23
82.8k
            flags, kbits, blkbits, ivbits);                                     \
24
82.8k
    }                                                                           \
25
    static OSSL_FUNC_cipher_newctx_fn alg##kbits##lc##_newctx;                  \
26
    static void *alg##kbits##lc##_newctx(void *provctx)                         \
27
1.01M
    {                                                                           \
28
1.01M
        return alg##_##lc##_newctx(provctx, kbits);                             \
29
1.01M
    }                                                                           \
cipher_aes_ccm.c:aes128ccm_newctx
Line
Count
Source
27
1.09k
    {                                                                           \
28
1.09k
        return alg##_##lc##_newctx(provctx, kbits);                             \
29
1.09k
    }                                                                           \
cipher_aes_ccm.c:aes192ccm_newctx
Line
Count
Source
27
11
    {                                                                           \
28
11
        return alg##_##lc##_newctx(provctx, kbits);                             \
29
11
    }                                                                           \
cipher_aes_ccm.c:aes256ccm_newctx
Line
Count
Source
27
1.30k
    {                                                                           \
28
1.30k
        return alg##_##lc##_newctx(provctx, kbits);                             \
29
1.30k
    }                                                                           \
cipher_aes_gcm.c:aes128gcm_newctx
Line
Count
Source
27
844k
    {                                                                           \
28
844k
        return alg##_##lc##_newctx(provctx, kbits);                             \
29
844k
    }                                                                           \
cipher_aes_gcm.c:aes192gcm_newctx
Line
Count
Source
27
9
    {                                                                           \
28
9
        return alg##_##lc##_newctx(provctx, kbits);                             \
29
9
    }                                                                           \
cipher_aes_gcm.c:aes256gcm_newctx
Line
Count
Source
27
167k
    {                                                                           \
28
167k
        return alg##_##lc##_newctx(provctx, kbits);                             \
29
167k
    }                                                                           \
cipher_aria_ccm.c:aria128ccm_newctx
Line
Count
Source
27
15
    {                                                                           \
28
15
        return alg##_##lc##_newctx(provctx, kbits);                             \
29
15
    }                                                                           \
cipher_aria_ccm.c:aria192ccm_newctx
Line
Count
Source
27
11
    {                                                                           \
28
11
        return alg##_##lc##_newctx(provctx, kbits);                             \
29
11
    }                                                                           \
cipher_aria_ccm.c:aria256ccm_newctx
Line
Count
Source
27
10
    {                                                                           \
28
10
        return alg##_##lc##_newctx(provctx, kbits);                             \
29
10
    }                                                                           \
cipher_aria_gcm.c:aria128gcm_newctx
Line
Count
Source
27
1.52k
    {                                                                           \
28
1.52k
        return alg##_##lc##_newctx(provctx, kbits);                             \
29
1.52k
    }                                                                           \
cipher_aria_gcm.c:aria192gcm_newctx
Line
Count
Source
27
12
    {                                                                           \
28
12
        return alg##_##lc##_newctx(provctx, kbits);                             \
29
12
    }                                                                           \
cipher_aria_gcm.c:aria256gcm_newctx
Line
Count
Source
27
1.27k
    {                                                                           \
28
1.27k
        return alg##_##lc##_newctx(provctx, kbits);                             \
29
1.27k
    }                                                                           \
cipher_sm4_ccm.c:sm4128ccm_newctx
Line
Count
Source
27
6
    {                                                                           \
28
6
        return alg##_##lc##_newctx(provctx, kbits);                             \
29
6
    }                                                                           \
cipher_sm4_gcm.c:sm4128gcm_newctx
Line
Count
Source
27
53
    {                                                                           \
28
53
        return alg##_##lc##_newctx(provctx, kbits);                             \
29
53
    }                                                                           \
30
    static void *alg##kbits##lc##_dupctx(void *src)                             \
31
0
    {                                                                           \
32
0
        return alg##_##lc##_dupctx(src);                                        \
33
0
    }                                                                           \
Unexecuted instantiation: cipher_aes_ccm.c:aes128ccm_dupctx
Unexecuted instantiation: cipher_aes_ccm.c:aes192ccm_dupctx
Unexecuted instantiation: cipher_aes_ccm.c:aes256ccm_dupctx
Unexecuted instantiation: cipher_aes_gcm.c:aes128gcm_dupctx
Unexecuted instantiation: cipher_aes_gcm.c:aes192gcm_dupctx
Unexecuted instantiation: cipher_aes_gcm.c:aes256gcm_dupctx
Unexecuted instantiation: cipher_aria_ccm.c:aria128ccm_dupctx
Unexecuted instantiation: cipher_aria_ccm.c:aria192ccm_dupctx
Unexecuted instantiation: cipher_aria_ccm.c:aria256ccm_dupctx
Unexecuted instantiation: cipher_aria_gcm.c:aria128gcm_dupctx
Unexecuted instantiation: cipher_aria_gcm.c:aria192gcm_dupctx
Unexecuted instantiation: cipher_aria_gcm.c:aria256gcm_dupctx
Unexecuted instantiation: cipher_sm4_ccm.c:sm4128ccm_dupctx
Unexecuted instantiation: cipher_sm4_gcm.c:sm4128gcm_dupctx
34
    const OSSL_DISPATCH ossl_##alg##kbits##lc##_functions[] = {                 \
35
        { OSSL_FUNC_CIPHER_NEWCTX, (void (*)(void))alg##kbits##lc##_newctx },   \
36
        { OSSL_FUNC_CIPHER_FREECTX, (void (*)(void))alg##_##lc##_freectx },     \
37
        { OSSL_FUNC_CIPHER_DUPCTX, (void (*)(void))alg##kbits##lc##_dupctx },   \
38
        { OSSL_FUNC_CIPHER_ENCRYPT_INIT, (void (*)(void))ossl_##lc##_einit },   \
39
        { OSSL_FUNC_CIPHER_DECRYPT_INIT, (void (*)(void))ossl_##lc##_dinit },   \
40
        { OSSL_FUNC_CIPHER_UPDATE, (void (*)(void))ossl_##lc##_stream_update }, \
41
        { OSSL_FUNC_CIPHER_FINAL, (void (*)(void))ossl_##lc##_stream_final },   \
42
        { OSSL_FUNC_CIPHER_CIPHER, (void (*)(void))ossl_##lc##_cipher },        \
43
        { OSSL_FUNC_CIPHER_GET_PARAMS,                                          \
44
            (void (*)(void))alg##_##kbits##_##lc##_get_params },                \
45
        { OSSL_FUNC_CIPHER_GET_CTX_PARAMS,                                      \
46
            (void (*)(void))ossl_##lc##_get_ctx_params },                       \
47
        { OSSL_FUNC_CIPHER_SET_CTX_PARAMS,                                      \
48
            (void (*)(void))ossl_##lc##_set_ctx_params },                       \
49
        { OSSL_FUNC_CIPHER_GETTABLE_PARAMS,                                     \
50
            (void (*)(void))ossl_cipher_generic_gettable_params },              \
51
        { OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS,                                 \
52
            (void (*)(void))ossl_##lc##_gettable_ctx_params },                  \
53
        { OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS,                                 \
54
            (void (*)(void))ossl_##lc##_settable_ctx_params },                  \
55
        OSSL_DISPATCH_END                                                       \
56
    }
57
58
#endif