1 /* 2 * Copyright (C) 2021 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 COMMON_STANDARD_BIND_EXCHANGE_H 17 #define COMMON_STANDARD_BIND_EXCHANGE_H 18 19 #include <stdint.h> 20 #include "common_defs.h" 21 #include "pake_base_cur_task.h" 22 23 #define HICHAIN_EXCHANGE_REQUEST "hichain_exchange_request" 24 #define HICHAIN_EXCHANGE_RESPONSE "hichain_exchange_response" 25 #define STANDARD_BIND_EXCHANGE_NONCE_LEN 12 26 27 typedef struct StandardBindExchangeParamsT { 28 Uint8Buff pubKeySelf; 29 Uint8Buff pubKeyPeer; 30 Uint8Buff authInfo; 31 Uint8Buff exInfoCipher; 32 Uint8Buff nonce; 33 } StandardBindExchangeParams; 34 35 #ifdef __cplusplus 36 extern "C" { 37 #endif 38 39 int32_t InitStandardBindExchangeParams(StandardBindExchangeParams *params); 40 void DestroyStandardBindExchangeParams(StandardBindExchangeParams *params); 41 42 int32_t ClientRequestStandardBindExchange(const PakeParams *pakeParams, StandardBindExchangeParams *exchangeParams); 43 int32_t ServerResponseStandardBindExchange(PakeParams *pakeParams, StandardBindExchangeParams *exchangeParams); 44 int32_t ClientConfirmStandardBindExchange(PakeParams *pakeParams, StandardBindExchangeParams *exchangeParams); 45 46 #ifdef __cplusplus 47 } 48 #endif 49 #endif 50