mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
LibCrypto: Require intent parameter in CTR constructor
This was preventing clang from building.
This commit is contained in:
parent
29e4dc7634
commit
72abf3491b
Notes:
sideshowbarker
2024-07-19 01:11:33 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/72abf3491be Pull-request: https://github.com/SerenityOS/serenity/pull/4181
2 changed files with 4 additions and 2 deletions
|
@ -66,7 +66,7 @@ public:
|
|||
// FIXME: More than 2^20 bytes cannot be generated without refreshing the key.
|
||||
ASSERT(n < (1 << 20));
|
||||
|
||||
typename CipherType::CTRMode cipher(m_key, KeySize);
|
||||
typename CipherType::CTRMode cipher(m_key, KeySize, Crypto::Cipher::Intent::Encryption);
|
||||
|
||||
Bytes buffer_span { buffer, n };
|
||||
auto counter_span = m_counter.bytes();
|
||||
|
|
|
@ -113,8 +113,10 @@ public:
|
|||
// Must intercept `Intent`, because AES must always be set to
|
||||
// Encryption, even when decrypting AES-CTR.
|
||||
// TODO: How to deal with ciphers that take different arguments?
|
||||
// FIXME: Add back the default intent parameter once clang-11 is the default in GitHub Actions.
|
||||
// Once added back, remove the parameter where it's constructed in get_random_bytes in Kernel/Random.h.
|
||||
template<typename KeyType, typename... Args>
|
||||
explicit constexpr CTR(const KeyType& user_key, size_t key_bits, Intent = Intent::Encryption, Args... args)
|
||||
explicit constexpr CTR(const KeyType& user_key, size_t key_bits, Intent, Args... args)
|
||||
: Mode<T>(user_key, key_bits, Intent::Encryption, args...)
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue