From: Nick Mathewson Date: Fri, 1 Mar 2019 13:20:54 +0000 (-0500) Subject: Document crypto_fast_rng_one_in_n. X-Git-Tag: tor-0.4.1.1-alpha~182^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=64f594499a3e8893a6097fa5db7d47962f83d2f5;p=thirdparty%2Ftor.git Document crypto_fast_rng_one_in_n. --- diff --git a/src/lib/crypt_ops/crypto_rand.h b/src/lib/crypt_ops/crypto_rand.h index bb424fd691..6f09aedf6a 100644 --- a/src/lib/crypt_ops/crypto_rand.h +++ b/src/lib/crypt_ops/crypto_rand.h @@ -68,6 +68,12 @@ unsigned crypto_fast_rng_get_uint(crypto_fast_rng_t *rng, unsigned limit); uint64_t crypto_fast_rng_get_uint64(crypto_fast_rng_t *rng, uint64_t limit); double crypto_fast_rng_get_double(crypto_fast_rng_t *rng); +/** + * Using the fast_rng rng, yield true with probability + * 1/n. Otherwise yield false. + * + * n must not be zero. + **/ #define crypto_fast_rng_one_in_n(rng, n) \ (0 == (crypto_fast_rng_get_uint((rng), (n))))