• 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 "softbus_aes_encrypt.h"
17 #include "softbus_adapter_crypto.h"
18 #include "softbus_error_code.h"
19 
SoftBusGenerateHmacHash(const EncryptKey * randomKey,const uint8_t * rootKey,uint32_t rootKeyLen,uint8_t * hash,uint32_t hashLen)20 int32_t SoftBusGenerateHmacHash(
21     const EncryptKey *randomKey, const uint8_t *rootKey, uint32_t rootKeyLen, uint8_t *hash, uint32_t hashLen)
22 {
23     (void)randomKey;
24     (void)rootKey;
25     (void)rootKeyLen;
26     (void)hash;
27     (void)hashLen;
28     return SOFTBUS_NOT_IMPLEMENT;
29 }
30 
SoftBusAesCfbRootEncrypt(const AesInputData * inData,const EncryptKey * randomKey,EncryptKey * rootKey,int32_t encMode,AesOutputData * outData)31 int32_t SoftBusAesCfbRootEncrypt(const AesInputData *inData, const EncryptKey *randomKey, EncryptKey *rootKey,
32     int32_t encMode, AesOutputData *outData)
33 {
34     (void)inData;
35     (void)randomKey;
36     (void)rootKey;
37     (void)encMode;
38     (void)outData;
39     return SOFTBUS_NOT_IMPLEMENT;
40 }
41 
SoftBusAesCfbEncrypt(const AesInputData * inData,AesCipherKey * cipherKey,int32_t encMode,AesOutputData * outData)42 int32_t SoftBusAesCfbEncrypt(
43     const AesInputData *inData, AesCipherKey *cipherKey, int32_t encMode, AesOutputData *outData)
44 {
45     (void)inData;
46     (void)cipherKey;
47     (void)encMode;
48     (void)outData;
49     return SOFTBUS_NOT_IMPLEMENT;
50 }
51 
SoftBusAesGcmEncrypt(const AesInputData * inData,AesCipherKey * cipherKey,int32_t encMode,AesOutputData * outData)52 int32_t SoftBusAesGcmEncrypt(
53     const AesInputData *inData, AesCipherKey *cipherKey, int32_t encMode, AesOutputData *outData)
54 {
55     (void)inData;
56     (void)cipherKey;
57     (void)encMode;
58     (void)outData;
59     return SOFTBUS_NOT_IMPLEMENT;
60 }
61 
SoftBusEncryptDataByGcm128(AesGcm128CipherKey * cipherKey,const unsigned char * input,uint32_t inLen,unsigned char * encryptData,uint32_t * encryptLen)62 int32_t SoftBusEncryptDataByGcm128(AesGcm128CipherKey *cipherKey, const unsigned char *input, uint32_t inLen,
63     unsigned char *encryptData, uint32_t *encryptLen)
64 {
65     (void)cipherKey;
66     (void)input;
67     (void)inLen;
68     (void)encryptData;
69     (void)encryptLen;
70     return SOFTBUS_NOT_IMPLEMENT;
71 }
72 
SoftBusDecryptDataByGcm128(AesGcm128CipherKey * cipherKey,const unsigned char * input,uint32_t inLen,unsigned char * decryptData,uint32_t * decryptLen)73 int32_t SoftBusDecryptDataByGcm128(AesGcm128CipherKey *cipherKey, const unsigned char *input, uint32_t inLen,
74     unsigned char *decryptData, uint32_t *decryptLen)
75 {
76     (void)cipherKey;
77     (void)input;
78     (void)inLen;
79     (void)decryptData;
80     (void)decryptLen;
81     return SOFTBUS_NOT_IMPLEMENT;
82 }
83 
SoftBusCalcHKDF(const uint8_t * inData,uint32_t inLen,uint8_t * outData,uint32_t outLen)84 int32_t SoftBusCalcHKDF(const uint8_t *inData, uint32_t inLen, uint8_t *outData, uint32_t outLen)
85 {
86     (void)inData;
87     (void)inLen;
88     (void)outData;
89     (void)outLen;
90     return SOFTBUS_NOT_IMPLEMENT;
91 }
92 
93