diff options
author | matthew <> | 2012-06-24 18:25:12 +0000 |
---|---|---|
committer | matthew <> | 2012-06-24 18:25:12 +0000 |
commit | 70c7378247d7e529a22d43f21101add64a06bdf5 (patch) | |
tree | eac1135834e3aeaff5522b5fef7c5aa8eda177e7 /src/lib/libc/stdlib | |
parent | 66dd580016e3a25e860e9cd6f78cf9aff2846a52 (diff) | |
download | openbsd-70c7378247d7e529a22d43f21101add64a06bdf5.tar.gz openbsd-70c7378247d7e529a22d43f21101add64a06bdf5.tar.bz2 openbsd-70c7378247d7e529a22d43f21101add64a06bdf5.zip |
Change arc4random_uniform() to calculate ``2**32 % upper_bound'' as
``-upper_bound % upper_bound''. Simplifies the code and makes it the
same on both ILP32 and LP64 architectures, and also slightly faster on
LP64 architectures by using a 32-bit remainder instead of a 64-bit
remainder.
Pointed out by Jorden Verwer on tech@
ok deraadt; no objections from djm or otto
Diffstat (limited to 'src/lib/libc/stdlib')
0 files changed, 0 insertions, 0 deletions