'\" t .\" Title: kcapi_handle_reinit .\" Author: .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: April 2024 .\" Manual: Programming Interface .\" Source: libkcapi Manual 1.4.0 .\" Language: English .\" .TH "KCAPI_HANDLE_REINIT" "3" "April 2024" "libkcapi Manual 1\&.4\&.0" "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_handle_reinit \- re\-initialize a new kernel interface .SH "SYNOPSIS" .HP \w'int\ kcapi_handle_reinit('u .BI "int kcapi_handle_reinit(struct\ kcapi_handle\ **\ " "newhandle" ", struct\ kcapi_handle\ *\ " "existing" ", uint32_t\ " "flags" ");" .SH "ARGUMENTS" .PP \fInewhandle\fR .RS 4 [out] cipher handle filled during the call .RE .PP \fIexisting\fR .RS 4 [in] existing cipher handle from which a new handle shall be re\-initialized .RE .PP \fIflags\fR .RS 4 [in] flags specifying the type of cipher handle .RE .SH "DESCRIPTION" .PP The kernel crypto API interface operates with two types of file descriptors, the TFM file descriptor and the OP file descriptor\&. .PP The TFM file descriptor receives the cipher\-operation static information: the key, and the AEAD tag size\&. .PP The OP file descriptor receives the volatile data, such as the plaintext / ciphertext, the IV, or the AEAD AD size\&. .PP The kernel crypto API AF_ALG interface supports the concept that one TFM file descriptor can operate with multiple OP file descriptors\&. The different OP file descriptors can perform completely separate cipher operations using the same key which can execute in parallel\&. The parallel execution can be performed in the same or different process threads\&. .PP \fBkcapi_handle_reinit\fR function allows the allocation of a new cipher handle with a new OP file descriptor but using the same TFM file descriptor\&. To obtain a reference to the TFM file descriptor, an \fIexisting\fR cipher handle is used as source\&. \fBkcapi_handle_reinit\fR can be invoked multiple times\&. Each resulting cipher handle must be deallocated with \fBkcapi_cipher_destroy\fR\&. The deallocation ensures that the TFM resource is only released if the last handle using this TFM resource is released\&. .PP \fIreturn\fR 0 upon success; \-EINVAL \- accept syscall failed \-ENOMEM \- cipher handle cannot be allocated .SH "AUTHOR" .PP \fBStephan Mueller\fR <\&smueller@chronox.de\&> .RS 4 Author. .RE .SH "COPYRIGHT" .br