30#ifndef OCRYPTO_CHACHA20_POLY1305_INC_H
31#define OCRYPTO_CHACHA20_POLY1305_INC_H
47#define ocrypto_chacha20_poly1305_KEY_BYTES (32)
52#define ocrypto_chacha20_poly1305_NONCE_BYTES_MAX (12)
57#define ocrypto_chacha20_poly1305_TAG_BYTES (16)
62 ocrypto_chacha20_ctx enc_ctx;
63 ocrypto_poly1305_ctx auth_ctx;
66} ocrypto_chacha20_poly1305_ctx;
114 ocrypto_chacha20_poly1305_ctx *ctx,
115 const uint8_t *n,
size_t n_len,
138 ocrypto_chacha20_poly1305_ctx *ctx,
139 const uint8_t *a,
size_t a_len);
163 ocrypto_chacha20_poly1305_ctx *ctx,
165 const uint8_t *m,
size_t m_len);
189 ocrypto_chacha20_poly1305_ctx *ctx,
191 const uint8_t *c,
size_t c_len);
202 ocrypto_chacha20_poly1305_ctx *ctx,
217 ocrypto_chacha20_poly1305_ctx *ctx,
253 const uint8_t *m,
size_t m_len,
254 const uint8_t *a,
size_t a_len,
255 const uint8_t *n,
size_t n_len,
284 const uint8_t *c,
size_t c_len,
285 const uint8_t *a,
size_t a_len,
286 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:47
#define ocrypto_chacha20_poly1305_TAG_BYTES
Definition ocrypto_chacha20_poly1305.h:57
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)])
ChaCha20 and XChaCha20 algorithms.
Poly1305 authentication algorithm.