1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 10:47:35 +00:00

LibCrypto: Add CTR cipher mode

Kernel: Changed fortuna implementation to use CTR mode instead of
manually implementing a counter.
This commit is contained in:
Peter Elliott 2020-06-23 14:05:26 -06:00 committed by Andreas Kling
parent 0f32155fa4
commit 2e8cfe5435
3 changed files with 153 additions and 26 deletions

View file

@ -30,6 +30,7 @@
#include <AK/Vector.h>
#include <LibCrypto/Cipher/Cipher.h>
#include <LibCrypto/Cipher/Mode/CBC.h>
#include <LibCrypto/Cipher/Mode/CTR.h>
namespace Crypto {
namespace Cipher {
@ -110,6 +111,7 @@ private:
class AESCipher final : public Cipher<AESCipherKey, AESCipherBlock> {
public:
using CBCMode = CBC<AESCipher>;
using CTRMode = CTR<AESCipher>;
constexpr static size_t BlockSizeInBits = BlockType::BlockSizeInBits;