29#ifndef LCX_CHACHA_POLY_H
30#define LCX_CHACHA_POLY_H
32#if defined(HAVE_CHACHA_POLY)
33#if defined(HAVE_POLY1305) && defined(HAVE_CHACHA)
41 cx_chacha_context_t chacha20_ctx;
42 cx_poly1305_context_t poly1305_ctx;
44 size_t ciphertext_len;
47} cx_chachapoly_context_t;
49void cx_chachapoly_init(cx_chachapoly_context_t *ctx);
51WARN_UNUSED_RESULT cx_err_t cx_chachapoly_set_key(cx_chachapoly_context_t *ctx,
55WARN_UNUSED_RESULT cx_err_t cx_chachapoly_start(cx_chachapoly_context_t *ctx,
60WARN_UNUSED_RESULT cx_err_t cx_chachapoly_update_aad(cx_chachapoly_context_t *ctx,
64WARN_UNUSED_RESULT cx_err_t cx_chachapoly_update(cx_chachapoly_context_t *ctx,
69WARN_UNUSED_RESULT cx_err_t cx_chachapoly_finish(cx_chachapoly_context_t *ctx,
73WARN_UNUSED_RESULT cx_err_t cx_chachapoly_encrypt_and_tag(cx_chachapoly_context_t *ctx,
84WARN_UNUSED_RESULT cx_err_t cx_chachapoly_decrypt_and_auth(cx_chachapoly_context_t *ctx,
95WARN_UNUSED_RESULT cx_err_t cx_chachapoly_check_tag(cx_chachapoly_context_t *ctx,
POLY1305 Message Authentication Code.