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_DSA_KEY_PARAMS_H 17 #define HCF_DETAILED_DSA_KEY_PARAMS_H 18 19 #include "asy_key_params.h" 20 #include "big_integer.h" 21 22 typedef struct HcfDsaCommParamsSpec HcfDsaCommParamsSpec; 23 24 struct HcfDsaCommParamsSpec { 25 HcfAsyKeyParamsSpec base; 26 HcfBigInteger p; 27 HcfBigInteger q; 28 HcfBigInteger g; 29 }; 30 31 typedef struct HcfDsaPubKeyParamsSpec HcfDsaPubKeyParamsSpec; 32 33 struct HcfDsaPubKeyParamsSpec { 34 HcfDsaCommParamsSpec base; 35 HcfBigInteger pk; 36 }; 37 38 typedef struct HcfDsaKeyPairParamsSpec HcfDsaKeyPairParamsSpec; 39 40 struct HcfDsaKeyPairParamsSpec { 41 HcfDsaCommParamsSpec base; 42 HcfBigInteger pk; 43 HcfBigInteger sk; 44 }; 45 46 #ifdef __cplusplus 47 extern "C" { 48 #endif 49 50 void FreeDsaCommParamsSpec(HcfDsaCommParamsSpec *spec); 51 52 void DestroyDsaPubKeySpec(HcfDsaPubKeyParamsSpec *spec); 53 54 void DestroyDsaKeyPairSpec(HcfDsaKeyPairParamsSpec *spec); 55 56 #ifdef __cplusplus 57 } 58 #endif 59 #endif 60