---
name: "crypto_aead_encrypt"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/crypto_aead_encrypt"
---

# crypto\_aead\_encrypt(9)

encrypt plaintext

## NAME

crypto\_aead\_encrypt - encrypt plaintext

## SYNOPSIS

**int crypto\_aead\_encrypt(struct aead\_request \*** *req***);**

## ARGUMENTS

*req*

reference to the aead\_request handle that holds all information needed to perform the cipher operation

## DESCRIPTION

Encrypt plaintext data using the aead\_request handle. That data structure and how it is filled with data is discussed with the aead\_request\_\* functions.

IMPORTANT NOTE The encryption operation creates the authentication data / tag. That data is concatenated with the created ciphertext. The ciphertext memory size is therefore the given number of block cipher blocks + the size defined by the crypto\_aead\_setauthsize invocation. The caller must ensure that sufficient memory is available for the ciphertext and the authentication tag.

## RETURN

0 if the cipher operation was successful; \< 0 if an error occurred

## AUTHORS

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

Author.

**Marek Vasut** \<marek@denx.de\>

Author.

## COPYRIGHT
