'\" t
.\"     Title: kcapi_md_init
.\"    Author: 
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\"      Date: February 2022
.\"    Manual: Programming Interface
.\"    Source: libkcapi Manual 1.4.0
.\"  Language: English
.\"
.TH "KCAPI_MD_INIT" "3" "February 2022" "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_md_init \- initialize cipher handle
.SH "SYNOPSIS"
.HP \w'int\ kcapi_md_init('u
.BI "int kcapi_md_init(struct\ kcapi_handle\ **\ " "handle" ", const\ char\ *\ " "ciphername" ", uint32_t\ " "flags" ");"
.SH "ARGUMENTS"
.PP
\fIhandle\fR
.RS 4
[out] cipher handle filled during the call
.RE
.PP
\fIciphername\fR
.RS 4
[in] kernel crypto API cipher name as specified in /proc/crypto
.RE
.PP
\fIflags\fR
.RS 4
[in] flags specifying the type of cipher handle
.RE
.SH "DESCRIPTION"
.PP
This function provides the initialization of a (keyed) message digest handle and establishes the connection to the kernel\&.
.PP
On success, a pointer to kcapi_handle object is returned in *handle\&. Function kcapi_md_destroy should be called afterwards to free resources\&.
.PP
\fIreturn\fR
0 upon success; \-ENOENT \- algorithm not available; \-EOPNOTSUPP \- AF_ALG family not available; \-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