clan::AES192_Decrypt Class Reference - ClanLib SDK
Description: clan::AES192_Decrypt Class Reference

Public Member Functions | Static Public Attributes | List of all members
clan::AES192_Decrypt Class Reference
clanCore Crypto

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

`#include <aes192_decrypt.h>`

## Public Member Functions
| AES192_Decrypt ()
| Constructs a AES-192 generator (running in Cipher Block Chaining mode).
void | add (const DataBuffer &data)
| Add data to be decrypted.
void | add (const void *data, int size)
| Adds data to be decrypted.
bool | calculate ()
| Finalize decryption.
DataBuffer | get_data () const
| Get decrypted data.
void | reset ()
| Resets the decryption.
void | set_iv (const unsigned char iv[iv_size])
| Sets the initialisation vector.
void | set_key (const unsigned char key[key_size])
| Sets the cipher key.
void | set_padding (bool value=true, bool use_pkcs7=true)
| Enable AES Padding.

## Static Public Attributes
static const int | iv_size = 16
static const int | key_size = 24

## Detailed Description

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

## Constructor & Destructor Documentation

## ◆ AES192_Decrypt()

clan::AES192_Decrypt::AES192_Decrypt | ( |  | ) |

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

## Member Function Documentation

## ◆ add() [1/2]

void clan::AES192_Decrypt::add | ( | const DataBuffer & | data | ) |

Add data to be decrypted.

Parameters

  data | = Data Buffer

## ◆ add() [2/2]

void clan::AES192_Decrypt::add | ( | const void * | data,
|  | int | size )

Adds data to be decrypted.

## ◆ calculate()

bool clan::AES192_Decrypt::calculate | ( |  | ) |

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.

## ◆ get_data()

DataBuffer clan::AES192_Decrypt::get_data | ( |  | ) | const

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

## ◆ reset()

void clan::AES192_Decrypt::reset | ( |  | ) |

Resets the decryption.

## ◆ set_iv()

void clan::AES192_Decrypt::set_iv | ( | const unsigned char | iv[iv_size] | ) |

Sets the initialisation vector.

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

References iv_size.

## ◆ set_key()

void clan::AES192_Decrypt::set_key | ( | const unsigned char | key[key_size] | ) |

Sets the cipher key.

This must be called before the initial add()

References key_size.

## ◆ set_padding()

void clan::AES192_Decrypt::set_padding | ( | bool | value = true,
|  | bool | use_pkcs7 = true )

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

## ◆ iv_size

const int clan::AES192_Decrypt::iv_size = 16
| static

Referenced by set_iv().

## ◆ key_size

const int clan::AES192_Decrypt::key_size = 24
| static

Referenced by set_key().

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

- aes192_decrypt.h