ladybird icon indicating copy to clipboard operation
ladybird copied to clipboard

AK/LibJS/LibCrypto: implement random for Windows

Open R-Goc opened this issue 7 months ago • 5 comments

This commit implements a high quality randomness source for AK/Random. This avoids the fallback to rand(). The LibJS math xoshiro128+ prng is now seeded with SecureRandom. A convenience get_secure_random method was added to SecureRandom to directly construct the requested type.

R-Goc avatar Apr 08 '25 08:04 R-Goc

Hello!

One or more of the commit messages in this PR do not match the Ladybird code submission policy, please check the lint_commits CI job for more details on which commits were flagged and why. Please do not close this PR and open another, instead modify your commit message(s) with git commit --amend and force push those changes to update this PR.

ladybird-bot avatar Apr 08 '25 08:04 ladybird-bot

ASAN not complaining is encouraging but I don't think the fallback which I'm worried about actually has any code coverage.

R-Goc avatar Apr 08 '25 11:04 R-Goc

I also wonder if marking advance in xorshift always inline along with get wouldn't be useful.

R-Goc avatar Apr 08 '25 11:04 R-Goc

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!

github-actions[bot] avatar May 03 '25 02:05 github-actions[bot]

unstale

R-Goc avatar May 04 '25 15:05 R-Goc