Base Framework
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
AdvancedEncryptionStandard Class Reference

Advanced Encryption Standard (AES) implementation. More...

#include <base/security/AdvancedEncryptionStandard.h>

Inherits Object.

Classes

class  Cipher128Traits
 
class  Cipher192Traits
 
class  Cipher256Traits
 

Public Types

enum  Cipher { CIPHER_128, CIPHER_192, CIPHER_256 }
 

Public Member Functions

 AdvancedEncryptionStandard (const uint8 *key, Cipher cipher, bool inverse=false) noexcept
 
unsigned int push (uint8 *dest, const uint8 *src, unsigned int size) noexcept
 
unsigned int pushEnd (uint8 *dest, unsigned int size) noexcept
 

Static Public Member Functions

static unsigned int getKeyLenght (Cipher cipher) noexcept
 

Detailed Description

Advanced Encryption Standard (AES) implementation.

Implementation of the Advanced Encryption Standard (AES) as specified by FIPS-197.

Version
1.0

Member Enumeration Documentation

◆ Cipher

Cipher.

Enumerator
CIPHER_128 

128 bit cipher.

CIPHER_192 

192 bit cipher.

CIPHER_256 

256 bit cipher.

Constructor & Destructor Documentation

◆ AdvancedEncryptionStandard()

AdvancedEncryptionStandard::AdvancedEncryptionStandard ( const uint8 *  key,
Cipher  cipher,
bool  inverse = false 
)
noexcept

Initializes encryption object.

Parameters
keyThe key.
cipherThe cipher.
inverseSpecifies if the inverse cipher should be used. The default is false.

Member Function Documentation

◆ getKeyLenght()

static unsigned int AdvancedEncryptionStandard::getKeyLenght ( Cipher  cipher)
inlinestaticnoexcept

Returns the key length in bytes for the specified cipher.

◆ push()

unsigned int AdvancedEncryptionStandard::push ( uint8 *  dest,
const uint8 *  src,
unsigned int  size 
)
noexcept

Encrypts the specified data. May be called multiple times.

Parameters
destThe cipher text.
srcThe buffer holding the data to be encrypted (plain text).
sizeThe number of octets in the buffer.
Returns
The number of bytes written.

◆ pushEnd()

unsigned int AdvancedEncryptionStandard::pushEnd ( uint8 *  dest,
unsigned int  size 
)
noexcept

This function should be invoked when the entire message has been pushed. Do NOT use push() after invoking this function.

Parameters
destThe cipher text.
sizeThe number of octets in the buffer.
Returns
The number of bytes written.