-//call this macro with the rng argument set to output of the call to the ccrng() function
-#define ccrng_generate(rng, outlen, out) ((rng)->generate((struct ccrng_state *)(rng), (outlen), (out)))
+/*!
+ @function ccrng_generate
+ @abstract Generate `outlen` bytes of output, stored in `out`, using ccrng_state `rng`.
+
+ @param rng `struct ccrng_state` representing the state of the RNG.
+ @param outlen Amount of random bytes to generate.
+ @param out Pointer to memory where random bytes are stored, of size at least `outlen`.
+
+ @result 0 on success and nonzero on failure.
+ */
+#define ccrng_generate(rng, outlen, out) \
+ ((rng)->generate((struct ccrng_state *)(rng), (outlen), (out)))
+
+/*!
+ @function ccrng_uniform
+ @abstract Generate a random value in @p [0, bound).
+
+ @param rng The state of the RNG.
+ @param bound The exclusive upper bound on the output.
+ @param rand A pointer to a single @p uint64_t to store the result.
+
+ @result Returns zero iff the operation is successful.
+ */
+int ccrng_uniform(struct ccrng_state *rng, uint64_t bound, uint64_t *rand);