auth: replace init args with a implementation-specific params struct

This allows for more flexibility in the future.

This commit breaks ChaCha20-Poly1305. It'll be fixed in a subsequent
commit.
This commit is contained in:
Lucas Gabriel Vuotto 2024-06-07 18:40:14 +00:00
parent ccc2836fa8
commit b26a9c7274
7 changed files with 43 additions and 91 deletions

6
auth.h
View file

@ -19,11 +19,11 @@
struct lc_auth_impl {
int (*init)(void *, const uint8_t *, size_t);
int (*init)(void *, const void *);
int (*update)(void *, const uint8_t *, size_t);
int (*final)(void *, uint8_t *, size_t *);
int (*auth)(uint8_t *, size_t *, const uint8_t *, size_t,
const uint8_t *, size_t);
int (*auth)(uint8_t *, size_t *, const void *, const uint8_t *,
size_t);
void *(*ctx_new)(void);
void (*ctx_free)(void *);