From af3fe8a67ae12d6640e1b6f2d96fbccbc8bd7b79 Mon Sep 17 00:00:00 2001 From: Lucas Gabriel Vuotto Date: Sun, 9 Jun 2024 14:55:34 +0000 Subject: [PATCH] lilcrypto.h: group all struct defintions together --- lilcrypto.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/lilcrypto.h b/lilcrypto.h index c5fdae7..9974e47 100644 --- a/lilcrypto.h +++ b/lilcrypto.h @@ -51,10 +51,25 @@ /* - * Arguments. + * Structs. */ -/* Authentication */ +struct lc_aead_impl; + +struct lc_auth_ctx; +struct lc_auth_impl; + +struct lc_cipher_ctx; +struct lc_cipher_impl; + +struct lc_hash_ctx; +struct lc_hash_impl; + +/* + * Parameters. + */ + +/* Authentication. */ struct lc_hmac_params { size_t keylen; @@ -103,10 +118,6 @@ uint32_t lc_ct_cmp(const uint8_t *, const uint8_t *, size_t); * Hashes. */ -struct lc_hash_ctx; -struct lc_hash_impl; - - int lc_hash_init(struct lc_hash_ctx *); int lc_hash_update(struct lc_hash_ctx *, const uint8_t *, size_t); int lc_hash_final(struct lc_hash_ctx *, uint8_t *, size_t *); @@ -126,10 +137,6 @@ const struct lc_hash_impl *lc_hash_impl_sha512(void); * Authentication. */ -struct lc_auth_ctx; -struct lc_auth_impl; - - int lc_auth_init(struct lc_auth_ctx *, const void *); int lc_auth_update(struct lc_auth_ctx *, const uint8_t *, size_t); int lc_auth_final(struct lc_auth_ctx *, uint8_t *, size_t *); @@ -150,10 +157,6 @@ const struct lc_auth_impl *lc_auth_impl_hmac_sha512(void); * Ciphers. */ -struct lc_cipher_ctx; -struct lc_cipher_impl; - - int lc_cipher_encrypt_init(struct lc_cipher_ctx *, const void *); int lc_cipher_encrypt_update(struct lc_cipher_ctx *, uint8_t *, size_t *, const uint8_t *, size_t); @@ -178,9 +181,6 @@ const struct lc_cipher_impl *lc_cipher_impl_xchacha20(void); * Authenticated encryption with additional data. */ -struct lc_aead_impl; - - int lc_aead_seal(const struct lc_aead_impl *, uint8_t *, size_t *, const void *, const uint8_t *, size_t, const uint8_t *, size_t); int lc_aead_open(const struct lc_aead_impl *, uint8_t *, size_t *,