📄 wps_crypto.h
字号:
/*
* WPS_CRYPTO.H : WPS Encrypt/Decrypt Interface Definition
*
* ver date author comment
* 0.0.1 07/12/25 Gao Hua First
*/
#ifndef _WPS_CRYPTO_H
#define _WPS_CRYPTO_H
#include "wps_types.h"
#include "wps_common.h"
typedef void *WPS_DH_P;
WPS_DH_P WPS_dh_new(void);
void WPS_dh_free(WPS_DH_P pDH);
/* WPS_dh_generate_pubkey
* Return values:
* -1: Failed.
* n: Number of bytes copied to PubKeyBuff.
*/
int WPS_dh_generate_pubkey(WPS_DH_P pDH, const WPS_char *p, const WPS_char *g, WPS_u8 *PubKeyBuff, int BuffLen);
/* WPS_dh_sharedkey_size
* Return values:
* -1: Failed.
* n: Bytes of DH shared key.
*/
int WPS_dh_sharedkey_size(WPS_DH_P pDH);
/* WPS_dh_compute_sharedkey
* Return values:
* -1: Failed.
* n: Number of bytes copied to SharedKeyBuff.
*/
int WPS_dh_compute_sharedkey(WPS_DH_P pDH, const WPS_u8 *HisPubKey, int HisPubKeyLen, WPS_u8 *SharedKeyBuff, int BuffLen);
int WPS_Md5(const WPS_u8 *Input, int InputLen, WPS_u8 *Output, int OutputBuffLen);
int WPS_Sha256(const WPS_u8 *Input, int InputLen, WPS_u8 *Output, int OutputBuffLen);
int WPS_HMAC_Sha256(const WPS_u8 *Key, int KeyLen, const WPS_u8 *Input, int InputLen, WPS_u8 *Output, int OutputBuffLen);
int WPS_AES_CBC_Encrypt(const WPS_u8 *Key, int KeyLen, WPS_u8 *IV, int IVLen, const WPS_u8 *Input, int InputLen, WPS_u8 *Output, int OutputBuffLen);
int WPS_AES_CBC_Decrypt(const WPS_u8 *Key, int KeyLen, WPS_u8 *IV, int IVLen, const WPS_u8 *Input, int InputLen, WPS_u8 *Output, int OutputBuffLen);
int WPS_Rand(WPS_u8 *Buff, int BuffLen);
#endif /* _WPS_CRYPTO_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -