mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-17 07:50:04 +00:00
LibCrypto+LibTLS+Kernel: Switch the Cipher::Mode interface to use Span
This shaves 2.5 more runtime seconds off 'disasm /bin/id', and makes the Mode<T> interface a lot more allocation-friendly.
This commit is contained in:
parent
caedd05bd8
commit
bc7a149039
Notes:
sideshowbarker
2024-07-19 03:52:51 +09:00
Author: https://github.com/alimpfard
Commit: bc7a149039
Pull-request: https://github.com/SerenityOS/serenity/pull/3094
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/nico
11 changed files with 182 additions and 153 deletions
|
@ -396,13 +396,11 @@ void AESCipher::decrypt_block(const AESCipherBlock& in, AESCipherBlock& out)
|
|||
// clang-format on
|
||||
}
|
||||
|
||||
void AESCipherBlock::overwrite(const ByteBuffer& buffer)
|
||||
void AESCipherBlock::overwrite(const ReadonlyBytes& span)
|
||||
{
|
||||
overwrite(buffer.data(), buffer.size());
|
||||
}
|
||||
auto data = span.data();
|
||||
auto length = span.size();
|
||||
|
||||
void AESCipherBlock::overwrite(const u8* data, size_t length)
|
||||
{
|
||||
ASSERT(length <= m_data.size());
|
||||
m_data.overwrite(0, data, length);
|
||||
if (length < m_data.size()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue