[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Document crypto_fast_rng_one_in_n.



commit 64f594499a3e8893a6097fa5db7d47962f83d2f5
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Fri Mar 1 08:20:54 2019 -0500

    Document crypto_fast_rng_one_in_n.
---
 src/lib/crypt_ops/crypto_rand.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/lib/crypt_ops/crypto_rand.h b/src/lib/crypt_ops/crypto_rand.h
index bb424fd69..6f09aedf6 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 <b>rng</b>, yield true with probability
+ * 1/<b>n</b>. Otherwise yield false.
+ *
+ * <b>n</b> must not be zero.
+ **/
 #define crypto_fast_rng_one_in_n(rng, n)        \
   (0 == (crypto_fast_rng_get_uint((rng), (n))))
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits