mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:57:45 +00:00
AK+Everywhere: Change AK::fill_with_random to accept a Bytes object
Rather than the very C-like API we currently have, accepting a void* and a length, let's take a Bytes object instead. In almost all existing cases, the compiler figures out the length.
This commit is contained in:
parent
5c045b6934
commit
15532df83d
20 changed files with 37 additions and 39 deletions
|
@ -398,7 +398,7 @@ TEST_CASE(test_bigint_import_big_endian_decode_encode_roundtrip)
|
|||
{
|
||||
u8 random_bytes[128];
|
||||
u8 target_buffer[128];
|
||||
fill_with_random(random_bytes, 128);
|
||||
fill_with_random(random_bytes);
|
||||
auto encoded = Crypto::UnsignedBigInteger::import_data(random_bytes, 128);
|
||||
encoded.export_data({ target_buffer, 128 });
|
||||
EXPECT(memcmp(target_buffer, random_bytes, 128) == 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue