xref: /xnu-11215.1.10/EXTERNAL_HEADERS/corecrypto/cc_impl.h (revision 8d741a5de7ff4191bf97d57b9f54c2f6d4a15585)
1*8d741a5dSApple OSS Distributions /* Copyright (c) (2021) Apple Inc. All rights reserved.
2*8d741a5dSApple OSS Distributions  *
3*8d741a5dSApple OSS Distributions  * corecrypto is licensed under Apple Inc.’s Internal Use License Agreement (which
4*8d741a5dSApple OSS Distributions  * is contained in the License.txt file distributed with corecrypto) and only to
5*8d741a5dSApple OSS Distributions  * people who accept that license. IMPORTANT:  Any license rights granted to you by
6*8d741a5dSApple OSS Distributions  * Apple Inc. (if any) are limited to internal use within your organization only on
7*8d741a5dSApple OSS Distributions  * devices and computers you own or control, for the sole purpose of verifying the
8*8d741a5dSApple OSS Distributions  * security characteristics and correct functioning of the Apple Software.  You may
9*8d741a5dSApple OSS Distributions  * not, directly or indirectly, redistribute the Apple Software or any portions thereof.
10*8d741a5dSApple OSS Distributions  */
11*8d741a5dSApple OSS Distributions 
12*8d741a5dSApple OSS Distributions #ifndef _CORECRYPTO_CC_IMPL_H_
13*8d741a5dSApple OSS Distributions #define _CORECRYPTO_CC_IMPL_H_
14*8d741a5dSApple OSS Distributions 
15*8d741a5dSApple OSS Distributions #define CC_IMPL_LIST                                        \
16*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(UNKNOWN, 0)                                \
17*8d741a5dSApple OSS Distributions                                                             \
18*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(SHA256_LTC, 1)                             \
19*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(SHA256_VNG_ARM, 2)                         \
20*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(SHA256_VNG_ARM64_NEON, 3)                  \
21*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(SHA256_VNG_INTEL_SUPPLEMENTAL_SSE3, 4)     \
22*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(SHA256_VNG_INTEL_AVX1, 5)                  \
23*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(SHA256_VNG_INTEL_AVX2, 6)                  \
24*8d741a5dSApple OSS Distributions                                                             \
25*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(AES_ECB_LTC, 11)                           \
26*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(AES_ECB_ARM, 12)                           \
27*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(AES_ECB_INTEL_OPT, 13)                     \
28*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(AES_ECB_INTEL_AESNI, 14)                   \
29*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(AES_ECB_SKG, 15)                           \
30*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(AES_ECB_TRNG, 16)                          \
31*8d741a5dSApple OSS Distributions                                                             \
32*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(AES_XTS_GENERIC, 21)                       \
33*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(AES_XTS_ARM, 22)                           \
34*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(AES_XTS_INTEL_OPT, 23)                     \
35*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(AES_XTS_INTEL_AESNI, 24)                   \
36*8d741a5dSApple OSS Distributions                                                             \
37*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(SHA1_LTC, 31)                              \
38*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(SHA1_VNG_ARM, 32)                          \
39*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(SHA1_VNG_INTEL_SUPPLEMENTAL_SSE3, 33)      \
40*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(SHA1_VNG_INTEL_AVX1, 34)                   \
41*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(SHA1_VNG_INTEL_AVX2, 35)                   \
42*8d741a5dSApple OSS Distributions                                                             \
43*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(SHA384_LTC, 41)                            \
44*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(SHA384_VNG_ARM, 42)                        \
45*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(SHA384_VNG_INTEL_SUPPLEMENTAL_SSE3, 43)    \
46*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(SHA384_VNG_INTEL_AVX1, 44)                 \
47*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(SHA384_VNG_INTEL_AVX2, 45)                 \
48*8d741a5dSApple OSS Distributions                                                             \
49*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(SHA512_LTC, 51)                            \
50*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(SHA512_VNG_ARM, 52)                        \
51*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(SHA512_VNG_INTEL_SUPPLEMENTAL_SSE3, 53)    \
52*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(SHA512_VNG_INTEL_AVX1, 54)                 \
53*8d741a5dSApple OSS Distributions     CC_IMPL_ITEM(SHA512_VNG_INTEL_AVX2, 55)
54*8d741a5dSApple OSS Distributions 
55*8d741a5dSApple OSS Distributions 
56*8d741a5dSApple OSS Distributions #define CC_IMPL_ITEM(k, v)                      \
57*8d741a5dSApple OSS Distributions     CC_IMPL_##k = v,
58*8d741a5dSApple OSS Distributions 
59*8d741a5dSApple OSS Distributions typedef enum cc_impl {
60*8d741a5dSApple OSS Distributions     CC_IMPL_LIST
61*8d741a5dSApple OSS Distributions } cc_impl_t;
62*8d741a5dSApple OSS Distributions 
63*8d741a5dSApple OSS Distributions #undef CC_IMPL_ITEM
64*8d741a5dSApple OSS Distributions 
65*8d741a5dSApple OSS Distributions const char *cc_impl_name(cc_impl_t impl);
66*8d741a5dSApple OSS Distributions 
67*8d741a5dSApple OSS Distributions #endif /* _CORECRYPTO_CC_IMPL_H_ */
68