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_pad_iv - realign the IV as necessary for cipher

Arguments

handle
           [in] cipher handle

       iv
           [in] current IV buffer

       ivlen
           [in] length of IV buffer

       newiv
           [out] buffer of aligned IV

       newivlen
           [out] length of newly aligned IV

Author

StephanMueller <smueller@chronox.de>
           Author.

Description

       The function pads the least significant bits of the provided IV up to the block size of the cipher with
       zeros. In case the provided IV is longer than the block size, the least significant bits are truncated to
       the block size.

       The function allocates memory for newiv in case the return code indicates success. The consumer must free
       the memory after use.

       return 0 for success; a negative errno-style error code if an error occurred

Name

       kcapi_pad_iv - realign the IV as necessary for cipher

Synopsis

intkcapi_pad_iv(structkcapi_handle*handle,constuint8_t*iv,uint32_tivlen,uint8_t**newiv,uint32_t*newivlen);

See Also