Debian Codegraph @

crt/aws-c-cal/source/darwin/commoncrypto_platform_init.c

raw symbols SCIP
1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5
6 #include <aws/common/allocator.h>
7 #if defined(AWS_USE_LIBCRYPTO_TO_SUPPORT_ED25519_EVERYWHERE)
8 # include <aws/cal/private/opensslcrypto_common.h>
9 # if defined(OPENSSL_IS_AWSLC)
10 # include <openssl/thread.h>
11 # endif
12 #endif
13
14 void aws_cal_platform_init(struct aws_allocator *allocator) {
15 #if defined(AWS_USE_LIBCRYPTO_TO_SUPPORT_ED25519_EVERYWHERE)
16 aws_validate_libcrypto_linkage();
17 #endif
18 (void)allocator;
19 }
20
21 #if defined(AWS_USE_LIBCRYPTO_TO_SUPPORT_ED25519_EVERYWHERE) && defined(OPENSSL_IS_AWSLC)
22 void __attribute__((destructor)) s_cal_crypto_shutdown(void) {
23 AWSLC_thread_local_shutdown();
24 }
25 #endif
26
27 void aws_cal_platform_clean_up(void) {
28 #if defined(AWS_USE_LIBCRYPTO_TO_SUPPORT_ED25519_EVERYWHERE) && defined(OPENSSL_IS_AWSLC)
29 AWSLC_thread_local_clear();
30 #endif
31 }
32
33 void aws_cal_platform_thread_clean_up(void) {
34 #if defined(AWS_USE_LIBCRYPTO_TO_SUPPORT_ED25519_EVERYWHERE) && defined(OPENSSL_IS_AWSLC)
35 AWSLC_thread_local_clear();
36 #endif
37 }