---
name: "kcapi_md_init"
section: "3"
platform: "linux"
package: "libkcapi-dev"
version: "1.4.0-1+b2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/kcapi_md_init"
---

# kcapi\_md\_init(3)

initialize cipher handle

## NAME

kcapi\_md\_init - initialize cipher handle

## SYNOPSIS

**int kcapi\_md\_init(struct kcapi\_handle \*\*** *handle***, const char \*** *ciphername***, uint32\_t** *flags***);**

## ARGUMENTS

*handle*

\[out\] cipher handle filled during the call

*ciphername*

\[in\] kernel crypto API cipher name as specified in /proc/crypto

*flags*

\[in\] flags specifying the type of cipher handle

## DESCRIPTION

This function provides the initialization of a (keyed) message digest handle and establishes the connection to the kernel.

On success, a pointer to kcapi\_handle object is returned in \*handle. Function kcapi\_md\_destroy should be called afterwards to free resources.

*return* 0 upon success; -ENOENT - algorithm not available; -EOPNOTSUPP - AF\_ALG family not available; -EINVAL - accept syscall failed; -ENOMEM - cipher handle cannot be allocated

## AUTHOR

**Stephan Mueller** \<smueller@chronox.de\>

Author.

## COPYRIGHT
