diff options
author | Paul Duncan <pabs@pablotron.org> | 2024-02-24 03:03:51 -0500 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2024-02-24 03:03:51 -0500 |
commit | a239c34fdbaa56b166ad70cbf078fa139b97f64a (patch) | |
tree | 71ce398d7b9c0d9534fa8c1973bf2fb9f42d2dba /sha3.h | |
parent | b93d06b1e267204859e31ed4fd164771d0ca1cc6 (diff) | |
download | sha3-a239c34fdbaa56b166ad70cbf078fa139b97f64a.tar.bz2 sha3-a239c34fdbaa56b166ad70cbf078fa139b97f64a.zip |
sha3.h: remove duplicate shake group definition, move sha3_xof_t definition to first use
Diffstat (limited to 'sha3.h')
-rw-r--r-- | sha3.h | 38 |
1 files changed, 13 insertions, 25 deletions
@@ -46,18 +46,6 @@ extern "C" { */ /** - * @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 @@ -699,6 +674,19 @@ void hmac_sha3_512_final(hmac_sha3_t *ctx, uint8_t mac[64]); */ /** + * @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 * |