logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

kcapi_cipher_dec_sm4_cbc - Convenience function for SM4 CBC decryption

Arguments

key
           [in] key buffer

       keylen
           [in] length of key buffer

       in
           [in] ciphertext data buffer

       inlen
           [in] length of in buffer

       iv
           [in] IV to be used for cipher operation

       out
           [out] plaintext data buffer

       outlen
           [in] length of out buffer

Author

StephanMueller <smueller@chronox.de>
           Author.

Description

       The convenience function performs an SM4 CBC decryption operation using the provided key, the given input
       buffer and the given IV. The output is stored in the out buffer.

       Note, SM4 CBC requires an input data that is a multiple of 16 bytes. If you have data that is not
       guaranteed to be multiples of 16 bytes, either add zero bytes at the end of the buffer to pad it up to a
       multiple of 16 bytes. Otherwise, the CTR mode encryption operation may be usable.

       The output buffer must be at least as large as the input buffer.

       The IV must be exactly 16 bytes in size.

       The SM4 key is fixed 16 bytes long.

       return number of bytes generated upon success; a negative errno-style error code if an error occurred

Name

       kcapi_cipher_dec_sm4_cbc - Convenience function for SM4 CBC decryption

Synopsis

ssize_tkcapi_cipher_dec_sm4_cbc(constuint8_t*key,uint32_tkeylen,constuint8_t*in,size_tinlen,constuint8_t*iv,uint8_t*out,size_toutlen);

See Also