'\" t .\" Title: kcapi_pad_iv .\" Author: .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: November 2020 .\" Manual: Programming Interface .\" Source: libkcapi Manual 1.2.1 .\" Language: English .\" .TH "KCAPI_PAD_IV" "3" "November 2020" "libkcapi Manual 1\&.2\&.1" "Programming Interface" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" kcapi_pad_iv \- realign the IV as necessary for cipher .SH "SYNOPSIS" .HP \w'int\ kcapi_pad_iv('u .BI "int kcapi_pad_iv(struct\ kcapi_handle\ *\ " "handle" ", const\ uint8_t\ *\ " "iv" ", uint32_t\ " "ivlen" ", uint8_t\ **\ " "newiv" ", uint32_t\ *\ " "newivlen" ");" .SH "ARGUMENTS" .PP \fIhandle\fR .RS 4 [in] cipher handle .RE .PP \fIiv\fR .RS 4 [in] current IV buffer .RE .PP \fIivlen\fR .RS 4 [in] length of IV buffer .RE .PP \fInewiv\fR .RS 4 [out] buffer of aligned IV .RE .PP \fInewivlen\fR .RS 4 [out] length of newly aligned IV .RE .SH "DESCRIPTION" .PP 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\&. .PP The function allocates memory for newiv in case the return code indicates success\&. The consumer must free the memory after use\&. .PP \fIreturn\fR 0 for success; a negative errno\-style error code if an error occurred .SH "AUTHOR" .PP \fBStephan Mueller\fR <\&smueller@chronox.de\&> .RS 4 Author. .RE .SH "COPYRIGHT" .br