openHiTLS API openHiTLS 0.1.0-Alpha1

◆ CRYPT_CalcDhSharedSecretCallback

typedef int32_t(* CRYPT_CalcDhSharedSecretCallback) (HITLS_CRYPT_Key *key, uint8_t *peerPubkey, uint32_t pubKeyLen, uint8_t *sharedSecret, uint32_t *sharedSecretLen)

DH: Calculate the shared key based on the local key and peer public key.

参数
key[IN] Key handle
peerPubkey[IN] Public key data
pubKeyLen[IN] Public key data length
sharedSecret[OUT] Shared key
sharedSecretLen[IN/OUT] IN: Maximum length of the key padding OUT: Key length
返回值
0indicates success. Other values indicate failure.