aboutsummaryrefslogtreecommitdiff
path: root/src/ext/equix/hashx/include/hashx.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ext/equix/hashx/include/hashx.h')
-rw-r--r--src/ext/equix/hashx/include/hashx.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ext/equix/hashx/include/hashx.h b/src/ext/equix/hashx/include/hashx.h
index 2910515d9a..3f6d059b92 100644
--- a/src/ext/equix/hashx/include/hashx.h
+++ b/src/ext/equix/hashx/include/hashx.h
@@ -169,6 +169,25 @@ HASHX_API hashx_result hashx_exec(const hashx_ctx* ctx,
*/
HASHX_API void hashx_free(hashx_ctx* ctx);
+#ifdef HASHX_RNG_CALLBACK
+/*
+ * Set a callback for inspecting or modifying the HashX random number stream.
+ *
+ * The callback and its user pointer are associated with the provided context
+ * even if it's re-used for another hash program. A callback value of NULL
+ * disables the callback.
+ *
+ * @param ctx is pointer to a HashX instance.
+ * @param callback is invoked after each new 64-bit pseudorandom value
+ * is generated in a buffer. The callback may record it and/or replace
+ * it. A NULL pointer here disables the callback.
+ * @param user_data is an opaque parameter given to the callback
+ */
+HASHX_API void hashx_rng_callback(hashx_ctx* ctx,
+ void (*callback)(uint64_t*, void*),
+ void* user_data);
+#endif
+
#ifdef __cplusplus
}
#endif