1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:17:44 +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:
AnotherTest 2020-08-11 23:30:49 +04:30 committed by Andreas Kling
parent caedd05bd8
commit bc7a149039
11 changed files with 182 additions and 153 deletions

View file

@ -64,12 +64,14 @@ public:
virtual ByteBuffer get() const = 0;
virtual const ByteBuffer& data() const = 0;
virtual void overwrite(const ByteBuffer&) = 0;
virtual void overwrite(const u8*, size_t) = 0;
virtual void overwrite(const ReadonlyBytes&) = 0;
virtual void overwrite(const ByteBuffer& buffer) { overwrite(buffer.span()); }
virtual void overwrite(const u8* data, size_t size) { overwrite({ data, size }); }
virtual void apply_initialization_vector(const u8* ivec) = 0;
PaddingMode padding_mode() const { return m_padding_mode; }
void set_padding_mode(PaddingMode mode) { m_padding_mode = mode; }
template<typename T>
void put(size_t offset, T value)