• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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 #include "dm_crypto_mock.h"
17 
18 #include "gtest/gtest.h"
19 
20 namespace OHOS {
21 namespace DistributedHardware {
22 
23 
GetAccountIdHash(const std::string & accountId,unsigned char * accountIdHash)24 int32_t Crypto::GetAccountIdHash(const std::string &accountId, unsigned char *accountIdHash)
25 {
26     return DmCrypto::dmCrypto->GetAccountIdHash(accountId, accountIdHash);
27 }
28 
ConvertUdidHashToAnoyAndSave(const std::string & appId,const std::string & udidHash,DmKVValue & kvValue)29 int32_t Crypto::ConvertUdidHashToAnoyAndSave(const std::string &appId, const std::string &udidHash,
30     DmKVValue &kvValue)
31 {
32     return DmCrypto::dmCrypto->ConvertUdidHashToAnoyAndSave(appId, udidHash, kvValue);
33 }
34 
GetUdidHash(const std::string & udid,unsigned char * udidHash)35 int32_t Crypto::GetUdidHash(const std::string &udid, unsigned char *udidHash)
36 {
37     return DmCrypto::dmCrypto->GetUdidHash(udid, udidHash);
38 }
39 
GetGroupIdHash(const std::string & groupId)40 std::string Crypto::GetGroupIdHash(const std::string &groupId)
41 {
42     return DmCrypto::dmCrypto->GetGroupIdHash(groupId);
43 }
44 
ConvertUdidHashToAnoyDeviceId(const std::string & appId,const std::string & udidHash,DmKVValue & kvValue)45 int32_t Crypto::ConvertUdidHashToAnoyDeviceId(const std::string &appId, const std::string &udidHash,
46     DmKVValue &kvValue)
47 {
48     return DmCrypto::dmCrypto->ConvertUdidHashToAnoyDeviceId(appId, udidHash, kvValue);
49 }
50 } // namespace DistributedHardware
51 } // namespace OHOS