xref: /aosp_15_r20/external/boringssl/include/openssl/arm_arch.h (revision 8fb009dc861624b67b6cdb62ea21f0f22d0c584b)
1*8fb009dcSAndroid Build Coastguard Worker /* ====================================================================
2*8fb009dcSAndroid Build Coastguard Worker  * Copyright (c) 1998-2011 The OpenSSL Project.  All rights reserved.
3*8fb009dcSAndroid Build Coastguard Worker  *
4*8fb009dcSAndroid Build Coastguard Worker  * Redistribution and use in source and binary forms, with or without
5*8fb009dcSAndroid Build Coastguard Worker  * modification, are permitted provided that the following conditions
6*8fb009dcSAndroid Build Coastguard Worker  * are met:
7*8fb009dcSAndroid Build Coastguard Worker  *
8*8fb009dcSAndroid Build Coastguard Worker  * 1. Redistributions of source code must retain the above copyright
9*8fb009dcSAndroid Build Coastguard Worker  *    notice, this list of conditions and the following disclaimer.
10*8fb009dcSAndroid Build Coastguard Worker  *
11*8fb009dcSAndroid Build Coastguard Worker  * 2. Redistributions in binary form must reproduce the above copyright
12*8fb009dcSAndroid Build Coastguard Worker  *    notice, this list of conditions and the following disclaimer in
13*8fb009dcSAndroid Build Coastguard Worker  *    the documentation and/or other materials provided with the
14*8fb009dcSAndroid Build Coastguard Worker  *    distribution.
15*8fb009dcSAndroid Build Coastguard Worker  *
16*8fb009dcSAndroid Build Coastguard Worker  * 3. All advertising materials mentioning features or use of this
17*8fb009dcSAndroid Build Coastguard Worker  *    software must display the following acknowledgment:
18*8fb009dcSAndroid Build Coastguard Worker  *    "This product includes software developed by the OpenSSL Project
19*8fb009dcSAndroid Build Coastguard Worker  *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
20*8fb009dcSAndroid Build Coastguard Worker  *
21*8fb009dcSAndroid Build Coastguard Worker  * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
22*8fb009dcSAndroid Build Coastguard Worker  *    endorse or promote products derived from this software without
23*8fb009dcSAndroid Build Coastguard Worker  *    prior written permission. For written permission, please contact
24*8fb009dcSAndroid Build Coastguard Worker  *    [email protected].
25*8fb009dcSAndroid Build Coastguard Worker  *
26*8fb009dcSAndroid Build Coastguard Worker  * 5. Products derived from this software may not be called "OpenSSL"
27*8fb009dcSAndroid Build Coastguard Worker  *    nor may "OpenSSL" appear in their names without prior written
28*8fb009dcSAndroid Build Coastguard Worker  *    permission of the OpenSSL Project.
29*8fb009dcSAndroid Build Coastguard Worker  *
30*8fb009dcSAndroid Build Coastguard Worker  * 6. Redistributions of any form whatsoever must retain the following
31*8fb009dcSAndroid Build Coastguard Worker  *    acknowledgment:
32*8fb009dcSAndroid Build Coastguard Worker  *    "This product includes software developed by the OpenSSL Project
33*8fb009dcSAndroid Build Coastguard Worker  *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
34*8fb009dcSAndroid Build Coastguard Worker  *
35*8fb009dcSAndroid Build Coastguard Worker  * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
36*8fb009dcSAndroid Build Coastguard Worker  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
37*8fb009dcSAndroid Build Coastguard Worker  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
38*8fb009dcSAndroid Build Coastguard Worker  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
39*8fb009dcSAndroid Build Coastguard Worker  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40*8fb009dcSAndroid Build Coastguard Worker  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
41*8fb009dcSAndroid Build Coastguard Worker  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
42*8fb009dcSAndroid Build Coastguard Worker  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
43*8fb009dcSAndroid Build Coastguard Worker  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
44*8fb009dcSAndroid Build Coastguard Worker  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
45*8fb009dcSAndroid Build Coastguard Worker  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
46*8fb009dcSAndroid Build Coastguard Worker  * OF THE POSSIBILITY OF SUCH DAMAGE.
47*8fb009dcSAndroid Build Coastguard Worker  * ====================================================================
48*8fb009dcSAndroid Build Coastguard Worker  *
49*8fb009dcSAndroid Build Coastguard Worker  * This product includes cryptographic software written by Eric Young
50*8fb009dcSAndroid Build Coastguard Worker  * ([email protected]).  This product includes software written by Tim
51*8fb009dcSAndroid Build Coastguard Worker  * Hudson ([email protected]). */
52*8fb009dcSAndroid Build Coastguard Worker 
53*8fb009dcSAndroid Build Coastguard Worker #ifndef OPENSSL_HEADER_ARM_ARCH_H
54*8fb009dcSAndroid Build Coastguard Worker #define OPENSSL_HEADER_ARM_ARCH_H
55*8fb009dcSAndroid Build Coastguard Worker 
56*8fb009dcSAndroid Build Coastguard Worker #include <openssl/target.h>
57*8fb009dcSAndroid Build Coastguard Worker 
58*8fb009dcSAndroid Build Coastguard Worker // arm_arch.h contains symbols used by ARM assembly, and the C code that calls
59*8fb009dcSAndroid Build Coastguard Worker // it. It is included as a public header to simplify the build, but is not
60*8fb009dcSAndroid Build Coastguard Worker // intended for external use.
61*8fb009dcSAndroid Build Coastguard Worker 
62*8fb009dcSAndroid Build Coastguard Worker #if defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)
63*8fb009dcSAndroid Build Coastguard Worker 
64*8fb009dcSAndroid Build Coastguard Worker // ARMV7_NEON is true when a NEON unit is present in the current CPU.
65*8fb009dcSAndroid Build Coastguard Worker #define ARMV7_NEON (1 << 0)
66*8fb009dcSAndroid Build Coastguard Worker 
67*8fb009dcSAndroid Build Coastguard Worker // ARMV8_AES indicates support for hardware AES instructions.
68*8fb009dcSAndroid Build Coastguard Worker #define ARMV8_AES (1 << 2)
69*8fb009dcSAndroid Build Coastguard Worker 
70*8fb009dcSAndroid Build Coastguard Worker // ARMV8_SHA1 indicates support for hardware SHA-1 instructions.
71*8fb009dcSAndroid Build Coastguard Worker #define ARMV8_SHA1 (1 << 3)
72*8fb009dcSAndroid Build Coastguard Worker 
73*8fb009dcSAndroid Build Coastguard Worker // ARMV8_SHA256 indicates support for hardware SHA-256 instructions.
74*8fb009dcSAndroid Build Coastguard Worker #define ARMV8_SHA256 (1 << 4)
75*8fb009dcSAndroid Build Coastguard Worker 
76*8fb009dcSAndroid Build Coastguard Worker // ARMV8_PMULL indicates support for carryless multiplication.
77*8fb009dcSAndroid Build Coastguard Worker #define ARMV8_PMULL (1 << 5)
78*8fb009dcSAndroid Build Coastguard Worker 
79*8fb009dcSAndroid Build Coastguard Worker // ARMV8_SHA512 indicates support for hardware SHA-512 instructions.
80*8fb009dcSAndroid Build Coastguard Worker #define ARMV8_SHA512 (1 << 6)
81*8fb009dcSAndroid Build Coastguard Worker 
82*8fb009dcSAndroid Build Coastguard Worker #endif  // ARM || AARCH64
83*8fb009dcSAndroid Build Coastguard Worker 
84*8fb009dcSAndroid Build Coastguard Worker #endif  // OPENSSL_HEADER_ARM_ARCH_H
85