mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:17:42 +00:00
LibCrypto+LibTLS: Generalise the use of IV length
This is in preparation for the upcoming Galois/Counter mode, which conventionally has 12 bytes of IV as opposed to CBC's 16 bytes. ...Also fixes a lot of style issues, since the author finally found the project's clang config file in the repository root :^)
This commit is contained in:
parent
7384d58a0a
commit
a1e1570552
7 changed files with 3110 additions and 3060 deletions
|
@ -36,6 +36,8 @@ namespace Cipher {
|
|||
template <typename T>
|
||||
class CBC : public Mode<T> {
|
||||
public:
|
||||
constexpr static size_t IVSizeInBits = 128;
|
||||
|
||||
virtual ~CBC() {}
|
||||
template <typename... Args>
|
||||
explicit constexpr CBC<T>(Args... args)
|
||||
|
@ -51,6 +53,8 @@ namespace Cipher {
|
|||
return builder.build();
|
||||
}
|
||||
|
||||
virtual size_t IV_length() const { return IVSizeInBits / 8; }
|
||||
|
||||
virtual Optional<ByteBuffer> encrypt(const ByteBuffer& in, ByteBuffer& out, Optional<ByteBuffer> ivec = {}) override
|
||||
{
|
||||
auto length = in.size();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue