
ngtcp2_crypto_encrypt
=====================

Synopsis
--------

*#include <ngtcp2/ngtcp2_crypto.h>*

.. function:: int ngtcp2_crypto_encrypt(uint8_t *dest, const ngtcp2_crypto_aead *aead, const ngtcp2_crypto_aead_ctx *aead_ctx, const uint8_t *plaintext, size_t plaintextlen, const uint8_t *nonce, size_t noncelen, const uint8_t *aad, size_t aadlen)

    
    `ngtcp2_crypto_encrypt` encrypts *plaintext* of length
    *plaintextlen* and writes the ciphertext into the buffer pointed by
    *dest*.  The length of ciphertext is *plaintextlen* +
    :member:`aead->max_overhead <ngtcp2_crypto_aead.max_overhead>`
    bytes long.  *dest* must have enough capacity to store the
    ciphertext.  *dest* and *plaintext* may point to the same buffer.
    
    This function returns 0 if it succeeds, or -1.
