Coverage Report

Created: 2026-08-08 07:14

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/boringssl/crypto/fipsmodule/delocate.h
Line
Count
Source
1
// Copyright 2017 The BoringSSL Authors
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
//     https://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#ifndef OPENSSL_HEADER_CRYPTO_FIPSMODULE_DELOCATE_H
16
#define OPENSSL_HEADER_CRYPTO_FIPSMODULE_DELOCATE_H
17
18
#include <openssl/base.h>
19
20
#include "../internal.h"
21
22
23
#if defined(BORINGSSL_PREFIX)
24
#define BCM_ADD_PREFIX(name) BORINGSSL_ADD_PREFIX(bcm_##name)
25
#else
26
#define BCM_ADD_PREFIX(name) bcm_##name
27
#endif
28
29
#if !defined(BORINGSSL_SHARED_LIBRARY) && defined(BORINGSSL_FIPS) && \
30
    !defined(OPENSSL_ASAN) && !defined(OPENSSL_MSAN)
31
#define DEFINE_BSS_GET(type, name, init_expr)                                  \
32
  /* delocate needs C linkage and for `name` to be unique across BCM. */       \
33
  extern "C" {                                                                 \
34
  extern type BCM_ADD_PREFIX(name);                                            \
35
  type BCM_ADD_PREFIX(name) init_expr;                                         \
36
  type *BCM_ADD_PREFIX(name##_bss_get)() __attribute__((const));               \
37
  } /* extern "C" */                                                           \
38
                                                                               \
39
  /* The getter functions are exported, but static variables are usually named \
40
   * with short names. Define a static wrapper function so the caller can use  \
41
   * a short name, while the symbol itself is prefixed. */                     \
42
  static type *name##_bss_get() { return BCM_ADD_PREFIX(name##_bss_get)(); }
43
#else
44
#define DEFINE_BSS_GET(type, name, init_expr) \
45
  static type name init_expr;                 \
46
2.19M
  static type *name##_bss_get() { return &name; }
bcm.cc:BN_value_one_once_bss_get()
Line
Count
Source
46
754
  static type *name##_bss_get() { return &name; }
bcm.cc:BN_value_one_storage_bss_get()
Line
Count
Source
46
771
  static type *name##_bss_get() { return &name; }
bcm.cc:EVP_aes_128_cbc_once_bss_get()
Line
Count
Source
46
5.02k
  static type *name##_bss_get() { return &name; }
bcm.cc:EVP_aes_128_cbc_storage_bss_get()
Line
Count
Source
46
5.02k
  static type *name##_bss_get() { return &name; }
Unexecuted instantiation: bcm.cc:EVP_aes_128_ctr_once_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aes_128_ctr_storage_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aes_128_ofb_once_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aes_128_ofb_storage_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aes_128_gcm_once_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aes_128_gcm_storage_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aes_192_cbc_once_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aes_192_cbc_storage_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aes_192_ctr_once_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aes_192_ctr_storage_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aes_192_ofb_once_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aes_192_ofb_storage_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aes_192_gcm_once_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aes_192_gcm_storage_bss_get()
bcm.cc:EVP_aes_256_cbc_once_bss_get()
Line
Count
Source
46
23.5k
  static type *name##_bss_get() { return &name; }
bcm.cc:EVP_aes_256_cbc_storage_bss_get()
Line
Count
Source
46
23.5k
  static type *name##_bss_get() { return &name; }
Unexecuted instantiation: bcm.cc:EVP_aes_256_ctr_once_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aes_256_ctr_storage_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aes_256_ofb_once_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aes_256_ofb_storage_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aes_256_gcm_once_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aes_256_gcm_storage_bss_get()
Unexecuted instantiation: bcm.cc:aes_hw_128_ecb_once_bss_get()
Unexecuted instantiation: bcm.cc:aes_hw_128_ecb_storage_bss_get()
Unexecuted instantiation: bcm.cc:aes_128_ecb_generic_once_bss_get()
Unexecuted instantiation: bcm.cc:aes_128_ecb_generic_storage_bss_get()
Unexecuted instantiation: bcm.cc:aes_hw_192_ecb_once_bss_get()
Unexecuted instantiation: bcm.cc:aes_hw_192_ecb_storage_bss_get()
Unexecuted instantiation: bcm.cc:aes_192_ecb_generic_once_bss_get()
Unexecuted instantiation: bcm.cc:aes_192_ecb_generic_storage_bss_get()
Unexecuted instantiation: bcm.cc:aes_hw_256_ecb_once_bss_get()
Unexecuted instantiation: bcm.cc:aes_hw_256_ecb_storage_bss_get()
Unexecuted instantiation: bcm.cc:aes_256_ecb_generic_once_bss_get()
Unexecuted instantiation: bcm.cc:aes_256_ecb_generic_storage_bss_get()
bcm.cc:EVP_aead_aes_128_gcm_once_bss_get()
Line
Count
Source
46
245
  static type *name##_bss_get() { return &name; }
bcm.cc:EVP_aead_aes_128_gcm_storage_bss_get()
Line
Count
Source
46
248
  static type *name##_bss_get() { return &name; }
Unexecuted instantiation: bcm.cc:EVP_aead_aes_192_gcm_once_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aead_aes_192_gcm_storage_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aead_aes_256_gcm_once_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aead_aes_256_gcm_storage_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aead_aes_128_gcm_randnonce_once_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aead_aes_128_gcm_randnonce_storage_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aead_aes_256_gcm_randnonce_once_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aead_aes_256_gcm_randnonce_storage_bss_get()
bcm.cc:EVP_aead_aes_128_gcm_tls12_once_bss_get()
Line
Count
Source
46
65.6k
  static type *name##_bss_get() { return &name; }
bcm.cc:EVP_aead_aes_128_gcm_tls12_storage_bss_get()
Line
Count
Source
46
65.6k
  static type *name##_bss_get() { return &name; }
bcm.cc:EVP_aead_aes_256_gcm_tls12_once_bss_get()
Line
Count
Source
46
32.5k
  static type *name##_bss_get() { return &name; }
bcm.cc:EVP_aead_aes_256_gcm_tls12_storage_bss_get()
Line
Count
Source
46
32.5k
  static type *name##_bss_get() { return &name; }
bcm.cc:EVP_aead_aes_128_gcm_tls13_once_bss_get()
Line
Count
Source
46
44.1k
  static type *name##_bss_get() { return &name; }
bcm.cc:EVP_aead_aes_128_gcm_tls13_storage_bss_get()
Line
Count
Source
46
44.1k
  static type *name##_bss_get() { return &name; }
bcm.cc:EVP_aead_aes_256_gcm_tls13_once_bss_get()
Line
Count
Source
46
33.5k
  static type *name##_bss_get() { return &name; }
bcm.cc:EVP_aead_aes_256_gcm_tls13_storage_bss_get()
Line
Count
Source
46
33.5k
  static type *name##_bss_get() { return &name; }
Unexecuted instantiation: bcm.cc:EVP_aead_aes_128_ccm_bluetooth_once_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aead_aes_128_ccm_bluetooth_storage_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aead_aes_128_ccm_bluetooth_8_once_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aead_aes_128_ccm_bluetooth_8_storage_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aead_aes_128_ccm_matter_once_bss_get()
Unexecuted instantiation: bcm.cc:EVP_aead_aes_128_ccm_matter_storage_bss_get()
bcm.cc:EVP_sha1_once_bss_get()
Line
Count
Source
46
46.1k
  static type *name##_bss_get() { return &name; }
bcm.cc:EVP_sha1_storage_bss_get()
Line
Count
Source
46
46.1k
  static type *name##_bss_get() { return &name; }
bcm.cc:EVP_sha224_once_bss_get()
Line
Count
Source
46
45
  static type *name##_bss_get() { return &name; }
bcm.cc:EVP_sha224_storage_bss_get()
Line
Count
Source
46
49
  static type *name##_bss_get() { return &name; }
bcm.cc:EVP_sha256_once_bss_get()
Line
Count
Source
46
248k
  static type *name##_bss_get() { return &name; }
bcm.cc:EVP_sha256_storage_bss_get()
Line
Count
Source
46
248k
  static type *name##_bss_get() { return &name; }
bcm.cc:EVP_sha384_once_bss_get()
Line
Count
Source
46
124k
  static type *name##_bss_get() { return &name; }
bcm.cc:EVP_sha384_storage_bss_get()
Line
Count
Source
46
124k
  static type *name##_bss_get() { return &name; }
bcm.cc:EVP_sha512_once_bss_get()
Line
Count
Source
46
14.6k
  static type *name##_bss_get() { return &name; }
bcm.cc:EVP_sha512_storage_bss_get()
Line
Count
Source
46
14.7k
  static type *name##_bss_get() { return &name; }
Unexecuted instantiation: bcm.cc:EVP_sha512_256_once_bss_get()
Unexecuted instantiation: bcm.cc:EVP_sha512_256_storage_bss_get()
bcm.cc:md_pctx_ops_once_bss_get()
Line
Count
Source
46
62.0k
  static type *name##_bss_get() { return &name; }
bcm.cc:md_pctx_ops_storage_bss_get()
Line
Count
Source
46
62.0k
  static type *name##_bss_get() { return &name; }
bcm.cc:EC_group_p224_once_bss_get()
Line
Count
Source
46
63.0k
  static type *name##_bss_get() { return &name; }
bcm.cc:EC_group_p224_storage_bss_get()
Line
Count
Source
46
63.0k
  static type *name##_bss_get() { return &name; }
bcm.cc:EC_group_p256_once_bss_get()
Line
Count
Source
46
66.9k
  static type *name##_bss_get() { return &name; }
bcm.cc:EC_group_p256_storage_bss_get()
Line
Count
Source
46
67.0k
  static type *name##_bss_get() { return &name; }
bcm.cc:EC_group_p384_once_bss_get()
Line
Count
Source
46
25.0k
  static type *name##_bss_get() { return &name; }
bcm.cc:EC_group_p384_storage_bss_get()
Line
Count
Source
46
25.1k
  static type *name##_bss_get() { return &name; }
bcm.cc:EC_group_p521_once_bss_get()
Line
Count
Source
46
8.85k
  static type *name##_bss_get() { return &name; }
bcm.cc:EC_group_p521_storage_bss_get()
Line
Count
Source
46
8.87k
  static type *name##_bss_get() { return &name; }
bcm.cc:g_ec_ex_data_class_bss_get()
Line
Count
Source
46
60.7k
  static type *name##_bss_get() { return &name; }
bcm.cc:bssl::EC_GFp_mont_method_once_bss_get()
Line
Count
Source
46
45
  static type *name##_bss_get() { return &name; }
bcm.cc:bssl::EC_GFp_mont_method_storage_bss_get()
Line
Count
Source
46
64
  static type *name##_bss_get() { return &name; }
bcm.cc:bssl::EC_GFp_nistz256_method_once_bss_get()
Line
Count
Source
46
19
  static type *name##_bss_get() { return &name; }
bcm.cc:bssl::EC_GFp_nistz256_method_storage_bss_get()
Line
Count
Source
46
38
  static type *name##_bss_get() { return &name; }
Unexecuted instantiation: bcm.cc:bssl::EC_GFp_nistp256_method_once_bss_get()
Unexecuted instantiation: bcm.cc:bssl::EC_GFp_nistp256_method_storage_bss_get()
bcm.cc:g_rsa_ex_data_class_bss_get()
Line
Count
Source
46
134k
  static type *name##_bss_get() { return &name; }
Unexecuted instantiation: bcm.cc:g_small_factors_once_bss_get()
Unexecuted instantiation: bcm.cc:g_small_factors_storage_bss_get()
bcm.cc:bssl::RSA_default_method_once_bss_get()
Line
Count
Source
46
134k
  static type *name##_bss_get() { return &name; }
bcm.cc:bssl::RSA_default_method_storage_bss_get()
Line
Count
Source
46
134k
  static type *name##_bss_get() { return &name; }
47
#endif
48
49
// For FIPS builds we require each of these objects be all zero.
50
#define DEFINE_STATIC_ONCE(name) \
51
  DEFINE_BSS_GET(bssl::CRYPTO_once_t, name, = CRYPTO_ONCE_INIT)
52
#define DEFINE_STATIC_MUTEX(name) \
53
  DEFINE_BSS_GET(bssl::StaticMutex, name, /* default ctor */)
54
#define DEFINE_STATIC_EX_DATA_CLASS(name) \
55
  DEFINE_BSS_GET(bssl::ExDataClass, name, /* default ctor */)
56
57
#define DEFINE_DATA(type, name, accessor_decorations)                     \
58
  DEFINE_BSS_GET(type, name##_storage, {})                                \
59
  DEFINE_STATIC_ONCE(name##_once)                                         \
60
  static void name##_do_init(type *out);                                  \
61
232
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
bcm.cc:BN_value_one_init()
Line
Count
Source
61
17
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
bcm.cc:EVP_aes_128_cbc_init()
Line
Count
Source
61
7
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
Unexecuted instantiation: bcm.cc:EVP_aes_128_ctr_init()
Unexecuted instantiation: bcm.cc:EVP_aes_128_ofb_init()
Unexecuted instantiation: bcm.cc:EVP_aes_128_gcm_init()
Unexecuted instantiation: bcm.cc:EVP_aes_192_cbc_init()
Unexecuted instantiation: bcm.cc:EVP_aes_192_ctr_init()
Unexecuted instantiation: bcm.cc:EVP_aes_192_ofb_init()
Unexecuted instantiation: bcm.cc:EVP_aes_192_gcm_init()
bcm.cc:EVP_aes_256_cbc_init()
Line
Count
Source
61
6
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
Unexecuted instantiation: bcm.cc:EVP_aes_256_ctr_init()
Unexecuted instantiation: bcm.cc:EVP_aes_256_ofb_init()
Unexecuted instantiation: bcm.cc:EVP_aes_256_gcm_init()
Unexecuted instantiation: bcm.cc:aes_hw_128_ecb_init()
Unexecuted instantiation: bcm.cc:aes_128_ecb_generic_init()
Unexecuted instantiation: bcm.cc:aes_hw_192_ecb_init()
Unexecuted instantiation: bcm.cc:aes_192_ecb_generic_init()
Unexecuted instantiation: bcm.cc:aes_hw_256_ecb_init()
Unexecuted instantiation: bcm.cc:aes_256_ecb_generic_init()
bcm.cc:EVP_aead_aes_128_gcm_init()
Line
Count
Source
61
3
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
Unexecuted instantiation: bcm.cc:EVP_aead_aes_192_gcm_init()
Unexecuted instantiation: bcm.cc:EVP_aead_aes_256_gcm_init()
Unexecuted instantiation: bcm.cc:EVP_aead_aes_128_gcm_randnonce_init()
Unexecuted instantiation: bcm.cc:EVP_aead_aes_256_gcm_randnonce_init()
bcm.cc:EVP_aead_aes_128_gcm_tls12_init()
Line
Count
Source
61
6
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
bcm.cc:EVP_aead_aes_256_gcm_tls12_init()
Line
Count
Source
61
6
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
bcm.cc:EVP_aead_aes_128_gcm_tls13_init()
Line
Count
Source
61
6
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
bcm.cc:EVP_aead_aes_256_gcm_tls13_init()
Line
Count
Source
61
6
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
Unexecuted instantiation: bcm.cc:EVP_aead_aes_128_ccm_bluetooth_init()
Unexecuted instantiation: bcm.cc:EVP_aead_aes_128_ccm_bluetooth_8_init()
Unexecuted instantiation: bcm.cc:EVP_aead_aes_128_ccm_matter_init()
bcm.cc:EVP_sha1_init()
Line
Count
Source
61
10
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
bcm.cc:EVP_sha224_init()
Line
Count
Source
61
4
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
bcm.cc:EVP_sha256_init()
Line
Count
Source
61
11
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
bcm.cc:EVP_sha384_init()
Line
Count
Source
61
10
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
bcm.cc:EVP_sha512_init()
Line
Count
Source
61
10
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
Unexecuted instantiation: bcm.cc:EVP_sha512_256_init()
bcm.cc:md_pctx_ops_init()
Line
Count
Source
61
6
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
bcm.cc:EC_group_p224_init()
Line
Count
Source
61
19
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
bcm.cc:EC_group_p256_init()
Line
Count
Source
61
19
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
bcm.cc:EC_group_p384_init()
Line
Count
Source
61
13
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
bcm.cc:EC_group_p521_init()
Line
Count
Source
61
13
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
bcm.cc:bssl::EC_GFp_mont_method_init()
Line
Count
Source
61
19
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
bcm.cc:bssl::EC_GFp_nistz256_method_init()
Line
Count
Source
61
19
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
Unexecuted instantiation: bcm.cc:bssl::EC_GFp_nistp256_method_init()
Unexecuted instantiation: bcm.cc:g_small_factors_init()
bcm.cc:bssl::RSA_default_method_init()
Line
Count
Source
61
22
  static void name##_init() { name##_do_init(name##_storage_bss_get()); } \
62
999k
  accessor_decorations type *name() {                                     \
63
999k
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
999k
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
999k
     * cast is needed. */                                                 \
66
999k
    return (const type *)name##_storage_bss_get();                        \
67
999k
  }                                                                       \
BN_value_one
Line
Count
Source
62
754
  accessor_decorations type *name() {                                     \
63
754
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
754
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
754
     * cast is needed. */                                                 \
66
754
    return (const type *)name##_storage_bss_get();                        \
67
754
  }                                                                       \
EVP_aes_128_cbc
Line
Count
Source
62
5.02k
  accessor_decorations type *name() {                                     \
63
5.02k
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
5.02k
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
5.02k
     * cast is needed. */                                                 \
66
5.02k
    return (const type *)name##_storage_bss_get();                        \
67
5.02k
  }                                                                       \
Unexecuted instantiation: EVP_aes_128_ctr
Unexecuted instantiation: EVP_aes_128_ofb
Unexecuted instantiation: EVP_aes_128_gcm
Unexecuted instantiation: EVP_aes_192_cbc
Unexecuted instantiation: EVP_aes_192_ctr
Unexecuted instantiation: EVP_aes_192_ofb
Unexecuted instantiation: EVP_aes_192_gcm
EVP_aes_256_cbc
Line
Count
Source
62
23.5k
  accessor_decorations type *name() {                                     \
63
23.5k
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
23.5k
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
23.5k
     * cast is needed. */                                                 \
66
23.5k
    return (const type *)name##_storage_bss_get();                        \
67
23.5k
  }                                                                       \
Unexecuted instantiation: EVP_aes_256_ctr
Unexecuted instantiation: EVP_aes_256_ofb
Unexecuted instantiation: EVP_aes_256_gcm
EVP_aead_aes_128_gcm
Line
Count
Source
62
245
  accessor_decorations type *name() {                                     \
63
245
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
245
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
245
     * cast is needed. */                                                 \
66
245
    return (const type *)name##_storage_bss_get();                        \
67
245
  }                                                                       \
Unexecuted instantiation: EVP_aead_aes_192_gcm
Unexecuted instantiation: EVP_aead_aes_256_gcm
Unexecuted instantiation: EVP_aead_aes_128_gcm_randnonce
Unexecuted instantiation: EVP_aead_aes_256_gcm_randnonce
EVP_aead_aes_128_gcm_tls12
Line
Count
Source
62
65.6k
  accessor_decorations type *name() {                                     \
63
65.6k
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
65.6k
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
65.6k
     * cast is needed. */                                                 \
66
65.6k
    return (const type *)name##_storage_bss_get();                        \
67
65.6k
  }                                                                       \
EVP_aead_aes_256_gcm_tls12
Line
Count
Source
62
32.5k
  accessor_decorations type *name() {                                     \
63
32.5k
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
32.5k
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
32.5k
     * cast is needed. */                                                 \
66
32.5k
    return (const type *)name##_storage_bss_get();                        \
67
32.5k
  }                                                                       \
EVP_aead_aes_128_gcm_tls13
Line
Count
Source
62
44.1k
  accessor_decorations type *name() {                                     \
63
44.1k
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
44.1k
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
44.1k
     * cast is needed. */                                                 \
66
44.1k
    return (const type *)name##_storage_bss_get();                        \
67
44.1k
  }                                                                       \
EVP_aead_aes_256_gcm_tls13
Line
Count
Source
62
33.5k
  accessor_decorations type *name() {                                     \
63
33.5k
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
33.5k
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
33.5k
     * cast is needed. */                                                 \
66
33.5k
    return (const type *)name##_storage_bss_get();                        \
67
33.5k
  }                                                                       \
Unexecuted instantiation: EVP_aead_aes_128_ccm_bluetooth
Unexecuted instantiation: EVP_aead_aes_128_ccm_bluetooth_8
Unexecuted instantiation: EVP_aead_aes_128_ccm_matter
EVP_sha1
Line
Count
Source
62
46.1k
  accessor_decorations type *name() {                                     \
63
46.1k
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
46.1k
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
46.1k
     * cast is needed. */                                                 \
66
46.1k
    return (const type *)name##_storage_bss_get();                        \
67
46.1k
  }                                                                       \
EVP_sha224
Line
Count
Source
62
45
  accessor_decorations type *name() {                                     \
63
45
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
45
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
45
     * cast is needed. */                                                 \
66
45
    return (const type *)name##_storage_bss_get();                        \
67
45
  }                                                                       \
EVP_sha256
Line
Count
Source
62
248k
  accessor_decorations type *name() {                                     \
63
248k
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
248k
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
248k
     * cast is needed. */                                                 \
66
248k
    return (const type *)name##_storage_bss_get();                        \
67
248k
  }                                                                       \
EVP_sha384
Line
Count
Source
62
124k
  accessor_decorations type *name() {                                     \
63
124k
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
124k
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
124k
     * cast is needed. */                                                 \
66
124k
    return (const type *)name##_storage_bss_get();                        \
67
124k
  }                                                                       \
EVP_sha512
Line
Count
Source
62
14.6k
  accessor_decorations type *name() {                                     \
63
14.6k
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
14.6k
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
14.6k
     * cast is needed. */                                                 \
66
14.6k
    return (const type *)name##_storage_bss_get();                        \
67
14.6k
  }                                                                       \
Unexecuted instantiation: EVP_sha512_256
EC_group_p224
Line
Count
Source
62
63.0k
  accessor_decorations type *name() {                                     \
63
63.0k
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
63.0k
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
63.0k
     * cast is needed. */                                                 \
66
63.0k
    return (const type *)name##_storage_bss_get();                        \
67
63.0k
  }                                                                       \
EC_group_p256
Line
Count
Source
62
66.9k
  accessor_decorations type *name() {                                     \
63
66.9k
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
66.9k
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
66.9k
     * cast is needed. */                                                 \
66
66.9k
    return (const type *)name##_storage_bss_get();                        \
67
66.9k
  }                                                                       \
EC_group_p384
Line
Count
Source
62
25.0k
  accessor_decorations type *name() {                                     \
63
25.0k
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
25.0k
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
25.0k
     * cast is needed. */                                                 \
66
25.0k
    return (const type *)name##_storage_bss_get();                        \
67
25.0k
  }                                                                       \
EC_group_p521
Line
Count
Source
62
8.85k
  accessor_decorations type *name() {                                     \
63
8.85k
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
8.85k
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
8.85k
     * cast is needed. */                                                 \
66
8.85k
    return (const type *)name##_storage_bss_get();                        \
67
8.85k
  }                                                                       \
bssl::EC_GFp_mont_method()
Line
Count
Source
62
45
  accessor_decorations type *name() {                                     \
63
45
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
45
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
45
     * cast is needed. */                                                 \
66
45
    return (const type *)name##_storage_bss_get();                        \
67
45
  }                                                                       \
bssl::EC_GFp_nistz256_method()
Line
Count
Source
62
19
  accessor_decorations type *name() {                                     \
63
19
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
19
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
19
     * cast is needed. */                                                 \
66
19
    return (const type *)name##_storage_bss_get();                        \
67
19
  }                                                                       \
Unexecuted instantiation: bssl::EC_GFp_nistp256_method()
bssl::RSA_default_method()
Line
Count
Source
62
134k
  accessor_decorations type *name() {                                     \
63
134k
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
134k
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
134k
     * cast is needed. */                                                 \
66
134k
    return (const type *)name##_storage_bss_get();                        \
67
134k
  }                                                                       \
Unexecuted instantiation: bcm.cc:aes_hw_128_ecb()
Unexecuted instantiation: bcm.cc:aes_128_ecb_generic()
Unexecuted instantiation: bcm.cc:aes_hw_192_ecb()
Unexecuted instantiation: bcm.cc:aes_192_ecb_generic()
Unexecuted instantiation: bcm.cc:aes_hw_256_ecb()
Unexecuted instantiation: bcm.cc:aes_256_ecb_generic()
bcm.cc:md_pctx_ops()
Line
Count
Source
62
62.0k
  accessor_decorations type *name() {                                     \
63
62.0k
    bssl::CRYPTO_once(name##_once_bss_get(), name##_init);                \
64
62.0k
    /* See http://c-faq.com/ansi/constmismatch.html for why the following \
65
62.0k
     * cast is needed. */                                                 \
66
62.0k
    return (const type *)name##_storage_bss_get();                        \
67
62.0k
  }                                                                       \
Unexecuted instantiation: bcm.cc:g_small_factors()
68
  static void name##_do_init(type *out)
69
70
// DEFINE_METHOD_FUNCTION defines a function named `name` which returns a
71
// method table of type const `type`*. In FIPS mode, to avoid rel.ro data, it
72
// is split into a CRYPTO_once_t-guarded initializer in the module and
73
// unhashed, non-module accessor functions to space reserved in the BSS. The
74
// method table is initialized by a caller-supplied function which takes a
75
// parameter named `out` of type `type`*. The caller should follow the macro
76
// invocation with the body of this function:
77
//
78
//     DEFINE_METHOD_FUNCTION(EVP_MD, EVP_md4) {
79
//       out->type = NID_md4;
80
//       out->md_size = MD4_DIGEST_LENGTH;
81
//       out->flags = 0;
82
//       out->init = md4_init;
83
//       out->update = md4_update;
84
//       out->final = md4_final;
85
//       out->block_size = 64;
86
//       out->ctx_size = sizeof(MD4_CTX);
87
//     }
88
//
89
// This mechanism does not use a static initializer because their execution
90
// order is undefined. See FIPS.md for more details.
91
#define DEFINE_METHOD_FUNCTION(type, name) DEFINE_DATA(type, name, const)
92
93
#define DEFINE_LOCAL_DATA(type, name) DEFINE_DATA(type, name, static const)
94
95
#endif  // OPENSSL_HEADER_CRYPTO_FIPSMODULE_DELOCATE_H