xref: /openbsd-src/lib/libcrypto/bn/s2n_bignum_internal.h (revision 22787c513b4b59ee1fb13a32326a50f73cd342c1)
1 // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
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
10 // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 
15 #ifdef __APPLE__
16 #   define S2N_BN_SYMBOL(NAME) _##NAME
17 #else
18 #   define S2N_BN_SYMBOL(name) name
19 #endif
20 
21 #ifdef __CET__
22 #   include <cet.h>
23 #else
24 #   define _CET_ENDBR
25 #endif
26 
27 #define S2N_BN_SYM_VISIBILITY_DIRECTIVE(name) .globl S2N_BN_SYMBOL(name)
28 #ifdef S2N_BN_HIDE_SYMBOLS
29 #   ifdef __APPLE__
30 #      define S2N_BN_SYM_PRIVACY_DIRECTIVE(name) .private_extern S2N_BN_SYMBOL(name)
31 #   else
32 #      define S2N_BN_SYM_PRIVACY_DIRECTIVE(name) .hidden S2N_BN_SYMBOL(name)
33 #   endif
34 #else
35 #   define S2N_BN_SYM_PRIVACY_DIRECTIVE(name)  /* NO-OP: S2N_BN_SYM_PRIVACY_DIRECTIVE */
36 #endif
37