diff options
author | George Kadianakis <desnacked@riseup.net> | 2019-01-10 12:54:55 +0200 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2019-01-10 13:06:08 +0200 |
commit | e0e0338dc42ed786979759d56e0b65f129a5df8c (patch) | |
tree | 194725bdba30a390aa470dc5614eb399b6780da6 /src/lib/math | |
parent | f4938179c50cc385b7599e5a03388792e46cde83 (diff) | |
download | tor-e0e0338dc42ed786979759d56e0b65f129a5df8c.tar.gz tor-e0e0338dc42ed786979759d56e0b65f129a5df8c.zip |
Rename crypto_rand_uint32() -> crypto_rand_u32()
See https://github.com/torproject/tor/pull/624#discussion_r246453777
Diffstat (limited to 'src/lib/math')
-rw-r--r-- | src/lib/math/prob_distr.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/math/prob_distr.c b/src/lib/math/prob_distr.c index 832d3b4d96..f5e5218aa7 100644 --- a/src/lib/math/prob_distr.c +++ b/src/lib/math/prob_distr.c @@ -458,7 +458,7 @@ random_uniform_01(void) * system is broken. */ z = 0; - while ((x = crypto_rand_uint32()) == 0) { + while ((x = crypto_rand_u32()) == 0) { if (z >= 1088) /* Your bit sampler is broken. Go home. */ return 0; @@ -472,8 +472,8 @@ random_uniform_01(void) * occur only with measure zero in the uniform distribution on * [0, 1]. */ - hi = crypto_rand_uint32() | UINT32_C(0x80000000); - lo = crypto_rand_uint32() | UINT32_C(0x00000001); + hi = crypto_rand_u32() | UINT32_C(0x80000000); + lo = crypto_rand_u32() | UINT32_C(0x00000001); /* Round to nearest scaled significand in [2^63, 2^64]. */ s = hi*(double)4294967296 + lo; @@ -1402,7 +1402,7 @@ logistic_sample(const struct dist *dist) { const struct logistic *L = const_container_of(dist, struct logistic, base); - uint32_t s = crypto_rand_uint32(); + uint32_t s = crypto_rand_u32(); double t = random_uniform_01(); double p0 = random_uniform_01(); @@ -1460,7 +1460,7 @@ log_logistic_sample(const struct dist *dist) { const struct log_logistic *LL = const_container_of(dist, struct log_logistic, base); - uint32_t s = crypto_rand_uint32(); + uint32_t s = crypto_rand_u32(); double p0 = random_uniform_01(); return sample_log_logistic_scaleshape(s, p0, LL->alpha, LL->beta); @@ -1517,7 +1517,7 @@ weibull_sample(const struct dist *dist) { const struct weibull *W = const_container_of(dist, struct weibull, base); - uint32_t s = crypto_rand_uint32(); + uint32_t s = crypto_rand_u32(); double p0 = random_uniform_01(); return sample_weibull(s, p0, W->lambda, W->k); @@ -1574,7 +1574,7 @@ genpareto_sample(const struct dist *dist) { const struct genpareto *GP = const_container_of(dist, struct genpareto, base); - uint32_t s = crypto_rand_uint32(); + uint32_t s = crypto_rand_u32(); double p0 = random_uniform_01(); return sample_genpareto_locscale(s, p0, GP->mu, GP->sigma, GP->xi); @@ -1621,7 +1621,7 @@ genpareto_isf(const struct dist *dist, double p) double geometric_sample(double p) { - uint32_t s = crypto_rand_uint32(); + uint32_t s = crypto_rand_u32(); double p0 = random_uniform_01(); return sample_geometric(s, p0, p); } |