diff options
| author | 2018-11-15 20:18:47 -0800 | |
|---|---|---|
| committer | 2018-11-15 20:18:47 -0800 | |
| commit | 75640c9c715c943dc052b0c09d8b312f87319eb5 (patch) | |
| tree | 6011a4915f2dbd6811f41c4755c49807b5a50fe6 /src/core/hle | |
| parent | Merge pull request #1687 from lioncash/deduplication (diff) | |
| parent | csrng: Use random integer distribution instead of raw engine (diff) | |
| download | yuzu-75640c9c715c943dc052b0c09d8b312f87319eb5.tar.gz yuzu-75640c9c715c943dc052b0c09d8b312f87319eb5.tar.xz yuzu-75640c9c715c943dc052b0c09d8b312f87319eb5.zip | |
Merge pull request #1699 from DarkLordZach/deterministic-rng-3
csrng: Use random integer distribution instead of raw engine
Diffstat (limited to 'src/core/hle')
| -rw-r--r-- | src/core/hle/service/spl/module.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/hle/service/spl/module.cpp b/src/core/hle/service/spl/module.cpp index 69c260408..b2de2a818 100644 --- a/src/core/hle/service/spl/module.cpp +++ b/src/core/hle/service/spl/module.cpp | |||
| @@ -28,8 +28,9 @@ void Module::Interface::GetRandomBytes(Kernel::HLERequestContext& ctx) { | |||
| 28 | 28 | ||
| 29 | std::size_t size = ctx.GetWriteBufferSize(); | 29 | std::size_t size = ctx.GetWriteBufferSize(); |
| 30 | 30 | ||
| 31 | std::uniform_int_distribution<u16> distribution(0, std::numeric_limits<u8>::max()); | ||
| 31 | std::vector<u8> data(size); | 32 | std::vector<u8> data(size); |
| 32 | std::generate(data.begin(), data.end(), rng); | 33 | std::generate(data.begin(), data.end(), [&] { return static_cast<u8>(distribution(rng)); }); |
| 33 | 34 | ||
| 34 | ctx.WriteBuffer(data); | 35 | ctx.WriteBuffer(data); |
| 35 | 36 | ||