AES-256 decryption class (running in Cipher Block Chaining mode) More...

#include <aes256_decrypt.h>

Public Member Functions

virtual void add (const void *data, int size)=0
 Adds data to be decrypted. More...
 
virtual void add (const DataBufferPtr &data)=0
 Add data to be decrypted. More...
 
virtual bool calculate ()=0
 Finalize decryption. More...
 
virtual DataBufferPtr data () const =0
 Get decrypted data. More...
 
virtual void reset ()=0
 Resets the decryption. More...
 
virtual void set_iv (const unsigned char iv[iv_size])=0
 Sets the initialisation vector. More...
 
virtual void set_key (const unsigned char key[key_size])=0
 Sets the cipher key. More...
 
virtual void set_padding (bool value=true, bool use_pkcs7=true)=0
 Enable AES Padding. More...
 

Static Public Member Functions

static std::shared_ptr< AES256_Decryptcreate ()
 Constructs a AES-256 generator (running in Cipher Block Chaining mode) More...
 

Static Public Attributes

static const int iv_size = 16
 
static const int key_size = 32
 

Detailed Description

AES-256 decryption class (running in Cipher Block Chaining mode)

Member Function Documentation

virtual void uicore::AES256_Decrypt::add ( const void *  data,
int  size 
)
pure virtual

Adds data to be decrypted.

virtual void uicore::AES256_Decrypt::add ( const DataBufferPtr data)
pure virtual

Add data to be decrypted.

Parameters
data= Data Buffer
virtual bool uicore::AES256_Decrypt::calculate ( )
pure virtual

Finalize decryption.

IMPORTANT, to avoid timing attacks, if this function fails, you should still validate the data (via a hash or otherwise), then throw an error

Returns
false = AES Padding value is invalid.
static std::shared_ptr<AES256_Decrypt> uicore::AES256_Decrypt::create ( )
static

Constructs a AES-256 generator (running in Cipher Block Chaining mode)

virtual DataBufferPtr uicore::AES256_Decrypt::data ( ) const
pure virtual

Get decrypted data.

This is the databuffer used internally to store the decrypted data. You may call "set_size()" to clear the buffer, inbetween calls to "add()" You may call "set_capacity()" to optimise storage requirements before the add() call

virtual void uicore::AES256_Decrypt::reset ( )
pure virtual

Resets the decryption.

virtual void uicore::AES256_Decrypt::set_iv ( const unsigned char  iv[iv_size])
pure virtual

Sets the initialisation vector.

This should be a random number
This must be called before the initial add()

virtual void uicore::AES256_Decrypt::set_key ( const unsigned char  key[key_size])
pure virtual

Sets the cipher key.

This must be called before the initial add()

virtual void uicore::AES256_Decrypt::set_padding ( bool  value = true,
bool  use_pkcs7 = true 
)
pure virtual

Enable AES Padding.

Example (use_pkcs7==true) : ... 0x03 0x03 0x03 (3 octets of padding) Example (use_pkcs7==false) : ... 0x02 0x02 0x02 (3 octets of padding, the last octet is the length)

Parameters
value= true = Enable padding (default)
use_pkcs7= true = This uses the PKCS#7/RFC3369 method (Enabled by default). false = use the TLS method (rfc2246)

Member Data Documentation

const int uicore::AES256_Decrypt::iv_size = 16
static
const int uicore::AES256_Decrypt::key_size = 32
static

The documentation for this class was generated from the following file: