diff options
| author | 2018-11-14 11:52:27 -0800 | |
|---|---|---|
| committer | 2018-11-14 11:52:27 -0800 | |
| commit | e1ea8cc7214be591067959a3697ed53e95007ac2 (patch) | |
| tree | 8f4fc978a5799fc729522377fd7a85ccf51b91c2 /src/core/hle/kernel/process.h | |
| parent | Merge pull request #1662 from FreddyFunk/CopySurface-Optimization (diff) | |
| parent | svc: Use proper random entropy generation algorithm (diff) | |
| download | yuzu-e1ea8cc7214be591067959a3697ed53e95007ac2.tar.gz yuzu-e1ea8cc7214be591067959a3697ed53e95007ac2.tar.xz yuzu-e1ea8cc7214be591067959a3697ed53e95007ac2.zip | |
Merge pull request #1679 from DarkLordZach/deterministic-rng-2
svc: Use proper random entropy generation algorithm
Diffstat (limited to 'src/core/hle/kernel/process.h')
| -rw-r--r-- | src/core/hle/kernel/process.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index f79f6d7a5..cf48787ce 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <bitset> | 8 | #include <bitset> |
| 9 | #include <cstddef> | 9 | #include <cstddef> |
| 10 | #include <memory> | 10 | #include <memory> |
| 11 | #include <random> | ||
| 11 | #include <string> | 12 | #include <string> |
| 12 | #include <vector> | 13 | #include <vector> |
| 13 | #include <boost/container/static_vector.hpp> | 14 | #include <boost/container/static_vector.hpp> |
| @@ -119,6 +120,8 @@ struct CodeSet final { | |||
| 119 | 120 | ||
| 120 | class Process final : public Object { | 121 | class Process final : public Object { |
| 121 | public: | 122 | public: |
| 123 | static constexpr std::size_t RANDOM_ENTROPY_SIZE = 4; | ||
| 124 | |||
| 122 | static SharedPtr<Process> Create(KernelCore& kernel, std::string&& name); | 125 | static SharedPtr<Process> Create(KernelCore& kernel, std::string&& name); |
| 123 | 126 | ||
| 124 | std::string GetTypeName() const override { | 127 | std::string GetTypeName() const override { |
| @@ -212,6 +215,11 @@ public: | |||
| 212 | total_process_running_time_ticks += ticks; | 215 | total_process_running_time_ticks += ticks; |
| 213 | } | 216 | } |
| 214 | 217 | ||
| 218 | /// Gets 8 bytes of random data for svcGetInfo RandomEntropy | ||
| 219 | u64 GetRandomEntropy(std::size_t index) const { | ||
| 220 | return random_entropy.at(index); | ||
| 221 | } | ||
| 222 | |||
| 215 | /** | 223 | /** |
| 216 | * Loads process-specifics configuration info with metadata provided | 224 | * Loads process-specifics configuration info with metadata provided |
| 217 | * by an executable. | 225 | * by an executable. |
| @@ -310,6 +318,9 @@ private: | |||
| 310 | /// Per-process handle table for storing created object handles in. | 318 | /// Per-process handle table for storing created object handles in. |
| 311 | HandleTable handle_table; | 319 | HandleTable handle_table; |
| 312 | 320 | ||
| 321 | /// Random values for svcGetInfo RandomEntropy | ||
| 322 | std::array<u64, RANDOM_ENTROPY_SIZE> random_entropy; | ||
| 323 | |||
| 313 | std::string name; | 324 | std::string name; |
| 314 | }; | 325 | }; |
| 315 | 326 | ||