mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 08:39:22 +00:00
Kernel: Use word-sized entropy as much as possible in syscall
This commit is contained in:
parent
aa42f56210
commit
5050f7b5ee
Notes:
sideshowbarker
2024-07-19 11:42:17 +09:00
Author: https://github.com/NattyNarwhal
Commit: 5050f7b5ee
Pull-request: https://github.com/SerenityOS/serenity/pull/653
2 changed files with 19 additions and 9 deletions
|
@ -511,9 +511,6 @@ unsigned long long strtoull(const char* str, char** endptr, int base)
|
|||
uint32_t arc4random(void)
|
||||
{
|
||||
char buf[4];
|
||||
// XXX: RandomDevice does return a uint32_t but the syscall works with
|
||||
// a byte at a time. It could be better optimzied for this use case
|
||||
// while remaining generic.
|
||||
syscall(SC_getrandom, buf, 4, 0);
|
||||
return *(uint32_t*)buf;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue