summaryrefslogtreecommitdiff
path: root/sha3.h
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2024-02-24 03:03:51 -0500
committerPaul Duncan <pabs@pablotron.org>2024-02-24 03:03:51 -0500
commita239c34fdbaa56b166ad70cbf078fa139b97f64a (patch)
tree71ce398d7b9c0d9534fa8c1973bf2fb9f42d2dba /sha3.h
parentb93d06b1e267204859e31ed4fd164771d0ca1cc6 (diff)
downloadsha3-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.h38
1 files changed, 13 insertions, 25 deletions
diff --git a/sha3.h b/sha3.h
index 8681473..2453982 100644
--- a/sha3.h
+++ b/sha3.h
@@ -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
*