1 /* 2 * Copyright (C) 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 ACCOUNT_MODULE_DEFINES_H 17 #define ACCOUNT_MODULE_DEFINES_H 18 19 #define SEED_SIZE 32 20 #define PK_SIZE 128 21 #define PK_VERSION_SIZE 256 22 #define SIGNATURE_SIZE 128 23 #define PUBLIC_KEY_INFO_SIZE 1024 24 #define SERVER_PK_SIZE 128 25 #define DEV_AUTH_USER_ID_SIZE 65 26 #define DEV_AUTH_DEVICE_ID_SIZE 65 27 #define DEV_AUTH_AUTH_CODE_SIZE 32 28 #define HMAC_TOKEN_SIZE 32 29 #define PSK_SIZE 32 30 #define AUTH_RESULT_MAC_SIZE 32 31 32 typedef enum { 33 TASK_TYPE_DEFAULT = 0, 34 TASK_TYPE_PAKE_V2_AUTH_CLIENT = 5, 35 TASK_TYPE_PAKE_V2_AUTH_SERVER = 6, 36 TASK_TYPE_ISO_AUTH_CLIENT = 7, 37 TASK_TYPE_ISO_AUTH_SERVER = 8, 38 } AccountTaskType; 39 40 typedef enum { 41 CMD_PAKE_AUTH_MAIN_ONE = 0x0030, 42 RET_PAKE_AUTH_FOLLOWER_ONE = 0x0031, 43 CMD_PAKE_AUTH_MAIN_TWO = 0x0032, 44 RET_PAKE_AUTH_FOLLOWER_TWO = 0x0033, 45 46 CMD_ISO_AUTH_MAIN_ONE = 0x0050, 47 RET_ISO_AUTH_FOLLOWER_ONE = 0x0051, 48 CMD_ISO_AUTH_MAIN_TWO = 0x0052, 49 RET_ISO_AUTH_FOLLOWER_TWO = 0x0053, 50 ERR_MSG = 0x8080, 51 } MessageStepCode; 52 53 typedef enum { 54 ALG_ECC = 0x0000, 55 ALG_RSA = 0x0001, 56 ALG_HKDF = 0x0002, 57 ALG_HMAC = 0x0003, 58 ALG_AES = 0x0004, 59 ALG_PBKDF2 = 0x0005, 60 ALG_ECDH = 0x0006, 61 ALG_X25519 = 0x0007, 62 ALG_ED25519 = 0x0008, 63 } KeyAlgEncode; 64 65 #endif