/src/boringssl/crypto/fipsmodule/delocate.h
Line | Count | Source |
1 | | /* Copyright (c) 2017, Google Inc. |
2 | | * |
3 | | * Permission to use, copy, modify, and/or distribute this software for any |
4 | | * purpose with or without fee is hereby granted, provided that the above |
5 | | * copyright notice and this permission notice appear in all copies. |
6 | | * |
7 | | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
8 | | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
9 | | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY |
10 | | * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
11 | | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION |
12 | | * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN |
13 | | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ |
14 | | |
15 | | #ifndef OPENSSL_HEADER_FIPSMODULE_DELOCATE_H |
16 | | #define OPENSSL_HEADER_FIPSMODULE_DELOCATE_H |
17 | | |
18 | | #include <openssl/base.h> |
19 | | |
20 | | #include "../internal.h" |
21 | | |
22 | | |
23 | | #if !defined(BORINGSSL_SHARED_LIBRARY) && defined(BORINGSSL_FIPS) && \ |
24 | | !defined(OPENSSL_ASAN) && !defined(OPENSSL_MSAN) |
25 | | #define DEFINE_BSS_GET(type, name) \ |
26 | | static type name __attribute__((used)); \ |
27 | | type *name##_bss_get(void) __attribute__((const)); |
28 | | // For FIPS builds we require that CRYPTO_ONCE_INIT be zero. |
29 | | #define DEFINE_STATIC_ONCE(name) DEFINE_BSS_GET(CRYPTO_once_t, name) |
30 | | // For FIPS builds we require that CRYPTO_STATIC_MUTEX_INIT be zero. |
31 | | #define DEFINE_STATIC_MUTEX(name) \ |
32 | | DEFINE_BSS_GET(struct CRYPTO_STATIC_MUTEX, name) |
33 | | // For FIPS builds we require that CRYPTO_EX_DATA_CLASS_INIT be zero. |
34 | | #define DEFINE_STATIC_EX_DATA_CLASS(name) \ |
35 | | DEFINE_BSS_GET(CRYPTO_EX_DATA_CLASS, name) |
36 | | #else |
37 | | #define DEFINE_BSS_GET(type, name) \ |
38 | | static type name; \ |
39 | 5.01k | static type *name##_bss_get(void) { return &name; } bcm.c:BN_value_one_storage_bss_get Line | Count | Source | 39 | 397 | static type *name##_bss_get(void) { return &name; } |
Unexecuted instantiation: bcm.c:EVP_aes_128_cbc_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aes_128_ctr_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aes_128_ofb_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aes_128_gcm_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aes_192_cbc_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aes_192_ctr_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aes_192_ofb_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aes_192_gcm_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aes_256_cbc_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aes_256_ctr_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aes_256_ofb_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aes_256_gcm_storage_bss_get Unexecuted instantiation: bcm.c:aes_hw_128_ecb_storage_bss_get Unexecuted instantiation: bcm.c:aes_128_ecb_generic_storage_bss_get Unexecuted instantiation: bcm.c:aes_hw_192_ecb_storage_bss_get Unexecuted instantiation: bcm.c:aes_192_ecb_generic_storage_bss_get Unexecuted instantiation: bcm.c:aes_hw_256_ecb_storage_bss_get Unexecuted instantiation: bcm.c:aes_256_ecb_generic_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_128_gcm_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_192_gcm_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_256_gcm_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_128_gcm_randnonce_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_256_gcm_randnonce_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_128_gcm_tls12_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_256_gcm_tls12_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_128_gcm_tls13_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_256_gcm_tls13_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_128_ccm_bluetooth_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_128_ccm_bluetooth_8_storage_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_128_ccm_matter_storage_bss_get Unexecuted instantiation: bcm.c:EVP_md4_storage_bss_get Unexecuted instantiation: bcm.c:EVP_md5_storage_bss_get Unexecuted instantiation: bcm.c:EVP_sha1_storage_bss_get Unexecuted instantiation: bcm.c:EVP_sha224_storage_bss_get Unexecuted instantiation: bcm.c:EVP_sha256_storage_bss_get Unexecuted instantiation: bcm.c:EVP_sha384_storage_bss_get Unexecuted instantiation: bcm.c:EVP_sha512_storage_bss_get Unexecuted instantiation: bcm.c:EVP_sha512_256_storage_bss_get Unexecuted instantiation: bcm.c:EVP_md5_sha1_storage_bss_get Unexecuted instantiation: bcm.c:md_pctx_ops_storage_bss_get bcm.c:OPENSSL_built_in_curves_storage_bss_get Line | Count | Source | 39 | 2.74k | static type *name##_bss_get(void) { return &name; } |
bcm.c:built_in_groups_bss_get Line | Count | Source | 39 | 1.23k | static type *name##_bss_get(void) { return &name; } |
bcm.c:EC_GFp_mont_method_storage_bss_get Line | Count | Source | 39 | 3 | static type *name##_bss_get(void) { return &name; } |
bcm.c:EC_GFp_nistp224_method_storage_bss_get Line | Count | Source | 39 | 2 | static type *name##_bss_get(void) { return &name; } |
Unexecuted instantiation: bcm.c:EC_GFp_nistp256_method_storage_bss_get bcm.c:EC_GFp_nistz256_method_storage_bss_get Line | Count | Source | 39 | 2 | static type *name##_bss_get(void) { return &name; } |
Unexecuted instantiation: bcm.c:g_fork_detect_addr_bss_get Unexecuted instantiation: bcm.c:g_force_madv_wipeonfork_bss_get Unexecuted instantiation: bcm.c:g_force_madv_wipeonfork_enabled_bss_get Unexecuted instantiation: bcm.c:g_fork_generation_bss_get Unexecuted instantiation: bcm.c:g_small_factors_storage_bss_get bcm.c:RSA_default_method_storage_bss_get Line | Count | Source | 39 | 639 | static type *name##_bss_get(void) { return &name; } |
|
40 | | #define DEFINE_STATIC_ONCE(name) \ |
41 | | static CRYPTO_once_t name = CRYPTO_ONCE_INIT; \ |
42 | 3.77k | static CRYPTO_once_t *name##_bss_get(void) { return &name; } bcm.c:BN_value_one_once_bss_get Line | Count | Source | 42 | 396 | static CRYPTO_once_t *name##_bss_get(void) { return &name; } |
Unexecuted instantiation: bcm.c:EVP_aes_128_cbc_once_bss_get Unexecuted instantiation: bcm.c:EVP_aes_128_ctr_once_bss_get Unexecuted instantiation: bcm.c:EVP_aes_128_ofb_once_bss_get Unexecuted instantiation: bcm.c:EVP_aes_128_gcm_once_bss_get Unexecuted instantiation: bcm.c:EVP_aes_192_cbc_once_bss_get Unexecuted instantiation: bcm.c:EVP_aes_192_ctr_once_bss_get Unexecuted instantiation: bcm.c:EVP_aes_192_ofb_once_bss_get Unexecuted instantiation: bcm.c:EVP_aes_192_gcm_once_bss_get Unexecuted instantiation: bcm.c:EVP_aes_256_cbc_once_bss_get Unexecuted instantiation: bcm.c:EVP_aes_256_ctr_once_bss_get Unexecuted instantiation: bcm.c:EVP_aes_256_ofb_once_bss_get Unexecuted instantiation: bcm.c:EVP_aes_256_gcm_once_bss_get Unexecuted instantiation: bcm.c:aes_hw_128_ecb_once_bss_get Unexecuted instantiation: bcm.c:aes_128_ecb_generic_once_bss_get Unexecuted instantiation: bcm.c:aes_hw_192_ecb_once_bss_get Unexecuted instantiation: bcm.c:aes_192_ecb_generic_once_bss_get Unexecuted instantiation: bcm.c:aes_hw_256_ecb_once_bss_get Unexecuted instantiation: bcm.c:aes_256_ecb_generic_once_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_128_gcm_once_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_192_gcm_once_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_256_gcm_once_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_128_gcm_randnonce_once_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_256_gcm_randnonce_once_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_128_gcm_tls12_once_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_256_gcm_tls12_once_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_128_gcm_tls13_once_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_256_gcm_tls13_once_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_128_ccm_bluetooth_once_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_128_ccm_bluetooth_8_once_bss_get Unexecuted instantiation: bcm.c:EVP_aead_aes_128_ccm_matter_once_bss_get Unexecuted instantiation: bcm.c:EVP_md4_once_bss_get Unexecuted instantiation: bcm.c:EVP_md5_once_bss_get Unexecuted instantiation: bcm.c:EVP_sha1_once_bss_get Unexecuted instantiation: bcm.c:EVP_sha224_once_bss_get Unexecuted instantiation: bcm.c:EVP_sha256_once_bss_get Unexecuted instantiation: bcm.c:EVP_sha384_once_bss_get Unexecuted instantiation: bcm.c:EVP_sha512_once_bss_get Unexecuted instantiation: bcm.c:EVP_sha512_256_once_bss_get Unexecuted instantiation: bcm.c:EVP_md5_sha1_once_bss_get Unexecuted instantiation: bcm.c:md_pctx_ops_once_bss_get bcm.c:OPENSSL_built_in_curves_once_bss_get Line | Count | Source | 42 | 2.74k | static CRYPTO_once_t *name##_bss_get(void) { return &name; } |
bcm.c:EC_GFp_mont_method_once_bss_get Line | Count | Source | 42 | 2 | static CRYPTO_once_t *name##_bss_get(void) { return &name; } |
bcm.c:EC_GFp_nistp224_method_once_bss_get Line | Count | Source | 42 | 1 | static CRYPTO_once_t *name##_bss_get(void) { return &name; } |
Unexecuted instantiation: bcm.c:EC_GFp_nistp256_method_once_bss_get bcm.c:EC_GFp_nistz256_method_once_bss_get Line | Count | Source | 42 | 1 | static CRYPTO_once_t *name##_bss_get(void) { return &name; } |
Unexecuted instantiation: bcm.c:g_fork_detect_once_bss_get Unexecuted instantiation: bcm.c:g_small_factors_once_bss_get bcm.c:RSA_default_method_once_bss_get Line | Count | Source | 42 | 638 | static CRYPTO_once_t *name##_bss_get(void) { return &name; } |
|
43 | | #define DEFINE_STATIC_MUTEX(name) \ |
44 | | static struct CRYPTO_STATIC_MUTEX name = CRYPTO_STATIC_MUTEX_INIT; \ |
45 | 2.47k | static struct CRYPTO_STATIC_MUTEX *name##_bss_get(void) { return &name; } bcm.c:built_in_groups_lock_bss_get Line | Count | Source | 45 | 2.47k | static struct CRYPTO_STATIC_MUTEX *name##_bss_get(void) { return &name; } |
Unexecuted instantiation: bcm.c:g_fork_detect_lock_bss_get |
46 | | #define DEFINE_STATIC_EX_DATA_CLASS(name) \ |
47 | | static CRYPTO_EX_DATA_CLASS name = CRYPTO_EX_DATA_CLASS_INIT; \ |
48 | 1.70k | static CRYPTO_EX_DATA_CLASS *name##_bss_get(void) { return &name; } bcm.c:g_ec_ex_data_class_bss_get Line | Count | Source | 48 | 1.06k | static CRYPTO_EX_DATA_CLASS *name##_bss_get(void) { return &name; } |
bcm.c:g_rsa_ex_data_class_bss_get Line | Count | Source | 48 | 638 | static CRYPTO_EX_DATA_CLASS *name##_bss_get(void) { return &name; } |
|
49 | | #endif |
50 | | |
51 | | #define DEFINE_DATA(type, name, accessor_decorations) \ |
52 | | DEFINE_BSS_GET(type, name##_storage) \ |
53 | | DEFINE_STATIC_ONCE(name##_once) \ |
54 | | static void name##_do_init(type *out); \ |
55 | 6 | static void name##_init(void) { name##_do_init(name##_storage_bss_get()); } \ Line | Count | Source | 55 | 1 | static void name##_init(void) { name##_do_init(name##_storage_bss_get()); } \ |
Unexecuted instantiation: bcm.c:EVP_aes_128_cbc_init Unexecuted instantiation: bcm.c:EVP_aes_128_ctr_init Unexecuted instantiation: bcm.c:EVP_aes_128_ofb_init Unexecuted instantiation: bcm.c:EVP_aes_128_gcm_init Unexecuted instantiation: bcm.c:EVP_aes_192_cbc_init Unexecuted instantiation: bcm.c:EVP_aes_192_ctr_init Unexecuted instantiation: bcm.c:EVP_aes_192_ofb_init Unexecuted instantiation: bcm.c:EVP_aes_192_gcm_init Unexecuted instantiation: bcm.c:EVP_aes_256_cbc_init Unexecuted instantiation: bcm.c:EVP_aes_256_ctr_init Unexecuted instantiation: bcm.c:EVP_aes_256_ofb_init Unexecuted instantiation: bcm.c:EVP_aes_256_gcm_init Unexecuted instantiation: bcm.c:aes_hw_128_ecb_init Unexecuted instantiation: bcm.c:aes_128_ecb_generic_init Unexecuted instantiation: bcm.c:aes_hw_192_ecb_init Unexecuted instantiation: bcm.c:aes_192_ecb_generic_init Unexecuted instantiation: bcm.c:aes_hw_256_ecb_init Unexecuted instantiation: bcm.c:aes_256_ecb_generic_init Unexecuted instantiation: bcm.c:EVP_aead_aes_128_gcm_init Unexecuted instantiation: bcm.c:EVP_aead_aes_192_gcm_init Unexecuted instantiation: bcm.c:EVP_aead_aes_256_gcm_init Unexecuted instantiation: bcm.c:EVP_aead_aes_128_gcm_randnonce_init Unexecuted instantiation: bcm.c:EVP_aead_aes_256_gcm_randnonce_init Unexecuted instantiation: bcm.c:EVP_aead_aes_128_gcm_tls12_init Unexecuted instantiation: bcm.c:EVP_aead_aes_256_gcm_tls12_init Unexecuted instantiation: bcm.c:EVP_aead_aes_128_gcm_tls13_init Unexecuted instantiation: bcm.c:EVP_aead_aes_256_gcm_tls13_init Unexecuted instantiation: bcm.c:EVP_aead_aes_128_ccm_bluetooth_init Unexecuted instantiation: bcm.c:EVP_aead_aes_128_ccm_bluetooth_8_init Unexecuted instantiation: bcm.c:EVP_aead_aes_128_ccm_matter_init Unexecuted instantiation: bcm.c:EVP_md4_init Unexecuted instantiation: bcm.c:EVP_md5_init Unexecuted instantiation: bcm.c:EVP_sha1_init Unexecuted instantiation: bcm.c:EVP_sha224_init Unexecuted instantiation: bcm.c:EVP_sha256_init Unexecuted instantiation: bcm.c:EVP_sha384_init Unexecuted instantiation: bcm.c:EVP_sha512_init Unexecuted instantiation: bcm.c:EVP_sha512_256_init Unexecuted instantiation: bcm.c:EVP_md5_sha1_init Unexecuted instantiation: bcm.c:md_pctx_ops_init bcm.c:OPENSSL_built_in_curves_init Line | Count | Source | 55 | 1 | static void name##_init(void) { name##_do_init(name##_storage_bss_get()); } \ |
bcm.c:EC_GFp_mont_method_init Line | Count | Source | 55 | 1 | static void name##_init(void) { name##_do_init(name##_storage_bss_get()); } \ |
bcm.c:EC_GFp_nistp224_method_init Line | Count | Source | 55 | 1 | static void name##_init(void) { name##_do_init(name##_storage_bss_get()); } \ |
Unexecuted instantiation: bcm.c:EC_GFp_nistp256_method_init bcm.c:EC_GFp_nistz256_method_init Line | Count | Source | 55 | 1 | static void name##_init(void) { name##_do_init(name##_storage_bss_get()); } \ |
Unexecuted instantiation: bcm.c:g_small_factors_init bcm.c:RSA_default_method_init Line | Count | Source | 55 | 1 | static void name##_init(void) { name##_do_init(name##_storage_bss_get()); } \ |
|
56 | 3.77k | accessor_decorations type *name(void) { \ |
57 | 3.77k | CRYPTO_once(name##_once_bss_get(), name##_init); \ |
58 | 3.77k | /* See http://c-faq.com/ansi/constmismatch.html for why the following \ |
59 | 3.77k | * cast is needed. */ \ |
60 | 3.77k | return (const type *)name##_storage_bss_get(); \ |
61 | 3.77k | } \ Line | Count | Source | 56 | 396 | accessor_decorations type *name(void) { \ | 57 | 396 | CRYPTO_once(name##_once_bss_get(), name##_init); \ | 58 | 396 | /* See http://c-faq.com/ansi/constmismatch.html for why the following \ | 59 | 396 | * cast is needed. */ \ | 60 | 396 | return (const type *)name##_storage_bss_get(); \ | 61 | 396 | } \ |
Unexecuted instantiation: EVP_aes_128_cbc 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 Unexecuted instantiation: EVP_aes_256_cbc Unexecuted instantiation: EVP_aes_256_ctr Unexecuted instantiation: EVP_aes_256_ofb Unexecuted instantiation: EVP_aes_256_gcm Unexecuted instantiation: EVP_aead_aes_128_gcm 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 Unexecuted instantiation: EVP_aead_aes_128_gcm_tls12 Unexecuted instantiation: EVP_aead_aes_256_gcm_tls12 Unexecuted instantiation: EVP_aead_aes_128_gcm_tls13 Unexecuted instantiation: EVP_aead_aes_256_gcm_tls13 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 Unexecuted instantiation: EVP_md4 Unexecuted instantiation: EVP_md5 Unexecuted instantiation: EVP_sha1 Unexecuted instantiation: EVP_sha224 Unexecuted instantiation: EVP_sha256 Unexecuted instantiation: EVP_sha384 Unexecuted instantiation: EVP_sha512 Unexecuted instantiation: EVP_sha512_256 Unexecuted instantiation: EVP_md5_sha1 Line | Count | Source | 56 | 2.74k | accessor_decorations type *name(void) { \ | 57 | 2.74k | CRYPTO_once(name##_once_bss_get(), name##_init); \ | 58 | 2.74k | /* See http://c-faq.com/ansi/constmismatch.html for why the following \ | 59 | 2.74k | * cast is needed. */ \ | 60 | 2.74k | return (const type *)name##_storage_bss_get(); \ | 61 | 2.74k | } \ |
Line | Count | Source | 56 | 2 | accessor_decorations type *name(void) { \ | 57 | 2 | CRYPTO_once(name##_once_bss_get(), name##_init); \ | 58 | 2 | /* See http://c-faq.com/ansi/constmismatch.html for why the following \ | 59 | 2 | * cast is needed. */ \ | 60 | 2 | return (const type *)name##_storage_bss_get(); \ | 61 | 2 | } \ |
Line | Count | Source | 56 | 1 | accessor_decorations type *name(void) { \ | 57 | 1 | CRYPTO_once(name##_once_bss_get(), name##_init); \ | 58 | 1 | /* See http://c-faq.com/ansi/constmismatch.html for why the following \ | 59 | 1 | * cast is needed. */ \ | 60 | 1 | return (const type *)name##_storage_bss_get(); \ | 61 | 1 | } \ |
Unexecuted instantiation: EC_GFp_nistp256_method Line | Count | Source | 56 | 1 | accessor_decorations type *name(void) { \ | 57 | 1 | CRYPTO_once(name##_once_bss_get(), name##_init); \ | 58 | 1 | /* See http://c-faq.com/ansi/constmismatch.html for why the following \ | 59 | 1 | * cast is needed. */ \ | 60 | 1 | return (const type *)name##_storage_bss_get(); \ | 61 | 1 | } \ |
Line | Count | Source | 56 | 638 | accessor_decorations type *name(void) { \ | 57 | 638 | CRYPTO_once(name##_once_bss_get(), name##_init); \ | 58 | 638 | /* See http://c-faq.com/ansi/constmismatch.html for why the following \ | 59 | 638 | * cast is needed. */ \ | 60 | 638 | return (const type *)name##_storage_bss_get(); \ | 61 | 638 | } \ |
Unexecuted instantiation: bcm.c:aes_hw_128_ecb Unexecuted instantiation: bcm.c:aes_128_ecb_generic Unexecuted instantiation: bcm.c:aes_hw_192_ecb Unexecuted instantiation: bcm.c:aes_192_ecb_generic Unexecuted instantiation: bcm.c:aes_hw_256_ecb Unexecuted instantiation: bcm.c:aes_256_ecb_generic Unexecuted instantiation: bcm.c:md_pctx_ops Unexecuted instantiation: bcm.c:g_small_factors |
62 | | static void name##_do_init(type *out) |
63 | | |
64 | | // DEFINE_METHOD_FUNCTION defines a function named |name| which returns a |
65 | | // method table of type const |type|*. In FIPS mode, to avoid rel.ro data, it |
66 | | // is split into a CRYPTO_once_t-guarded initializer in the module and |
67 | | // unhashed, non-module accessor functions to space reserved in the BSS. The |
68 | | // method table is initialized by a caller-supplied function which takes a |
69 | | // parameter named |out| of type |type|*. The caller should follow the macro |
70 | | // invocation with the body of this function: |
71 | | // |
72 | | // DEFINE_METHOD_FUNCTION(EVP_MD, EVP_md4) { |
73 | | // out->type = NID_md4; |
74 | | // out->md_size = MD4_DIGEST_LENGTH; |
75 | | // out->flags = 0; |
76 | | // out->init = md4_init; |
77 | | // out->update = md4_update; |
78 | | // out->final = md4_final; |
79 | | // out->block_size = 64; |
80 | | // out->ctx_size = sizeof(MD4_CTX); |
81 | | // } |
82 | | // |
83 | | // This mechanism does not use a static initializer because their execution |
84 | | // order is undefined. See FIPS.md for more details. |
85 | | #define DEFINE_METHOD_FUNCTION(type, name) DEFINE_DATA(type, name, const) |
86 | | |
87 | | #define DEFINE_LOCAL_DATA(type, name) DEFINE_DATA(type, name, static const) |
88 | | |
89 | | #endif // OPENSSL_HEADER_FIPSMODULE_DELOCATE_H |