diff options
author | matthew <> | 2012-06-24 18:25:12 +0000 |
---|---|---|
committer | matthew <> | 2012-06-24 18:25:12 +0000 |
commit | 26f1ea7161535fd185da9771c961054d978da49c (patch) | |
tree | eac1135834e3aeaff5522b5fef7c5aa8eda177e7 /src/regress | |
parent | e4f72d62c2695455be7c3b29622722dc4b345426 (diff) | |
download | openbsd-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