mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 11:09:18 +00:00
Meta+LibCrypto: Add SecureRandom and replace PRNG usage with it
This adds a thin wrapper to LibCrypto for generating cryptographically secure random values and replaces current usages of PRNG within LibCrypto as well.
This commit is contained in:
parent
b981e6f7bc
commit
f55f507e56
Notes:
github-actions[bot]
2024-12-24 16:56:11 +00:00
Author: https://github.com/rmg-x
Commit: f55f507e56
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2996
Reviewed-by: https://github.com/ADKaster
10 changed files with 50 additions and 6 deletions
|
@ -8,6 +8,7 @@
|
|||
#include <AK/Endian.h>
|
||||
#include <AK/Random.h>
|
||||
#include <LibCrypto/Curves/X448.h>
|
||||
#include <LibCrypto/SecureRandom.h>
|
||||
|
||||
namespace Crypto::Curves {
|
||||
|
||||
|
@ -291,7 +292,7 @@ static void modular_multiply_inverse(u32* state, u32* value)
|
|||
ErrorOr<ByteBuffer> X448::generate_private_key()
|
||||
{
|
||||
auto buffer = TRY(ByteBuffer::create_uninitialized(BYTES));
|
||||
fill_with_random(buffer);
|
||||
fill_with_secure_random(buffer);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue