aboutsummaryrefslogtreecommitdiff
path: root/src/lib/intmath
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-10-09 12:59:22 -0400
committerNick Mathewson <nickm@torproject.org>2019-10-22 09:32:13 -0400
commitfb4b6b64360659d7f9807fe9284cf3eab2e64ff3 (patch)
tree5f15486941f93b80435e9bb589ce6859c0e07c45 /src/lib/intmath
parentd1cdb1a24e6289d5ce6f2c1433395abae7185e6e (diff)
downloadtor-fb4b6b64360659d7f9807fe9284cf3eab2e64ff3.tar.gz
tor-fb4b6b64360659d7f9807fe9284cf3eab2e64ff3.zip
weakrng.h: use COCCI to hide a macro coccinelle cannot parse.
Diffstat (limited to 'src/lib/intmath')
-rw-r--r--src/lib/intmath/weakrng.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/intmath/weakrng.h b/src/lib/intmath/weakrng.h
index 40941e59b2..d583c8f79b 100644
--- a/src/lib/intmath/weakrng.h
+++ b/src/lib/intmath/weakrng.h
@@ -19,8 +19,11 @@ typedef struct tor_weak_rng_t {
uint32_t state;
} tor_weak_rng_t;
+#ifndef COCCI
#define TOR_WEAK_RNG_INIT {383745623}
+#endif
#define TOR_WEAK_RANDOM_MAX (INT_MAX)
+
void tor_init_weak_random(tor_weak_rng_t *weak_rng, unsigned seed);
int32_t tor_weak_random(tor_weak_rng_t *weak_rng);
int32_t tor_weak_random_range(tor_weak_rng_t *rng, int32_t top);