• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 "alg_manager.h"
17 
18 #include "alg_common_type.h"
19 #include "dlp_permission_log.h"
20 #include "huks_adapt_manager.h"
21 
22 namespace OHOS {
23 namespace Security {
24 namespace DlpPermission {
25 
AlgIsKeyExist(const HuksKeyInfo * keyInfo)26 bool AlgIsKeyExist(const HuksKeyInfo *keyInfo)
27 {
28     return IsHuksMgrKeyExist(keyInfo);
29 }
30 
AlgGenerateMacKey(const HuksKeyInfo * keyInfo)31 int32_t AlgGenerateMacKey(const HuksKeyInfo *keyInfo)
32 {
33     return HuksGenerateMacKey(keyInfo);
34 }
35 
AlgHmac(const HuksKeyInfo * keyInfo,const BlobData * data,BlobData * outData)36 int32_t AlgHmac(const HuksKeyInfo *keyInfo, const BlobData *data, BlobData *outData)
37 {
38     return HuksGenerateHmac(keyInfo, data, outData);
39 }
40 }  // namespace DlpPermission
41 }  // namespace Security
42 }  // namespace OHOS