openHiTLS API openHiTLS 0.1.0-Alpha1

◆ CRYPT_EAL_CipherCtrl()

int32_t CRYPT_EAL_CipherCtrl ( CRYPT_EAL_CipherCtx ctx,
int32_t  type,
void *  data,
uint32_t  len 
)

Set the mode ctx parameters in the CTX. parameter data type Length(len):number of data bytes CRYPT_CTRL_GET_IV uint8_t array The length of the IV depends on the corresponding algorithm, see the mapping in CRYPT_EAL_CipherInit CRYPT_CTRL_SET_IV uint8_t array The length of the IV depends on the corresponding algorithm, see the mapping in CRYPT_EAL_CipherInit. CRYPT_CTRL_SET_AAD uint8_t array It is used only for AEAD calculation. The length is related to the corresponding AEAD algorithm. CRYPT_CTRL_GET_TAG uint8_t array It is used only for AEAD calculation. The length is the tagLen value set by the user. CRYPT_CTRL_SET_COUNT uint8_t[4] length(len) 4 CRYPT_CTRL_SET_TAGLEN uint32_t length(len) 4 CRYPT_CTRL_SET_MSGLEN uint64_t length(len) 8 CRYPT_CTRL_SET_FEEDBACKSIZE uint32_t length(len) 4 CRYPT_CTRL_GET_FEEDBACKSIZE uint32_t pointer sizeof(*uint32_t) CRYPT_CTRL_GET_BLOCKSIZE uint32_t length(len) 4 CRYPT_CTRL_SET_SM4_CONSTTIME NULL 0

注意
If the function is called by an external user and the error stack is concerned, it is recommended that BSL_ERR_ClearError() be called before this function is called.
参数
ctx[IN] Symmetric encryption/decryption handle
type[IN] Parameter type
data[IN/OUT] Input and output data
len[OUT] Data length
返回值
CRYPT_SUCCESS,success.error codes see the crypt_errno.h