5 Commits
Author SHA1 Message Date
dualfroz 9a2042ab9c Describe this repository 2026-10-22 21:05:45 +02:00
dualfroz e11375a882 fix: allow increment of 1 in Monotonic entropy for io.Reader sources
MonotonicEntropy.random rejected a validly drawn value of 0 in its
rejection-sampling loop, making an increment of exactly 1 unreachable
for entropy sources without a fast Int63n path (e.g. crypto/rand.Reader).
For inc == 2 this made the increment fully deterministic (always 2),
contradicting the documented "random number between 1 and inc inclusive"
contract. Restructure the loop to match the crypto/rand.Int pattern it is
adapted from, so 0 is a valid draw and the result is correctly uniform
over [1, inc].
2026-09-04 04:36:21 +02:00
upstream e2c3f62f18 Upstream oklog/ulid state of the touched files before a7f0dceacf 2026-09-04 04:36:21 +02:00
dualfroz 4c737a9be4 fix: allow increment of 1 in Monotonic entropy for io.Reader sources
MonotonicEntropy.random rejected a validly drawn value of 0 in its
rejection-sampling loop, making an increment of exactly 1 unreachable
for entropy sources without a fast Int63n path (e.g. crypto/rand.Reader).
For inc == 2 this made the increment fully deterministic (always 2),
contradicting the documented "random number between 1 and inc inclusive"
contract. Restructure the loop to match the crypto/rand.Int pattern it is
adapted from, so 0 is a valid draw and the result is correctly uniform
over [1, inc].
2026-09-06 01:24:59 +02:00
upstream 8b0a7fd89a Upstream oklog/ulid state of the touched files before d52271c696 2026-09-04 04:36:21 +02:00