From a239c34fdbaa56b166ad70cbf078fa139b97f64a Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Sat, 24 Feb 2024 03:03:51 -0500 Subject: sha3.h: remove duplicate shake group definition, move sha3_xof_t definition to first use --- sha3.h | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) (limited to 'sha3.h') diff --git a/sha3.h b/sha3.h index 8681473..2453982 100644 --- a/sha3.h +++ b/sha3.h @@ -45,18 +45,6 @@ extern "C" { * "Cryptographic hash function" */ -/** - * @defgroup shake SHAKE - * - * @brief [eXtendable Output Functions (XOF)][xof] with arbitrary length - * output, as defined in section 6.2 of [FIPS 202][]. - * - * [FIPS 202]: https://csrc.nist.gov/pubs/fips/202/final - * "SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions" - * [xof]: https://en.wikipedia.org/wiki/Extendable-output_function - * "Extendable-Output Function (XOF)" - */ - /** * @brief Internal [SHA-3][] state (all members are private). * @ingroup sha3 @@ -82,19 +70,6 @@ typedef struct { _Bool finalized; /**< mode (absorbing or finalized) */ } sha3_t; -/** - * @brief Iterative [XOF][] context (all members are private). - * @ingroup shake - * - * [xof]: https://en.wikipedia.org/wiki/Extendable-output_function - * "Extendable-Output Function (XOF)" - */ -typedef struct { - size_t num_bytes; /**< number of bytes absorbed */ - sha3_state_t a; /**< internal state */ - _Bool squeezing; /**< mode (absorbing or squeezing) */ -} sha3_xof_t; - /*! * @brief Calculate SHA3-224 hash of input data. * @ingroup sha3 @@ -698,6 +673,19 @@ void hmac_sha3_512_final(hmac_sha3_t *ctx, uint8_t mac[64]); * "Extendable-Output Function (XOF)" */ +/** + * @brief Iterative [XOF][] context (all members are private). + * @ingroup shake + * + * [xof]: https://en.wikipedia.org/wiki/Extendable-output_function + * "Extendable-Output Function (XOF)" + */ +typedef struct { + size_t num_bytes; /**< number of bytes absorbed */ + sha3_state_t a; /**< internal state */ + _Bool squeezing; /**< mode (absorbing or squeezing) */ +} sha3_xof_t; + /** * @brief Initialize SHAKE128 [extendable-output function (XOF)][xof] context. * @ingroup shake -- cgit v1.2.3