1 /* 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef HKS_CONFIG_H 17 #define HKS_CONFIG_H 18 19 #define HKS_SUPPORT_LITE_HEAP 20 21 #define HKS_SUPPORT_POSIX 22 23 #define HKS_SUPPORT_SEC_LEVEL 24 25 /* AES */ 26 #define HKS_SUPPORT_AES_C 27 #define HKS_SUPPORT_AES_GENERATE_KEY 28 #define HKS_SUPPORT_AES_CBC_NOPADDING 29 #define HKS_SUPPORT_AES_CBC_PKCS7 30 #define HKS_SUPPORT_AES_GCM 31 #define HKS_SUPPORT_AES_CCM 32 #define HKS_SUPPORT_AES_CTR_NOPADDING 33 #define HKS_SUPPORT_AES_ECB_NOPADDING 34 #define HKS_SUPPORT_AES_ECB_PKCS7PADDING 35 36 /* BN */ 37 #define HKS_SUPPORT_BN_C 38 39 /* ECC */ 40 #define HKS_SUPPORT_ECC_C 41 #define HKS_SUPPORT_ECC_GENERATE_KEY 42 #define HKS_SUPPORT_ECC_GET_PUBLIC_KEY 43 44 #define HKS_SUPPORT_ECDH_C 45 #define HKS_SUPPORT_ECDH_AGREE_KEY 46 47 #define HKS_SUPPORT_ECDSA_C 48 #define HKS_SUPPORT_ECDSA_SIGN_VERIFY 49 50 /* ED25519 */ 51 #define HKS_SUPPORT_ED25519_C 52 #define HKS_SUPPORT_ED25519_GENERATE_KEY 53 #define HKS_SUPPORT_ED25519_SIGN_VERIFY 54 #define HKS_SUPPORT_ED2519_GET_PUBLIC_KEY 55 56 /* HASH */ 57 #define HKS_SUPPORT_HASH_C 58 #define HKS_SUPPORT_HASH_SHA1 59 #define HKS_SUPPORT_HASH_SHA224 60 #define HKS_SUPPORT_HASH_SHA256 61 #define HKS_SUPPORT_HASH_SHA384 62 #define HKS_SUPPORT_HASH_SHA512 63 #define HKS_SUPPORT_HASH_MD5 64 65 /* HMAC */ 66 #define HKS_SUPPORT_HMAC_C 67 #define HKS_SUPPORT_HMAC_GENERATE_KEY 68 #define HKS_SUPPORT_HMAC_SHA1 69 #define HKS_SUPPORT_HMAC_SHA224 70 #define HKS_SUPPORT_HMAC_SHA256 71 #define HKS_SUPPORT_HMAC_SHA384 72 #define HKS_SUPPORT_HMAC_SHA512 73 74 /* KDF */ 75 #define HKS_SUPPORT_KDF_C 76 #define HKS_SUPPORT_KDF_PBKDF2 77 #define HKS_SUPPORT_KDF_HKDF 78 79 /* RSA */ 80 #define HKS_SUPPORT_RSA_C 81 #define HKS_SUPPORT_RSA_GENERATE_KEY 82 #define HKS_SUPPORT_RSA_CRYPT 83 #define HKS_SUPPORT_RSA_SIGN_VERIFY 84 #define HKS_SUPPORT_RSA_GET_PUBLIC_KEY 85 #define HKS_SUPPORT_RSA_ECB_NOPADDING 86 #define HKS_SUPPORT_RSA_ECB_PKCS1PADDING 87 #define HKS_SUPPORT_RSA_ECB_OAEPPADDING_SHA1MGF1 88 #define HKS_SUPPORT_RSA_ECB_OAEPPADDING_SHA224MGF1 89 #define HKS_SUPPORT_RSA_ECB_OAEPPADDING_SHA256MGF1 90 #define HKS_SUPPORT_RSA_ECB_OAEPPADDING_SHA384MGF1 91 #define HKS_SUPPORT_RSA_ECB_OAEPPADDING_SHA512MGF1 92 #define HKS_SUPPORT_RSA_ECB_OEAPPADDING 93 #define HKS_SUPPORT_RSA_PSS 94 95 /* DH */ 96 #define HKS_SUPPORT_DH_C 97 #define HKS_SUPPORT_DH_GENERATE_KEY 98 #define HKS_SUPPORT_DH_AGREE_KEY 99 #define HKS_SUPPORT_DH_GET_PUBLIC_KEY 100 101 /* DSA */ 102 #define HKS_SUPPORT_DSA_C 103 #define HKS_SUPPORT_DSA_GENERATE_KEY 104 #define HKS_SUPPORT_DSA_SIGN_VERIFY 105 #define HKS_SUPPORT_DSA_GET_PUBLIC_KEY 106 107 /* X25519 */ 108 #define HKS_SUPPORT_X25519_C 109 #define HKS_SUPPORT_X25519_GENERATE_KEY 110 #define HKS_SUPPORT_X25519_AGREE_KEY 111 #define HKS_SUPPORT_X25519_GET_PUBLIC_KEY 112 113 #define HKS_SUPPORT_ED25519_TO_X25519 114 115 #if defined(HKS_SUPPORT_AES_GENERATE_KEY) || defined(HKS_SUPPORT_DH_GENERATE_KEY) || \ 116 defined(HKS_SUPPORT_DSA_GENERATE_KEY) || defined(HKS_SUPPORT_ECC_GENERATE_KEY) || \ 117 defined(HKS_SUPPORT_ED25519_GENERATE_KEY) || defined(HKS_SUPPORT_HMAC_GENERATE_KEY) || \ 118 defined(HKS_SUPPORT_RSA_GENERATE_KEY) || defined(HKS_SUPPORT_X25519_GENERATE_KEY) 119 #define HKS_SUPPORT_API_GENERATE_KEY 120 #define HKS_SUPPORT_API_DELETE_KEY 121 #define HKS_SUPPORT_API_GET_KEY_PARAM_SET 122 #define HKS_SUPPORT_API_KEY_EXIST 123 #endif 124 125 #if defined(HKS_SUPPORT_ECC_C) || defined(HKS_SUPPORT_RSA_C) || defined(HKS_SUPPORT_ED25519_C) || \ 126 defined(HKS_SUPPORT_X25519_C) || defined(HKS_SUPPORT_AES_C) || defined(HKS_SUPPORT_DSA_C) || \ 127 defined(HKS_SUPPORT_DH_C) 128 #define HKS_SUPPORT_API_IMPORT 129 #endif 130 131 #if defined(HKS_SUPPORT_ECC_C) || defined(HKS_SUPPORT_RSA_C) || defined(HKS_SUPPORT_ED25519_C) || \ 132 defined(HKS_SUPPORT_X25519_C) || defined(HKS_SUPPORT_AES_C) || defined(HKS_SUPPORT_DSA_C) || \ 133 defined(HKS_SUPPORT_DH_C) 134 #define HKS_SUPPORT_API_EXPORT 135 #endif 136 137 #define HKS_SUPPORT_API_GENERATE_RANDOM 138 139 #if defined(HKS_SUPPORT_ECDSA_SIGN_VERIFY) || defined(HKS_SUPPORT_ED25519_SIGN_VERIFY) || \ 140 defined(HKS_SUPPORT_RSA_SIGN_VERIFY) || defined(HKS_SUPPORT_DSA_SIGN_VERIFY) 141 #define HKS_SUPPORT_API_SIGN_VERIFY 142 #endif 143 144 #if defined(HKS_SUPPORT_AES_C) || defined(HKS_SUPPORT_RSA_CRYPT) 145 #define HKS_SUPPORT_API_CIPHER 146 #endif 147 148 #if defined(HKS_SUPPORT_X25519_AGREE_KEY) || defined(HKS_SUPPORT_ECDH_AGREE_KEY) || defined(HKS_SUPPORT_DH_AGREE_KEY) 149 #define HKS_SUPPORT_API_AGREE_KEY 150 #endif 151 152 #ifdef HKS_SUPPORT_KDF_C 153 #define HKS_SUPPORT_API_DERIVE_KEY 154 #endif 155 156 #ifdef HKS_SUPPORT_HMAC_C 157 #define HKS_SUPPORT_API_MAC 158 #endif 159 160 #ifdef HKS_SUPPORT_HASH_C 161 #define HKS_SUPPORT_API_HASH 162 #endif 163 164 #ifdef HKS_SUPPORT_BN_C 165 #define HKS_SUPPORT_API_BN_EXP_MOD 166 #endif 167 168 #ifndef HKS_SUPPORT_LITE_HEAP 169 #define HKS_SUPPORT_API_GET_KEY_INFO_LIST 170 #endif 171 172 #define HKS_SUPPORT_API_ATTEST_KEY 173 #define HKS_SUPPORT_API_GET_CERTIFICATE_CHAIN 174 #define HKS_SUPPORT_API_WRAP_KEY 175 #define HKS_SUPPORT_API_UNWRAP_KEY 176 177 #endif /* HKS_CONFIG_H */ 178