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_AUTH_H 17 #define HKS_AUTH_H 18 19 #include <stdint.h> 20 21 #include "hks_keyblob.h" 22 #include "hks_keynode.h" 23 #include "hks_type.h" 24 25 enum HksAuthId { 26 HKS_AUTH_ID_SIGN_VERIFY_RSA = 0x1, 27 HKS_AUTH_ID_SIGN_VERIFY_ECC = 0x2, 28 HKS_AUTH_ID_SYM_CIPHER = 0x3, 29 HKS_AUTH_ID_ASYM_CIPHER = 0x4, 30 HKS_AUTH_ID_MAC_HMAC = 0x5, 31 HKS_AUTH_ID_MAC_SM3 = 0x6, 32 HKS_AUTH_ID_DERIVE = 0x7, 33 HKS_AUTH_ID_SIGN_VERIFY_ED25519 = 0x8, 34 HKS_AUTH_ID_AGREE = 0x9, 35 }; 36 37 #ifdef __cplusplus 38 extern "C" { 39 #endif 40 41 int32_t HksAuth(uint32_t authId, const struct HksKeyNode *keyNode, const struct HksParamSet *paramSet); 42 43 int32_t HksThreeStageAuth(uint32_t authId, const struct HuksKeyNode *keyNode); 44 45 #ifdef __cplusplus 46 } 47 #endif 48 49 #endif /* HKS_AUTH_H */ 50 51