* This file is part of the openHiTLS project.
*
* openHiTLS is licensed under the Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
*
* http://license.coscl.org.cn/MulanPSL2
*
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
#ifndef DH_LOCAL_H
#define DH_LOCAL_H
#include "hitls_build.h"
#ifdef HITLS_CRYPTO_DH
#include "crypt_bn.h"
#include "crypt_dh.h"
#include "sal_atomic.h"
#ifdef __cplusplus
extern "C" {
#endif
#define DH_MIN_PBITS 768
#define DH_MAX_PBITS 8192
#define DH_MIN_QBITS 160
struct DH_Para {
BN_BigNum *p;
BN_BigNum *q;
BN_BigNum *g;
CRYPT_PKEY_ParaId id;
};
struct DH_Ctx {
BN_BigNum *x;
BN_BigNum *y;
CRYPT_DH_Para *para;
BSL_SAL_RefCount references;
uint32_t flags;
void *libCtx;
};
#ifdef __cplusplus
}
#endif
#endif
#endif