openHiTLS API openHiTLS 0.1.0-Alpha1

◆ CRYPT_EncryptCallback

typedef int32_t(* CRYPT_EncryptCallback) (const HITLS_CipherParameters *cipher, const uint8_t *in, uint32_t inLen, uint8_t *out, uint32_t *outLen)

TLS encryption

Provides the encryption capability for records, including the AEAD and CBC algorithms. Encrypts the input factor (key parameter) and plaintext based on the record protocol to obtain the ciphertext.

注意
: The protocol allows the sending of app packets with payload length 0. Therefore, the length of the plaintext input may be 0. Therefore, the plaintext with the length of 0 must be encrypted.
参数
cipher[IN] Key parameters
in[IN] Plaintext data
inLen[IN] Plaintext data length
out[OUT] Ciphertext data
outLen[IN/OUT] IN: maximum buffer length OUT: ciphertext data length
返回值
0indicates success. Other values indicate failure.