• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 HKS_TEST_CIPHER_H
17 #define HKS_TEST_CIPHER_H
18 
19 #include "hks_type.h"
20 
21 struct CipherEncryptStructure {
22     const struct HksBlob *keyAlias;
23     const struct HksTestCipherParamsParamSet *cipherParms;
24     struct HksBlob *plainData;
25     struct HksBlob *cipherData;
26     struct HksBlob **ivData;
27     struct HksBlob **nonceData;
28     struct HksBlob **aadData;
29     uint32_t performTimes;
30 };
31 
32 struct OnlyDecryptStructure {
33     struct HksBlob *keyAlias;
34     const struct HksTestCipherParamsParamSet *cipherParms;
35     struct HksBlob *cipherData;
36     struct HksBlob *decryptedData;
37     struct HksBlob **ivData;
38     struct HksBlob **nonceData;
39     struct HksBlob **aadData;
40     uint32_t performTimes;
41 };
42 
43 struct CipherDecryptStructure {
44     struct HksBlob *keyAlias;
45     const struct HksTestCipherParams *cipherParms;
46     struct HksBlob *cipherData;
47     struct HksBlob **decryptedData;
48     struct HksBlob *ivData;
49     struct HksBlob *nonceData;
50     struct HksBlob *aadData;
51     uint32_t performTimes;
52 };
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 int32_t BaseTestCipher(uint32_t times, uint32_t index, uint32_t performTimes);
59 
60 int32_t BaseTestEncrypt(uint32_t times, uint32_t index, uint32_t performTimes);
61 
62 int32_t BaseTestDecrypt(uint32_t times, uint32_t index, uint32_t performTimes);
63 
64 #ifdef __cplusplus
65 }
66 #endif
67 
68 #endif /* HKS_TEST_COMMON_H */