Cuberite
A lightweight, fast and extensible game server for Minecraft
AesCfb128Decryptor.h
Go to the documentation of this file.
1 
2 // AesCfb128Decryptor.h
3 
4 // Declares the cAesCfb128Decryptor class decrypting data using AES CFB-128
5 
6 
7 
8 
9 
10 #pragma once
11 
12 #include "mbedtls/aes.h"
13 
14 
15 
16 
17 
20 {
21 public:
22 
23  cAesCfb128Decryptor(void);
25 
27  void Init(const Byte a_Key[16], const Byte a_IV[16]);
28 
30  void ProcessData(Byte * a_DecryptedOut, const Byte * a_EncryptedIn, size_t a_Length);
31 
33  bool IsValid(void) const { return m_IsValid; }
34 
35 protected:
36  mbedtls_aes_context m_Aes;
37 
39  Byte m_IV[16];
40 
42  bool m_IsValid;
43 } ;
44 
45 
46 
47 
48 
void Init(const Byte a_Key[16], const Byte a_IV[16])
Initializes the decryptor with the specified Key / IV.
Byte m_IV[16]
The InitialVector, used by the CFB mode decryption.
bool m_IsValid
Indicates whether the object has been initialized with the Key / IV.
mbedtls_aes_context m_Aes
Decrypts data using the AES / CFB 128 algorithm.
void ProcessData(Byte *a_DecryptedOut, const Byte *a_EncryptedIn, size_t a_Length)
Decrypts a_Length bytes of the encrypted data; produces a_Length output bytes.
unsigned char Byte
Definition: Globals.h:117
bool IsValid(void) const
Returns true if the object has been initialized with the Key / IV.