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 #ifndef HCF_DETAILED_RSA_KEY_PARAMS_H
17 #define HCF_DETAILED_RSA_KEY_PARAMS_H
18 
19 #include "asy_key_params.h"
20 #include "big_integer.h"
21 
22 typedef struct HcfRsaCommParamsSpec HcfRsaCommParamsSpec;
23 
24 struct HcfRsaCommParamsSpec {
25     HcfAsyKeyParamsSpec base;
26     HcfBigInteger n;
27 };
28 
29 typedef struct HcfRsaPubKeyParamsSpec HcfRsaPubKeyParamsSpec;
30 
31 struct HcfRsaPubKeyParamsSpec {
32     HcfRsaCommParamsSpec base;
33     HcfBigInteger pk;
34 };
35 
36 typedef struct HcfRsaKeyPairParamsSpec HcfRsaKeyPairParamsSpec;
37 
38 struct HcfRsaKeyPairParamsSpec {
39     HcfRsaCommParamsSpec base;
40     HcfBigInteger pk;
41     HcfBigInteger sk;
42 };
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 void FreeRsaCommParamsSpec(HcfRsaCommParamsSpec *spec);
48 
49 void DestroyRsaPubKeySpec(HcfRsaPubKeyParamsSpec *spec);
50 
51 void DestroyRsaKeyPairSpec(HcfRsaKeyPairParamsSpec *spec);
52 
53 #ifdef __cplusplus
54 }
55 #endif
56 #endif // HCF_DETAILED_RSA_KEY_PARAMS_H