[PATCH] D34517: [scudo] PRNG makeover

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 22 09:54:55 PDT 2017


cryptoad created this revision.

This follows the addition of `GetRandom` with https://reviews.llvm.org/D34412. We remove our
/dev/urandom code and use the new function. Additionally, change the PRNG for
a slightly faster version. One of the issues with the old code is that we have
64 full bits of randomness per `next`, using only 8 of those for the `Salt` and
discarding the rest. So we add a cached u64 in the PRNG that can serve up to
8 u8 before having to call the `next` function again.


https://reviews.llvm.org/D34517

Files:
  lib/scudo/scudo_allocator.cpp
  lib/scudo/scudo_tls.h
  lib/scudo/scudo_utils.cpp
  lib/scudo/scudo_utils.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34517.103594.patch
Type: text/x-patch
Size: 6201 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170622/0508eeac/attachment.bin>


More information about the llvm-commits mailing list