libs: add ongoing work to facilitate hactool rewrite

This commit is contained in:
Michael Scire authored and SciresM committed 2022-03-21 17:21:44 -07:00
1 parent 706b8492fd
commit 13697fa921
34 files changed
+1829 -216

No files matched your search

@@ -83,9 +83,8 @@ namespace ams::spl::smc {
constinit u8 g_async_result_buffer[1_KB];
u64 GenerateRandomU64() {
/* TODO: Can/should we make this cryptographically secure? */
u64 v = -1;
os::GenerateRandomBytes(std::addressof(v), sizeof(v));
crypto::GenerateCryptographicallyRandomBytes(std::addressof(v), sizeof(v));
return v;
}
@@ -223,8 +222,7 @@ namespace ams::spl::smc {
//}
Result GenerateRandomBytes(void *out, size_t size) {
/* TODO: Cryptographically secure? */
os::GenerateRandomBytes(out, size);
crypto::GenerateCryptographicallyRandomBytes(out, size);
return smc::Result::Success;
}