59#ifndef MBEDTLS_CHACHA20_H
60#define MBEDTLS_CHACHA20_H
62#if !defined(MBEDTLS_CONFIG_FILE)
65#include MBEDTLS_CONFIG_FILE
71#define MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA -0x0051
75#define MBEDTLS_ERR_CHACHA20_FEATURE_UNAVAILABLE -0x0053
79#define MBEDTLS_ERR_CHACHA20_HW_ACCEL_FAILED -0x0055
85#if !defined(MBEDTLS_CHACHA20_ALT)
96#include "chacha20_alt.h"
144 const unsigned char key[32] );
166 const unsigned char nonce[12],
200 const unsigned char *
input,
201 unsigned char *output );
232 const unsigned char nonce[12],
235 const unsigned char*
input,
236 unsigned char* output );
238#if defined(MBEDTLS_SELF_TEST)
245int mbedtls_chacha20_self_test(
int verbose );
void mbedtls_chacha20_free(mbedtls_chacha20_context *ctx)
This function releases and clears the specified ChaCha20 context.
int mbedtls_chacha20_crypt(const unsigned char key[32], const unsigned char nonce[12], uint32_t counter, size_t size, const unsigned char *input, unsigned char *output)
This function encrypts or decrypts data with ChaCha20 and the given key and nonce.
int mbedtls_chacha20_setkey(mbedtls_chacha20_context *ctx, const unsigned char key[32])
This function sets the encryption/decryption key.
void mbedtls_chacha20_init(mbedtls_chacha20_context *ctx)
This function initializes the specified ChaCha20 context.
int mbedtls_chacha20_starts(mbedtls_chacha20_context *ctx, const unsigned char nonce[12], uint32_t counter)
This function sets the nonce and initial counter value.
int mbedtls_chacha20_update(mbedtls_chacha20_context *ctx, size_t size, const unsigned char *input, unsigned char *output)
This function encrypts or decrypts data.
GLenum GLenum GLenum input
size_t keystream_bytes_used