#include <lib_aes.h>
An Advanced Encryption Standard (also known as Rijndael) class to encrypt/decrypt data.
Private Member Functions | |
AES () | |
~AES () | |
Alloc/Free | |
static AES * | Alloc () |
static void | Free (AES *&pAES) |
Calculate Data Size | |
static Int | CalcEncryptedDataSize (Int32 lBlockLength, Int lDataLength) |
Init | |
Bool | Init (Int32 lBlockLength, Int32 lKeyLength) |
Encrypt/Decrypt | |
Bool | Encrypt (void *pData, Int lDataLength, const void *pKey) |
Bool | Decrypt (void *pData, Int lDataLength, const void *pKey) |
Progress Callback | |
void | SetProgressCallback (PFNRIJINDAEL_CIPHER_PROGRESS fn, void *pData) |
|
private |
|
private |
|
static |
|
static |
Initializes the AES cipher to the given block length and key length.
[in] | lBlockLength | The block length. Must be 128, 192 or 256 (bit). |
[in] | lKeyLength | The key length. Must be 128, 192 or 256 (bit). |
Calculates the size of the data block (data size + encryption overhead).
[in] | lBlockLength | The block length in bits. |
[in] | lDataLength | The size of the data in bytes. |
Encrypts a data block.
[in,out] | pData | The data block to encrypt. |
[in] | lDataLength | The size of the data block. Usually retrieved with CalcEncryptedDataSize(). |
[in] | pKey | The encryption key. |
Decrypts a data block.
[in,out] | pData | The encrypted data block. |
[in] | lDataLength | The size of the data block. |
[in] | pKey | The decryption key. |
void SetProgressCallback | ( | PFNRIJINDAEL_CIPHER_PROGRESS | fn, |
void * | pData | ||
) |
Sets the encryption/decryption progress hook.
[in] | fn | The progress hook. |
[in] | pData | The data pointer passed to the hook. |