24#ifndef OCRYPTO_CHACHA20_POLY1305_INC_H
25#define OCRYPTO_CHACHA20_POLY1305_INC_H
41#define ocrypto_chacha20_poly1305_KEY_BYTES (32)
46#define ocrypto_chacha20_poly1305_NONCE_BYTES_MAX (12)
51#define ocrypto_chacha20_poly1305_TAG_BYTES (16)
56 ocrypto_chacha20_ctx enc_ctx;
57 ocrypto_poly1305_ctx auth_ctx;
60} ocrypto_chacha20_poly1305_ctx;
107 ocrypto_chacha20_poly1305_ctx *ctx,
108 const uint8_t *n,
size_t n_len,
129 ocrypto_chacha20_poly1305_ctx *ctx,
130 const uint8_t *a,
size_t a_len);
154 ocrypto_chacha20_poly1305_ctx *ctx,
156 const uint8_t *m,
size_t m_len);
180 ocrypto_chacha20_poly1305_ctx *ctx,
182 const uint8_t *c,
size_t c_len);
193 ocrypto_chacha20_poly1305_ctx *ctx,
208 ocrypto_chacha20_poly1305_ctx *ctx,
242 const uint8_t *m,
size_t m_len,
243 const uint8_t *a,
size_t a_len,
244 const uint8_t *n,
size_t n_len,
273 const uint8_t *c,
size_t c_len,
274 const uint8_t *a,
size_t a_len,
275 const uint8_t *n,
size_t n_len,
void ocrypto_chacha20_poly1305_update_enc(ocrypto_chacha20_poly1305_ctx *ctx, uint8_t *c, const uint8_t *m, size_t m_len)
int ocrypto_chacha20_poly1305_decrypt(const uint8_t tag[(16)], uint8_t *m, const uint8_t *c, size_t c_len, const uint8_t *a, size_t a_len, const uint8_t *n, size_t n_len, const uint8_t k[(32)])
void ocrypto_chacha20_poly1305_update_aad(ocrypto_chacha20_poly1305_ctx *ctx, const uint8_t *a, size_t a_len)
#define ocrypto_chacha20_poly1305_KEY_BYTES
Definition: ocrypto_chacha20_poly1305.h:41
#define ocrypto_chacha20_poly1305_TAG_BYTES
Definition: ocrypto_chacha20_poly1305.h:51
void ocrypto_chacha20_poly1305_update_dec(ocrypto_chacha20_poly1305_ctx *ctx, uint8_t *m, const uint8_t *c, size_t c_len)
int ocrypto_chacha20_poly1305_final_dec(ocrypto_chacha20_poly1305_ctx *ctx, const uint8_t tag[(16)])
void ocrypto_chacha20_poly1305_encrypt(uint8_t tag[(16)], uint8_t *c, const uint8_t *m, size_t m_len, const uint8_t *a, size_t a_len, const uint8_t *n, size_t n_len, const uint8_t k[(32)])
void ocrypto_chacha20_poly1305_init(ocrypto_chacha20_poly1305_ctx *ctx, const uint8_t *n, size_t n_len, const uint8_t k[(32)])
void ocrypto_chacha20_poly1305_final_enc(ocrypto_chacha20_poly1305_ctx *ctx, uint8_t tag[(16)])