summaryrefslogtreecommitdiff
path: root/src/regress
diff options
context:
space:
mode:
authormatthew <>2012-06-24 18:25:12 +0000
committermatthew <>2012-06-24 18:25:12 +0000
commit26f1ea7161535fd185da9771c961054d978da49c (patch)
treeeac1135834e3aeaff5522b5fef7c5aa8eda177e7 /src/regress
parente4f72d62c2695455be7c3b29622722dc4b345426 (diff)
downloadopenbsd-26f1ea7161535fd185da9771c961054d978da49c.tar.gz
openbsd-26f1ea7161535fd185da9771c961054d978da49c.tar.bz2
openbsd-26f1ea7161535fd185da9771c961054d978da49c.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/regress')
0 files changed, 0 insertions, 0 deletions