clanCore Crypto

Classes

class  clan::AES128_Decrypt
 AES-128 decryption class (running in Cipher Block Chaining mode) More...
 
class  clan::AES128_Encrypt
 AES-128 encryption class (running in Cipher Block Chaining mode) More...
 
class  clan::AES192_Decrypt
 AES-192 decryption class (running in Cipher Block Chaining mode) More...
 
class  clan::AES192_Encrypt
 AES-192 encryption class (running in Cipher Block Chaining mode) More...
 
class  clan::AES256_Decrypt
 AES-256 decryption class (running in Cipher Block Chaining mode) More...
 
class  clan::AES256_Encrypt
 AES-256 encryption class (running in Cipher Block Chaining mode) More...
 
class  clan::HashFunctions
 A Collection of checksum functions. More...
 
class  clan::MD5
 MD5 hash function class. More...
 
class  clan::Random
 Random class. More...
 
class  clan::RSA
 RSA class. More...
 
class  clan::Secret
 Key class. More...
 
class  clan::SHA1
 SHA-1 hash function class. More...
 
class  clan::SHA224
 SHA-224 hash function class. More...
 
class  clan::SHA256
 SHA-256 hash function class. More...
 
class  clan::SHA384
 SHA-384 hash function class. More...
 
class  clan::SHA512
 SHA-512 hash function class. More...
 
class  clan::SHA512_224
 SHA-512_224 hash function class. More...
 
class  clan::SHA512_256
 SHA-512_256 hash function class. More...
 
class  clan::TLSClient
 Transport Layer Security (TLS) client class. More...
 

Construction

 clan::AES128_Decrypt::AES128_Decrypt ()
 Constructs a AES-128 generator (running in Cipher Block Chaining mode) More...
 

Attributes

DataBuffer clan::AES128_Decrypt::get_data () const
 Get decrypted data. More...
 

Operations

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

Construction

 clan::AES128_Encrypt::AES128_Encrypt ()
 Constructs a AES-128 generator (running in Cipher Block Chaining mode) More...
 

Attributes

DataBuffer clan::AES128_Encrypt::get_data () const
 Get encrypted data. More...
 

Operations

static const int clan::AES128_Encrypt::iv_size = 16
 
static const int clan::AES128_Encrypt::key_size = 16
 
static const int clan::AES128_Encrypt::block_size = 16
 
void clan::AES128_Encrypt::reset ()
 Resets the encryption. More...
 
void clan::AES128_Encrypt::set_iv (const unsigned char iv[iv_size])
 Sets the initialisation vector. More...
 
void clan::AES128_Encrypt::set_key (const unsigned char key[key_size])
 Sets the cipher key. More...
 
void clan::AES128_Encrypt::set_padding (bool value=true, bool use_pkcs7=true, unsigned int num_additional_padded_blocks=0)
 Enable AES Padding. More...
 
void clan::AES128_Encrypt::add (const void *data, int size)
 Adds data to be encrypted. More...
 
void clan::AES128_Encrypt::add (const DataBuffer &data)
 Add data to be encrypted. More...
 
void clan::AES128_Encrypt::calculate ()
 Finalize encryption. More...
 

Construction

 clan::AES192_Decrypt::AES192_Decrypt ()
 Constructs a AES-192 generator (running in Cipher Block Chaining mode) More...
 

Attributes

DataBuffer clan::AES192_Decrypt::get_data () const
 Get decrypted data. More...
 

Operations

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

Construction

 clan::AES192_Encrypt::AES192_Encrypt ()
 Constructs a AES-192 generator (running in Cipher Block Chaining mode) More...
 

Attributes

DataBuffer clan::AES192_Encrypt::get_data () const
 Get encrypted data. More...
 

Operations

static const int clan::AES192_Encrypt::iv_size = 16
 
static const int clan::AES192_Encrypt::key_size = 24
 
static const int clan::AES192_Encrypt::block_size = 16
 
void clan::AES192_Encrypt::reset ()
 Resets the encryption. More...
 
void clan::AES192_Encrypt::set_iv (const unsigned char iv[iv_size])
 Sets the initialisation vector. More...
 
void clan::AES192_Encrypt::set_key (const unsigned char key[key_size])
 Sets the cipher key. More...
 
void clan::AES192_Encrypt::set_padding (bool value=true, bool use_pkcs7=true, unsigned int num_additional_padded_blocks=0)
 Enable AES Padding. More...
 
void clan::AES192_Encrypt::add (const void *data, int size)
 Adds data to be encrypted. More...
 
void clan::AES192_Encrypt::add (const DataBuffer &data)
 Add data to be encrypted. More...
 
void clan::AES192_Encrypt::calculate ()
 Finalize encryption. More...
 

Construction

 clan::AES256_Decrypt::AES256_Decrypt ()
 Constructs a AES-256 generator (running in Cipher Block Chaining mode) More...
 

Attributes

DataBuffer clan::AES256_Decrypt::get_data () const
 Get decrypted data. More...
 

Operations

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

Construction

 clan::AES256_Encrypt::AES256_Encrypt ()
 Constructs a AES-256 generator (running in Cipher Block Chaining mode) More...
 

Attributes

DataBuffer clan::AES256_Encrypt::get_data () const
 Get encrypted data. More...
 

Operations

static const int clan::AES256_Encrypt::iv_size = 16
 
static const int clan::AES256_Encrypt::key_size = 32
 
static const int clan::AES256_Encrypt::block_size = 16
 
void clan::AES256_Encrypt::reset ()
 Resets the encryption. More...
 
void clan::AES256_Encrypt::set_iv (const unsigned char iv[iv_size])
 Sets the initialisation vector. More...
 
void clan::AES256_Encrypt::set_key (const unsigned char key[key_size])
 Sets the cipher key. More...
 
void clan::AES256_Encrypt::set_padding (bool value=true, bool use_pkcs7=true, unsigned int num_additional_padded_blocks=0)
 Enable AES Padding. More...
 
void clan::AES256_Encrypt::add (const void *data, int size)
 Adds data to be encrypted. More...
 
void clan::AES256_Encrypt::add (const DataBuffer &data)
 Add data to be encrypted. More...
 
void clan::AES256_Encrypt::calculate ()
 Finalize encryption. More...
 

Operations

static uint32_t clan::HashFunctions::crc32 (const void *data, int size, uint32_t running_crc=0)
 Calculate a CRC32 checksum on the data. More...
 
static uint32_t clan::HashFunctions::adler32 (const void *data, int size, uint32_t running_adler32=0)
 Calculate a CRC32 checksum on the data. More...
 
static std::string clan::HashFunctions::sha1 (const void *data, int size, bool uppercase=false)
 Generate SHA-1 hash from data. More...
 
static std::string clan::HashFunctions::sha1 (const std::string &data, bool uppercase=false)
 SHA1. More...
 
static std::string clan::HashFunctions::sha1 (const DataBuffer &data, bool uppercase=false)
 SHA1. More...
 
static void clan::HashFunctions::sha1 (const void *data, int size, unsigned char out_hash[20])
 SHA1. More...
 
static void clan::HashFunctions::sha1 (const std::string &data, unsigned char out_hash[20])
 SHA1. More...
 
static void clan::HashFunctions::sha1 (const DataBuffer &data, unsigned char out_hash[20])
 SHA1. More...
 
static std::string clan::HashFunctions::md5 (const void *data, int size, bool uppercase=false)
 Generate SHA-1 hash from data. More...
 
static std::string clan::HashFunctions::md5 (const std::string &data, bool uppercase=false)
 MD5. More...
 
static std::string clan::HashFunctions::md5 (const DataBuffer &data, bool uppercase=false)
 MD5. More...
 
static void clan::HashFunctions::md5 (const void *data, int size, unsigned char out_hash[16])
 MD5. More...
 
static void clan::HashFunctions::md5 (const std::string &data, unsigned char out_hash[16])
 MD5. More...
 
static void clan::HashFunctions::md5 (const DataBuffer &data, unsigned char out_hash[16])
 MD5. More...
 
static std::string clan::HashFunctions::sha224 (const void *data, int size, bool uppercase=false)
 Generate SHA-224 hash from data. More...
 
static std::string clan::HashFunctions::sha224 (const std::string &data, bool uppercase=false)
 SHA224. More...
 
static std::string clan::HashFunctions::sha224 (const DataBuffer &data, bool uppercase=false)
 SHA224. More...
 
static void clan::HashFunctions::sha224 (const void *data, int size, unsigned char out_hash[28])
 SHA224. More...
 
static void clan::HashFunctions::sha224 (const std::string &data, unsigned char out_hash[28])
 SHA224. More...
 
static void clan::HashFunctions::sha224 (const DataBuffer &data, unsigned char out_hash[28])
 SHA224. More...
 
static std::string clan::HashFunctions::sha256 (const void *data, int size, bool uppercase=false)
 Generate SHA-256 hash from data. More...
 
static std::string clan::HashFunctions::sha256 (const std::string &data, bool uppercase=false)
 SHA256. More...
 
static std::string clan::HashFunctions::sha256 (const DataBuffer &data, bool uppercase=false)
 SHA256. More...
 
static void clan::HashFunctions::sha256 (const void *data, int size, unsigned char out_hash[32])
 SHA256. More...
 
static void clan::HashFunctions::sha256 (const std::string &data, unsigned char out_hash[32])
 SHA256. More...
 
static void clan::HashFunctions::sha256 (const DataBuffer &data, unsigned char out_hash[32])
 SHA256. More...
 
static std::string clan::HashFunctions::sha384 (const void *data, int size, bool uppercase=false)
 Generate SHA-384 hash from data. More...
 
static std::string clan::HashFunctions::sha384 (const std::string &data, bool uppercase=false)
 SHA384. More...
 
static std::string clan::HashFunctions::sha384 (const DataBuffer &data, bool uppercase=false)
 SHA384. More...
 
static void clan::HashFunctions::sha384 (const void *data, int size, unsigned char out_hash[48])
 SHA384. More...
 
static void clan::HashFunctions::sha384 (const std::string &data, unsigned char out_hash[48])
 SHA384. More...
 
static void clan::HashFunctions::sha384 (const DataBuffer &data, unsigned char out_hash[48])
 SHA384. More...
 
static std::string clan::HashFunctions::sha512 (const void *data, int size, bool uppercase=false)
 Generate SHA-512 hash from data. More...
 
static std::string clan::HashFunctions::sha512 (const std::string &data, bool uppercase=false)
 SHA512. More...
 
static std::string clan::HashFunctions::sha512 (const DataBuffer &data, bool uppercase=false)
 SHA512. More...
 
static void clan::HashFunctions::sha512 (const void *data, int size, unsigned char out_hash[64])
 SHA512. More...
 
static void clan::HashFunctions::sha512 (const std::string &data, unsigned char out_hash[64])
 SHA512. More...
 
static void clan::HashFunctions::sha512 (const DataBuffer &data, unsigned char out_hash[64])
 SHA512. More...
 
static std::string clan::HashFunctions::sha512_224 (const void *data, int size, bool uppercase=false)
 Generate SHA-512_224 hash from data. More...
 
static std::string clan::HashFunctions::sha512_224 (const std::string &data, bool uppercase=false)
 SHA512_224. More...
 
static std::string clan::HashFunctions::sha512_224 (const DataBuffer &data, bool uppercase=false)
 SHA512_224. More...
 
static void clan::HashFunctions::sha512_224 (const void *data, int size, unsigned char out_hash[28])
 SHA512_224. More...
 
static void clan::HashFunctions::sha512_224 (const std::string &data, unsigned char out_hash[28])
 SHA512_224. More...
 
static void clan::HashFunctions::sha512_224 (const DataBuffer &data, unsigned char out_hash[28])
 SHA512_224. More...
 
static std::string clan::HashFunctions::sha512_256 (const void *data, int size, bool uppercase=false)
 Generate SHA-512_256 hash from data. More...
 
static std::string clan::HashFunctions::sha512_256 (const std::string &data, bool uppercase=false)
 SHA512_256. More...
 
static std::string clan::HashFunctions::sha512_256 (const DataBuffer &data, bool uppercase=false)
 SHA512_256. More...
 
static void clan::HashFunctions::sha512_256 (const void *data, int size, unsigned char out_hash[32])
 SHA512_256. More...
 
static void clan::HashFunctions::sha512_256 (const std::string &data, unsigned char out_hash[32])
 SHA512_256. More...
 
static void clan::HashFunctions::sha512_256 (const DataBuffer &data, unsigned char out_hash[32])
 SHA512_256. More...
 

Construction

 clan::MD5::MD5 ()
 Constructs a MD5 hash generator. More...
 

Attributes

static const int clan::MD5::hash_size = 16
 
std::string clan::MD5::get_hash (bool uppercase=false) const
 Returns the calculated hash. More...
 
void clan::MD5::get_hash (unsigned char out_hash[hash_size]) const
 Get hash. More...
 

Operations

void clan::MD5::reset ()
 Resets the hash generator. More...
 
void clan::MD5::set_hmac (const void *key_data, int key_size)
 Enable a HMAC based calculation. More...
 
void clan::MD5::add (const void *data, int size)
 Adds data to be hashed. More...
 
void clan::MD5::add (const DataBuffer &data)
 Add. More...
 
void clan::MD5::calculate ()
 Finalize hash calculation. More...
 

Construction

 clan::Random::Random (int cache_size=1024)
 Constructs the object. More...
 

Operations

void clan::Random::get_random_bytes (unsigned char *out_dest_ptr, int num_bytes)
 Get the random bytes. More...
 
void clan::Random::get_random_bytes_nzero (unsigned char *out_dest_ptr, int num_bytes)
 Get the random bytes excluding bytes containing 0. More...
 
bool clan::Random::get_random_bool ()
 Get the random boolean. More...
 

Attributes

static void clan::RSA::create_keypair (Random &random, Secret &out_private_exponent, DataBuffer &out_public_exponent, DataBuffer &out_modulus, int key_size_in_bits=1024, int public_exponent_value=65537)
 Create a keypair. More...
 
static DataBuffer clan::RSA::encrypt (int block_type, Random &random, const DataBuffer &in_public_exponent, const DataBuffer &in_modulus, const Secret &in_data)
 Encrypt. More...
 
static DataBuffer clan::RSA::encrypt (int block_type, Random &random, const void *in_public_exponent, unsigned int in_public_exponent_size, const void *in_modulus, unsigned int in_modulus_size, const void *in_data, unsigned int in_data_size)
 Encrypt. More...
 
static Secret clan::RSA::decrypt (const Secret &in_private_exponent, const DataBuffer &in_modulus, const DataBuffer &in_data)
 Decrypt. More...
 
static Secret clan::RSA::decrypt (const Secret &in_private_exponent, const void *in_modulus, unsigned int in_modulus_size, const void *in_data, unsigned int in_data_size)
 Decrypt. More...
 

Construction

 clan::Secret::Secret ()
 Constructs a key (unset) More...
 
 clan::Secret::Secret (unsigned int new_key_length)
 Constructs a key to a specified length. More...
 

Attributes

unsigned int clan::Secret::get_size () const
 Get the key size. More...
 
unsigned char * clan::Secret::get_data () const
 Get the key data. More...
 

Construction

 clan::SHA1::SHA1 ()
 Constructs a SHA-1 hash generator. More...
 

Attributes

static const int clan::SHA1::hash_size = 20
 
std::string clan::SHA1::get_hash (bool uppercase=false) const
 Returns the calculated hash. More...
 
void clan::SHA1::get_hash (unsigned char out_hash[hash_size]) const
 Get hash. More...
 

Operations

void clan::SHA1::reset ()
 Resets the hash generator. More...
 
void clan::SHA1::set_hmac (const void *key_data, int key_size)
 Enable a HMAC based calculation. More...
 
void clan::SHA1::add (const void *data, int size)
 Adds data to be hashed. More...
 
void clan::SHA1::add (const DataBuffer &data)
 Add. More...
 
void clan::SHA1::calculate ()
 Finalize hash calculation. More...
 

Construction

 clan::SHA224::SHA224 ()
 Constructs a SHA-224 hash generator. More...
 

Attributes

static const int clan::SHA224::hash_size = 28
 
std::string clan::SHA224::get_hash (bool uppercase=false) const
 Returns the calculated hash. More...
 
void clan::SHA224::get_hash (unsigned char out_hash[hash_size]) const
 Get hash. More...
 

Operations

void clan::SHA224::reset ()
 Resets the hash generator. More...
 
void clan::SHA224::set_hmac (const void *key_data, int key_size)
 Enable a HMAC based calculation. More...
 
void clan::SHA224::add (const void *data, int size)
 Adds data to be hashed. More...
 
void clan::SHA224::add (const DataBuffer &data)
 Add. More...
 
void clan::SHA224::calculate ()
 Finalize hash calculation. More...
 

Construction

 clan::SHA256::SHA256 ()
 Constructs a SHA-256 hash generator. More...
 

Attributes

static const int clan::SHA256::hash_size = 32
 
std::string clan::SHA256::get_hash (bool uppercase=false) const
 Returns the calculated hash. More...
 
void clan::SHA256::get_hash (unsigned char out_hash[hash_size]) const
 Get hash. More...
 

Operations

void clan::SHA256::reset ()
 Resets the hash generator. More...
 
void clan::SHA256::set_hmac (const void *key_data, int key_size)
 Enable a HMAC based calculation. More...
 
void clan::SHA256::add (const void *data, int size)
 Adds data to be hashed. More...
 
void clan::SHA256::add (const DataBuffer &data)
 Add. More...
 
void clan::SHA256::calculate ()
 Finalize hash calculation. More...
 

Construction

 clan::SHA384::SHA384 ()
 Constructs a SHA-384 hash generator. More...
 

Attributes

static const int clan::SHA384::hash_size = 48
 
std::string clan::SHA384::get_hash (bool uppercase=false) const
 Returns the calculated hash. More...
 
void clan::SHA384::get_hash (unsigned char out_hash[hash_size]) const
 Get hash. More...
 

Operations

void clan::SHA384::reset ()
 Resets the hash generator. More...
 
void clan::SHA384::set_hmac (const void *key_data, int key_size)
 Enable a HMAC based calculation. More...
 
void clan::SHA384::add (const void *data, int size)
 Adds data to be hashed. More...
 
void clan::SHA384::add (const DataBuffer &data)
 Add. More...
 
void clan::SHA384::calculate ()
 Finalize hash calculation. More...
 

Construction

 clan::SHA512::SHA512 ()
 Constructs a SHA-512 hash generator. More...
 

Attributes

static const int clan::SHA512::hash_size = 64
 
std::string clan::SHA512::get_hash (bool uppercase=false) const
 Returns the calculated hash. More...
 
void clan::SHA512::get_hash (unsigned char out_hash[hash_size]) const
 Get hash. More...
 

Operations

void clan::SHA512::reset ()
 Resets the hash generator. More...
 
void clan::SHA512::set_hmac (const void *key_data, int key_size)
 Enable a HMAC based calculation. More...
 
void clan::SHA512::add (const void *data, int size)
 Adds data to be hashed. More...
 
void clan::SHA512::add (const DataBuffer &data)
 Add. More...
 
void clan::SHA512::calculate ()
 Finalize hash calculation. More...
 

Construction

 clan::SHA512_224::SHA512_224 ()
 Constructs a SHA-512_224 hash generator. More...
 

Attributes

static const int clan::SHA512_224::hash_size = 28
 
std::string clan::SHA512_224::get_hash (bool uppercase=false) const
 Returns the calculated hash. More...
 
void clan::SHA512_224::get_hash (unsigned char out_hash[hash_size]) const
 Get hash. More...
 

Operations

void clan::SHA512_224::reset ()
 Resets the hash generator. More...
 
void clan::SHA512_224::set_hmac (const void *key_data, int key_size)
 Enable a HMAC based calculation. More...
 
void clan::SHA512_224::add (const void *data, int size)
 Adds data to be hashed. More...
 
void clan::SHA512_224::add (const DataBuffer &data)
 Add. More...
 
void clan::SHA512_224::calculate ()
 Finalize hash calculation. More...
 

Construction

 clan::SHA512_256::SHA512_256 ()
 Constructs a SHA-512_256 hash generator. More...
 

Attributes

static const int clan::SHA512_256::hash_size = 32
 
std::string clan::SHA512_256::get_hash (bool uppercase=false) const
 Returns the calculated hash. More...
 
void clan::SHA512_256::get_hash (unsigned char out_hash[hash_size]) const
 Get hash. More...
 

Operations

void clan::SHA512_256::reset ()
 Resets the hash generator. More...
 
void clan::SHA512_256::set_hmac (const void *key_data, int key_size)
 Enable a HMAC based calculation. More...
 
void clan::SHA512_256::add (const void *data, int size)
 Adds data to be hashed. More...
 
void clan::SHA512_256::add (const DataBuffer &data)
 Add. More...
 
void clan::SHA512_256::calculate ()
 Finalize hash calculation. More...
 

Construction

 clan::TLSClient::TLSClient ()
 Constructs a TLS client. More...
 

Attributes

const void * clan::TLSClient::get_decrypted_data () const
 Return a pointer to decrypted data available for consumption. More...
 
int clan::TLSClient::get_decrypted_data_available () const
 Returns how much decrypted data is available. More...
 
const void * clan::TLSClient::get_encrypted_data () const
 Return a pointer to encrypted data available for consumption. More...
 
int clan::TLSClient::get_encrypted_data_available () const
 Returns how much encrypted data is available. More...
 

Operations

int clan::TLSClient::encrypt (const void *data, int size)
 Adds data to be encrypted. More...
 
int clan::TLSClient::decrypt (const void *data, int size)
 Adds data to be decrypted. More...
 
void clan::TLSClient::decrypted_data_consumed (int size)
 Marks decrypted data as consumed. More...
 
void clan::TLSClient::encrypted_data_consumed (int size)
 Marks encrypted data as consumed. More...
 

Detailed Description

Function Documentation

◆ AES128_Decrypt()

clan::AES128_Decrypt::AES128_Decrypt ( )

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

◆ AES128_Encrypt()

clan::AES128_Encrypt::AES128_Encrypt ( )

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

◆ AES192_Decrypt()

clan::AES192_Decrypt::AES192_Decrypt ( )

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

◆ AES192_Encrypt()

clan::AES192_Encrypt::AES192_Encrypt ( )

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

◆ AES256_Decrypt()

clan::AES256_Decrypt::AES256_Decrypt ( )

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

◆ AES256_Encrypt()

clan::AES256_Encrypt::AES256_Encrypt ( )

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

◆ MD5()

clan::MD5::MD5 ( )

Constructs a MD5 hash generator.

◆ Random()

clan::Random::Random ( int  cache_size = 1024)

Constructs the object.

cache_size = Random number cache size

◆ Secret() [1/2]

clan::Secret::Secret ( )

Constructs a key (unset)

◆ Secret() [2/2]

clan::Secret::Secret ( unsigned int  new_key_length)

Constructs a key to a specified length.

The data is not initialised

Parameters
new_key_length= Length of the key

◆ SHA1()

clan::SHA1::SHA1 ( )

Constructs a SHA-1 hash generator.

◆ SHA224()

clan::SHA224::SHA224 ( )

Constructs a SHA-224 hash generator.

◆ SHA256()

clan::SHA256::SHA256 ( )

Constructs a SHA-256 hash generator.

◆ SHA384()

clan::SHA384::SHA384 ( )

Constructs a SHA-384 hash generator.

◆ SHA512()

clan::SHA512::SHA512 ( )

Constructs a SHA-512 hash generator.

◆ SHA512_224()

clan::SHA512_224::SHA512_224 ( )

Constructs a SHA-512_224 hash generator.

◆ SHA512_256()

clan::SHA512_256::SHA512_256 ( )

Constructs a SHA-512_256 hash generator.

◆ TLSClient()

clan::TLSClient::TLSClient ( )

Constructs a TLS client.

◆ add() [1/28]

void clan::SHA1::add ( const DataBuffer data)

Add.

Parameters
data= Data Buffer

◆ add() [2/28]

void clan::SHA224::add ( const DataBuffer data)

Add.

Parameters
data= Data Buffer

◆ add() [3/28]

void clan::SHA256::add ( const DataBuffer data)

Add.

Parameters
data= Data Buffer

◆ add() [4/28]

void clan::SHA384::add ( const DataBuffer data)

Add.

Parameters
data= Data Buffer

◆ add() [5/28]

void clan::SHA512::add ( const DataBuffer data)

Add.

Parameters
data= Data Buffer

◆ add() [6/28]

void clan::SHA512_224::add ( const DataBuffer data)

Add.

Parameters
data= Data Buffer

◆ add() [7/28]

void clan::SHA512_256::add ( const DataBuffer data)

Add.

Parameters
data= Data Buffer

◆ add() [8/28]

void clan::MD5::add ( const DataBuffer data)

Add.

Parameters
data= Data Buffer

◆ add() [9/28]

void clan::AES128_Decrypt::add ( const DataBuffer data)

Add data to be decrypted.

Parameters
data= Data Buffer

◆ add() [10/28]

void clan::AES256_Decrypt::add ( const DataBuffer data)

Add data to be decrypted.

Parameters
data= Data Buffer

◆ add() [11/28]

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

Add data to be decrypted.

Parameters
data= Data Buffer

◆ add() [12/28]

void clan::AES192_Encrypt::add ( const DataBuffer data)

Add data to be encrypted.

Parameters
data= Data Buffer

◆ add() [13/28]

void clan::AES128_Encrypt::add ( const DataBuffer data)

Add data to be encrypted.

Parameters
data= Data Buffer

◆ add() [14/28]

void clan::AES256_Encrypt::add ( const DataBuffer data)

Add data to be encrypted.

Parameters
data= Data Buffer

◆ add() [15/28]

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

Adds data to be hashed.

◆ add() [16/28]

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

Adds data to be hashed.

◆ add() [17/28]

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

Adds data to be hashed.

◆ add() [18/28]

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

Adds data to be hashed.

◆ add() [19/28]

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

Adds data to be hashed.

◆ add() [20/28]

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

Adds data to be hashed.

◆ add() [21/28]

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

Adds data to be hashed.

◆ add() [22/28]

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

Adds data to be hashed.

◆ add() [23/28]

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

Adds data to be decrypted.

◆ add() [24/28]

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

Adds data to be decrypted.

◆ add() [25/28]

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

Adds data to be decrypted.

◆ add() [26/28]

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

Adds data to be encrypted.

◆ add() [27/28]

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

Adds data to be encrypted.

◆ add() [28/28]

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

Adds data to be encrypted.

◆ adler32()

static uint32_t clan::HashFunctions::adler32 ( const void *  data,
int  size,
uint32_t  running_adler32 = 0 
)
static

Calculate a CRC32 checksum on the data.

◆ calculate() [1/14]

void clan::SHA1::calculate ( )

Finalize hash calculation.

◆ calculate() [2/14]

void clan::SHA224::calculate ( )

Finalize hash calculation.

◆ calculate() [3/14]

void clan::SHA256::calculate ( )

Finalize hash calculation.

◆ calculate() [4/14]

void clan::SHA384::calculate ( )

Finalize hash calculation.

◆ calculate() [5/14]

void clan::SHA512::calculate ( )

Finalize hash calculation.

◆ calculate() [6/14]

void clan::SHA512_224::calculate ( )

Finalize hash calculation.

◆ calculate() [7/14]

void clan::SHA512_256::calculate ( )

Finalize hash calculation.

◆ calculate() [8/14]

void clan::MD5::calculate ( )

Finalize hash calculation.

◆ calculate() [9/14]

void clan::AES192_Encrypt::calculate ( )

Finalize encryption.

◆ calculate() [10/14]

void clan::AES128_Encrypt::calculate ( )

Finalize encryption.

◆ calculate() [11/14]

void clan::AES256_Encrypt::calculate ( )

Finalize encryption.

◆ calculate() [12/14]

bool clan::AES128_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.

◆ calculate() [13/14]

bool clan::AES256_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.

◆ calculate() [14/14]

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.

◆ crc32()

static uint32_t clan::HashFunctions::crc32 ( const void *  data,
int  size,
uint32_t  running_crc = 0 
)
static

Calculate a CRC32 checksum on the data.

◆ create_keypair()

static void clan::RSA::create_keypair ( Random random,
Secret out_private_exponent,
DataBuffer out_public_exponent,
DataBuffer out_modulus,
int  key_size_in_bits = 1024,
int  public_exponent_value = 65537 
)
static

Create a keypair.

Parameters
random= Random number generator
out_private_exponent= Private exponent (to decrypt with)
out_public_exponent= Public exponent (to encrypt with)
out_modulus= Modulus
key_size_in_bits= key size in bits
public_exponent_value= public exponent value

◆ decrypt() [1/3]

static Secret clan::RSA::decrypt ( const Secret in_private_exponent,
const DataBuffer in_modulus,
const DataBuffer in_data 
)
static

Decrypt.

Warning: An exception may be thrown when decrypting if in_data is not valid. Be careful handling this, to prevent "timing attacks"

Parameters
in_private_exponent= Private exponent
in_modulus= Modulus
in_data= Data to decrypt (length equals in_modulus.get_size())
Returns
Decrypted data

◆ decrypt() [2/3]

static Secret clan::RSA::decrypt ( const Secret in_private_exponent,
const void *  in_modulus,
unsigned int  in_modulus_size,
const void *  in_data,
unsigned int  in_data_size 
)
static

Decrypt.

Warning: An exception may be thrown when decrypting if in_data is not valid. Be careful handling this, to prevent "timing attacks"

Parameters
in_private_exponent= Private exponent
in_modulus= Modulus
in_modulus_size= size in bytes of in_modulus
in_data= Data to encrypt
in_data_size= size in bytes of in_data (length equals in_modulus_size)
Returns
Decrypted data

◆ decrypt() [3/3]

int clan::TLSClient::decrypt ( const void *  data,
int  size 
)

Adds data to be decrypted.

◆ decrypted_data_consumed()

void clan::TLSClient::decrypted_data_consumed ( int  size)

Marks decrypted data as consumed.

◆ encrypt() [1/3]

int clan::TLSClient::encrypt ( const void *  data,
int  size 
)

Adds data to be encrypted.

◆ encrypt() [2/3]

static DataBuffer clan::RSA::encrypt ( int  block_type,
Random random,
const DataBuffer in_public_exponent,
const DataBuffer in_modulus,
const Secret in_data 
)
static

Encrypt.

Parameters
block_type= 0 (private key), 1 (private key) or 2 (public key)
random= Random number generator
in_public_exponent= Public exponent
in_modulus= Modulus
in_data= Data to encrypt (maximum length is in_modulus.get_size() - 11)
Returns
Encrypted data

◆ encrypt() [3/3]

static DataBuffer clan::RSA::encrypt ( int  block_type,
Random random,
const void *  in_public_exponent,
unsigned int  in_public_exponent_size,
const void *  in_modulus,
unsigned int  in_modulus_size,
const void *  in_data,
unsigned int  in_data_size 
)
static

Encrypt.

Parameters
block_type= 0 (private key), 1 (private key) or 2 (public key)
random= Random number generator
in_public_exponent= Public exponent
in_public_exponent_size= size in bytes of in_public_exponent
in_modulus= Modulus
in_modulus_size= size in bytes of in_modulus
in_data= Data to encrypt
in_data_size= size in bytes of in_data (maximum size is in_modulus_size - 11)
Returns
Encrypted data

◆ encrypted_data_consumed()

void clan::TLSClient::encrypted_data_consumed ( int  size)

Marks encrypted data as consumed.

◆ get_data() [1/7]

DataBuffer clan::AES256_Encrypt::get_data ( ) const

Get encrypted data.

This is the databuffer used internally to store the encrypted 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

◆ get_data() [2/7]

DataBuffer clan::AES128_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

◆ get_data() [3/7]

DataBuffer clan::AES256_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

◆ get_data() [4/7]

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

◆ get_data() [5/7]

DataBuffer clan::AES128_Encrypt::get_data ( ) const

Get encrypted data.

This is the databuffer used internally to store the encrypted 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

◆ get_data() [6/7]

DataBuffer clan::AES192_Encrypt::get_data ( ) const

Get encrypted data.

This is the databuffer used internally to store the encrypted 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

◆ get_data() [7/7]

unsigned char* clan::Secret::get_data ( ) const

Get the key data.

Returns
The key

◆ get_decrypted_data()

const void* clan::TLSClient::get_decrypted_data ( ) const

Return a pointer to decrypted data available for consumption.

◆ get_decrypted_data_available()

int clan::TLSClient::get_decrypted_data_available ( ) const

Returns how much decrypted data is available.

◆ get_encrypted_data()

const void* clan::TLSClient::get_encrypted_data ( ) const

Return a pointer to encrypted data available for consumption.

◆ get_encrypted_data_available()

int clan::TLSClient::get_encrypted_data_available ( ) const

Returns how much encrypted data is available.

◆ get_hash() [1/16]

std::string clan::SHA1::get_hash ( bool  uppercase = false) const

Returns the calculated hash.

◆ get_hash() [2/16]

std::string clan::SHA224::get_hash ( bool  uppercase = false) const

Returns the calculated hash.

◆ get_hash() [3/16]

std::string clan::SHA256::get_hash ( bool  uppercase = false) const

Returns the calculated hash.

◆ get_hash() [4/16]

std::string clan::SHA384::get_hash ( bool  uppercase = false) const

Returns the calculated hash.

◆ get_hash() [5/16]

std::string clan::SHA512::get_hash ( bool  uppercase = false) const

Returns the calculated hash.

◆ get_hash() [6/16]

std::string clan::SHA512_224::get_hash ( bool  uppercase = false) const

Returns the calculated hash.

◆ get_hash() [7/16]

std::string clan::SHA512_256::get_hash ( bool  uppercase = false) const

Returns the calculated hash.

◆ get_hash() [8/16]

std::string clan::MD5::get_hash ( bool  uppercase = false) const

Returns the calculated hash.

◆ get_hash() [9/16]

void clan::SHA1::get_hash ( unsigned char  out_hash[hash_size]) const

Get hash.

Parameters
out_hash= where to write to

◆ get_hash() [10/16]

void clan::SHA224::get_hash ( unsigned char  out_hash[hash_size]) const

Get hash.

Parameters
out_hash= where to write to

◆ get_hash() [11/16]

void clan::SHA256::get_hash ( unsigned char  out_hash[hash_size]) const

Get hash.

Parameters
out_hash= where to write to

◆ get_hash() [12/16]

void clan::SHA384::get_hash ( unsigned char  out_hash[hash_size]) const

Get hash.

Parameters
out_hash= where to write to

◆ get_hash() [13/16]

void clan::SHA512::get_hash ( unsigned char  out_hash[hash_size]) const

Get hash.

Parameters
out_hash= where to write to

◆ get_hash() [14/16]

void clan::SHA512_224::get_hash ( unsigned char  out_hash[hash_size]) const

Get hash.

Parameters
out_hash= where to write to

◆ get_hash() [15/16]

void clan::SHA512_256::get_hash ( unsigned char  out_hash[hash_size]) const

Get hash.

Parameters
out_hash= where to write to

◆ get_hash() [16/16]

void clan::MD5::get_hash ( unsigned char  out_hash[hash_size]) const

Get hash.

Parameters
out_hash= where to write to

◆ get_random_bool()

bool clan::Random::get_random_bool ( )

Get the random boolean.

out_dest_ptr = Where to write to num_bytes = Number of bytes to copy

◆ get_random_bytes()

void clan::Random::get_random_bytes ( unsigned char *  out_dest_ptr,
int  num_bytes 
)

Get the random bytes.

out_dest_ptr = Where to write to num_bytes = Number of bytes to copy

◆ get_random_bytes_nzero()

void clan::Random::get_random_bytes_nzero ( unsigned char *  out_dest_ptr,
int  num_bytes 
)

Get the random bytes excluding bytes containing 0.

out_dest_ptr = Where to write to num_bytes = Number of bytes to copy

◆ get_size()

unsigned int clan::Secret::get_size ( ) const

Get the key size.

Returns
The key size

◆ md5() [1/6]

static std::string clan::HashFunctions::md5 ( const DataBuffer data,
bool  uppercase = false 
)
static

MD5.

Parameters
data= Data Buffer
uppercase= bool
Returns
String8

◆ md5() [2/6]

static void clan::HashFunctions::md5 ( const DataBuffer data,
unsigned char  out_hash[16] 
)
static

MD5.

Parameters
data= Data Buffer
out_hash= char

◆ md5() [3/6]

static std::string clan::HashFunctions::md5 ( const std::string &  data,
bool  uppercase = false 
)
static

MD5.

Parameters
data= String Ref8
uppercase= bool
Returns
String8

◆ md5() [4/6]

static void clan::HashFunctions::md5 ( const std::string &  data,
unsigned char  out_hash[16] 
)
static

MD5.

Parameters
data= String Ref8
out_hash= char

◆ md5() [5/6]

static std::string clan::HashFunctions::md5 ( const void *  data,
int  size,
bool  uppercase = false 
)
static

Generate SHA-1 hash from data.

◆ md5() [6/6]

static void clan::HashFunctions::md5 ( const void *  data,
int  size,
unsigned char  out_hash[16] 
)
static

MD5.

Parameters
data= void
size= value
out_hash= char

◆ reset() [1/14]

void clan::SHA1::reset ( )

Resets the hash generator.

◆ reset() [2/14]

void clan::AES256_Decrypt::reset ( )

Resets the decryption.

◆ reset() [3/14]

void clan::AES192_Decrypt::reset ( )

Resets the decryption.

◆ reset() [4/14]

void clan::SHA512::reset ( )

Resets the hash generator.

◆ reset() [5/14]

void clan::SHA512_224::reset ( )

Resets the hash generator.

◆ reset() [6/14]

void clan::SHA384::reset ( )

Resets the hash generator.

◆ reset() [7/14]

void clan::SHA512_256::reset ( )

Resets the hash generator.

◆ reset() [8/14]

void clan::MD5::reset ( )

Resets the hash generator.

◆ reset() [9/14]

void clan::SHA224::reset ( )

Resets the hash generator.

◆ reset() [10/14]

void clan::AES128_Decrypt::reset ( )

Resets the decryption.

◆ reset() [11/14]

void clan::SHA256::reset ( )

Resets the hash generator.

◆ reset() [12/14]

void clan::AES192_Encrypt::reset ( )

Resets the encryption.

◆ reset() [13/14]

void clan::AES128_Encrypt::reset ( )

Resets the encryption.

◆ reset() [14/14]

void clan::AES256_Encrypt::reset ( )

Resets the encryption.

◆ set_hmac() [1/8]

void clan::SHA1::set_hmac ( const void *  key_data,
int  key_size 
)

Enable a HMAC based calculation.

Call this function before the initial add(). It is reset by reset()

Parameters
key_data= The HMAC key
key_size= The size of the key_data

◆ set_hmac() [2/8]

void clan::SHA224::set_hmac ( const void *  key_data,
int  key_size 
)

Enable a HMAC based calculation.

Call this function before the initial add(). It is reset by reset()

Parameters
key_data= The HMAC key
key_size= The size of the key_data

◆ set_hmac() [3/8]

void clan::SHA256::set_hmac ( const void *  key_data,
int  key_size 
)

Enable a HMAC based calculation.

Call this function before the initial add(). It is reset by reset()

Parameters
key_data= The HMAC key
key_size= The size of the key_data

◆ set_hmac() [4/8]

void clan::SHA512_256::set_hmac ( const void *  key_data,
int  key_size 
)

Enable a HMAC based calculation.

Call this function before the initial add(). It is reset by reset()

Parameters
key_data= The HMAC key
key_size= The size of the key_data

◆ set_hmac() [5/8]

void clan::SHA384::set_hmac ( const void *  key_data,
int  key_size 
)

Enable a HMAC based calculation.

Call this function before the initial add(). It is reset by reset()

Parameters
key_data= The HMAC key
key_size= The size of the key_data

◆ set_hmac() [6/8]

void clan::SHA512::set_hmac ( const void *  key_data,
int  key_size 
)

Enable a HMAC based calculation.

Call this function before the initial add(). It is reset by reset()

Parameters
key_data= The HMAC key
key_size= The size of the key_data

◆ set_hmac() [7/8]

void clan::SHA512_224::set_hmac ( const void *  key_data,
int  key_size 
)

Enable a HMAC based calculation.

Call this function before the initial add(). It is reset by reset()

Parameters
key_data= The HMAC key
key_size= The size of the key_data

◆ set_hmac() [8/8]

void clan::MD5::set_hmac ( const void *  key_data,
int  key_size 
)

Enable a HMAC based calculation.

Call this function before the initial add(). It is reset by reset()

Parameters
key_data= The HMAC key
key_size= The size of the key_data

◆ set_iv() [1/6]

void clan::AES256_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()

◆ set_iv() [2/6]

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()

◆ set_iv() [3/6]

void clan::AES128_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()

◆ set_iv() [4/6]

void clan::AES192_Encrypt::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()

◆ set_iv() [5/6]

void clan::AES256_Encrypt::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()

◆ set_iv() [6/6]

void clan::AES128_Encrypt::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()

◆ set_key() [1/6]

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

Sets the cipher key.

This must be called before the initial add()

◆ set_key() [2/6]

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

Sets the cipher key.

This must be called before the initial add()

◆ set_key() [3/6]

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

Sets the cipher key.

This must be called before the initial add()

◆ set_key() [4/6]

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

Sets the cipher key.

This must be called before the initial add()

◆ set_key() [5/6]

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

Sets the cipher key.

This must be called before the initial add()

◆ set_key() [6/6]

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

Sets the cipher key.

This must be called before the initial add()

◆ set_padding() [1/6]

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)

◆ set_padding() [2/6]

void clan::AES128_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)

◆ set_padding() [3/6]

void clan::AES256_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)

◆ set_padding() [4/6]

void clan::AES192_Encrypt::set_padding ( bool  value = true,
bool  use_pkcs7 = true,
unsigned int  num_additional_padded_blocks = 0 
)

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)
num_additional_padded_blocks= (Only valid when use_pkcs7==false). Set to "frustrate attacks on a protocol based on analysis of the lengths of exchanged messages". (Range 0 to 15)

◆ set_padding() [5/6]

void clan::AES128_Encrypt::set_padding ( bool  value = true,
bool  use_pkcs7 = true,
unsigned int  num_additional_padded_blocks = 0 
)

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)
num_additional_padded_blocks= (Only valid when use_pkcs7==false). Set to "frustrate attacks on a protocol based on analysis of the lengths of exchanged messages". (Range 0 to 15)

◆ set_padding() [6/6]

void clan::AES256_Encrypt::set_padding ( bool  value = true,
bool  use_pkcs7 = true,
unsigned int  num_additional_padded_blocks = 0 
)

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)
num_additional_padded_blocks= (Only valid when use_pkcs7==false). Set to "frustrate attacks on a protocol based on analysis of the lengths of exchanged messages". (Range 0 to 15)

◆ sha1() [1/6]

static std::string clan::HashFunctions::sha1 ( const DataBuffer data,
bool  uppercase = false 
)
static

SHA1.

Parameters
data= Data Buffer
uppercase= bool
Returns
String8

◆ sha1() [2/6]

static void clan::HashFunctions::sha1 ( const DataBuffer data,
unsigned char  out_hash[20] 
)
static

SHA1.

Parameters
data= Data Buffer
out_hash= char

◆ sha1() [3/6]

static std::string clan::HashFunctions::sha1 ( const std::string &  data,
bool  uppercase = false 
)
static

SHA1.

Parameters
data= String Ref8
uppercase= bool
Returns
String8

◆ sha1() [4/6]

static void clan::HashFunctions::sha1 ( const std::string &  data,
unsigned char  out_hash[20] 
)
static

SHA1.

Parameters
data= String Ref8
out_hash= char

◆ sha1() [5/6]

static std::string clan::HashFunctions::sha1 ( const void *  data,
int  size,
bool  uppercase = false 
)
static

Generate SHA-1 hash from data.

◆ sha1() [6/6]

static void clan::HashFunctions::sha1 ( const void *  data,
int  size,
unsigned char  out_hash[20] 
)
static

SHA1.

Parameters
data= void
size= value
out_hash= char

◆ sha224() [1/6]

static std::string clan::HashFunctions::sha224 ( const DataBuffer data,
bool  uppercase = false 
)
static

SHA224.

Parameters
data= Data Buffer
uppercase= bool
Returns
String8

◆ sha224() [2/6]

static void clan::HashFunctions::sha224 ( const DataBuffer data,
unsigned char  out_hash[28] 
)
static

SHA224.

Parameters
data= Data Buffer
out_hash= char

◆ sha224() [3/6]

static std::string clan::HashFunctions::sha224 ( const std::string &  data,
bool  uppercase = false 
)
static

SHA224.

Parameters
data= String Ref8
uppercase= bool
Returns
String8

◆ sha224() [4/6]

static void clan::HashFunctions::sha224 ( const std::string &  data,
unsigned char  out_hash[28] 
)
static

SHA224.

Parameters
data= String Ref8
out_hash= char

◆ sha224() [5/6]

static std::string clan::HashFunctions::sha224 ( const void *  data,
int  size,
bool  uppercase = false 
)
static

Generate SHA-224 hash from data.

◆ sha224() [6/6]

static void clan::HashFunctions::sha224 ( const void *  data,
int  size,
unsigned char  out_hash[28] 
)
static

SHA224.

Parameters
data= void
size= value
out_hash= char

◆ sha256() [1/6]

static std::string clan::HashFunctions::sha256 ( const DataBuffer data,
bool  uppercase = false 
)
static

SHA256.

Parameters
data= Data Buffer
uppercase= bool
Returns
String8

◆ sha256() [2/6]

static void clan::HashFunctions::sha256 ( const DataBuffer data,
unsigned char  out_hash[32] 
)
static

SHA256.

Parameters
data= Data Buffer
out_hash= char

◆ sha256() [3/6]

static std::string clan::HashFunctions::sha256 ( const std::string &  data,
bool  uppercase = false 
)
static

SHA256.

Parameters
data= String Ref8
uppercase= bool
Returns
String8

◆ sha256() [4/6]

static void clan::HashFunctions::sha256 ( const std::string &  data,
unsigned char  out_hash[32] 
)
static

SHA256.

Parameters
data= String Ref8
out_hash= char

◆ sha256() [5/6]

static std::string clan::HashFunctions::sha256 ( const void *  data,
int  size,
bool  uppercase = false 
)
static

Generate SHA-256 hash from data.

◆ sha256() [6/6]

static void clan::HashFunctions::sha256 ( const void *  data,
int  size,
unsigned char  out_hash[32] 
)
static

SHA256.

Parameters
data= void
size= value
out_hash= char

◆ sha384() [1/6]

static std::string clan::HashFunctions::sha384 ( const DataBuffer data,
bool  uppercase = false 
)
static

SHA384.

Parameters
data= Data Buffer
uppercase= bool
Returns
String8

◆ sha384() [2/6]

static void clan::HashFunctions::sha384 ( const DataBuffer data,
unsigned char  out_hash[48] 
)
static

SHA384.

Parameters
data= Data Buffer
out_hash= char

◆ sha384() [3/6]

static std::string clan::HashFunctions::sha384 ( const std::string &  data,
bool  uppercase = false 
)
static

SHA384.

Parameters
data= String Ref8
uppercase= bool
Returns
String8

◆ sha384() [4/6]

static void clan::HashFunctions::sha384 ( const std::string &  data,
unsigned char  out_hash[48] 
)
static

SHA384.

Parameters
data= String Ref8
out_hash= char

◆ sha384() [5/6]

static std::string clan::HashFunctions::sha384 ( const void *  data,
int  size,
bool  uppercase = false 
)
static

Generate SHA-384 hash from data.

◆ sha384() [6/6]

static void clan::HashFunctions::sha384 ( const void *  data,
int  size,
unsigned char  out_hash[48] 
)
static

SHA384.

Parameters
data= void
size= value
out_hash= char

◆ sha512() [1/6]

static std::string clan::HashFunctions::sha512 ( const DataBuffer data,
bool  uppercase = false 
)
static

SHA512.

Parameters
data= Data Buffer
uppercase= bool
Returns
String8

◆ sha512() [2/6]

static void clan::HashFunctions::sha512 ( const DataBuffer data,
unsigned char  out_hash[64] 
)
static

SHA512.

Parameters
data= Data Buffer
out_hash= char

◆ sha512() [3/6]

static std::string clan::HashFunctions::sha512 ( const std::string &  data,
bool  uppercase = false 
)
static

SHA512.

Parameters
data= String Ref8
uppercase= bool
Returns
String8

◆ sha512() [4/6]

static void clan::HashFunctions::sha512 ( const std::string &  data,
unsigned char  out_hash[64] 
)
static

SHA512.

Parameters
data= String Ref8
out_hash= char

◆ sha512() [5/6]

static std::string clan::HashFunctions::sha512 ( const void *  data,
int  size,
bool  uppercase = false 
)
static

Generate SHA-512 hash from data.

◆ sha512() [6/6]

static void clan::HashFunctions::sha512 ( const void *  data,
int  size,
unsigned char  out_hash[64] 
)
static

SHA512.

Parameters
data= void
size= value
out_hash= char

◆ sha512_224() [1/6]

static std::string clan::HashFunctions::sha512_224 ( const DataBuffer data,
bool  uppercase = false 
)
static

SHA512_224.

Parameters
data= Data Buffer
uppercase= bool
Returns
String8

◆ sha512_224() [2/6]

static void clan::HashFunctions::sha512_224 ( const DataBuffer data,
unsigned char  out_hash[28] 
)
static

SHA512_224.

Parameters
data= Data Buffer
out_hash= char

◆ sha512_224() [3/6]

static std::string clan::HashFunctions::sha512_224 ( const std::string &  data,
bool  uppercase = false 
)
static

SHA512_224.

Parameters
data= String Ref8
uppercase= bool
Returns
String8

◆ sha512_224() [4/6]

static void clan::HashFunctions::sha512_224 ( const std::string &  data,
unsigned char  out_hash[28] 
)
static

SHA512_224.

Parameters
data= String Ref8
out_hash= char

◆ sha512_224() [5/6]

static std::string clan::HashFunctions::sha512_224 ( const void *  data,
int  size,
bool  uppercase = false 
)
static

Generate SHA-512_224 hash from data.

◆ sha512_224() [6/6]

static void clan::HashFunctions::sha512_224 ( const void *  data,
int  size,
unsigned char  out_hash[28] 
)
static

SHA512_224.

Parameters
data= void
size= value
out_hash= char

◆ sha512_256() [1/6]

static std::string clan::HashFunctions::sha512_256 ( const DataBuffer data,
bool  uppercase = false 
)
static

SHA512_256.

Parameters
data= Data Buffer
uppercase= bool
Returns
String8

◆ sha512_256() [2/6]

static void clan::HashFunctions::sha512_256 ( const DataBuffer data,
unsigned char  out_hash[32] 
)
static

SHA512_256.

Parameters
data= Data Buffer
out_hash= char

◆ sha512_256() [3/6]

static std::string clan::HashFunctions::sha512_256 ( const std::string &  data,
bool  uppercase = false 
)
static

SHA512_256.

Parameters
data= String Ref8
uppercase= bool
Returns
String8

◆ sha512_256() [4/6]

static void clan::HashFunctions::sha512_256 ( const std::string &  data,
unsigned char  out_hash[32] 
)
static

SHA512_256.

Parameters
data= String Ref8
out_hash= char

◆ sha512_256() [5/6]

static std::string clan::HashFunctions::sha512_256 ( const void *  data,
int  size,
bool  uppercase = false 
)
static

Generate SHA-512_256 hash from data.

◆ sha512_256() [6/6]

static void clan::HashFunctions::sha512_256 ( const void *  data,
int  size,
unsigned char  out_hash[32] 
)
static

SHA512_256.

Parameters
data= void
size= value
out_hash= char

Variable Documentation

◆ block_size [1/3]

const int clan::AES128_Encrypt::block_size = 16
static

◆ block_size [2/3]

const int clan::AES256_Encrypt::block_size = 16
static

◆ block_size [3/3]

const int clan::AES192_Encrypt::block_size = 16
static

◆ hash_size [1/8]

const int clan::SHA1::hash_size = 20
static

◆ hash_size [2/8]

const int clan::SHA384::hash_size = 48
static

◆ hash_size [3/8]

const int clan::SHA512::hash_size = 64
static

◆ hash_size [4/8]

const int clan::SHA512_224::hash_size = 28
static

◆ hash_size [5/8]

const int clan::SHA512_256::hash_size = 32
static

◆ hash_size [6/8]

const int clan::MD5::hash_size = 16
static

◆ hash_size [7/8]

const int clan::SHA224::hash_size = 28
static

◆ hash_size [8/8]

const int clan::SHA256::hash_size = 32
static

◆ iv_size [1/6]

const int clan::AES256_Encrypt::iv_size = 16
static

◆ iv_size [2/6]

const int clan::AES128_Decrypt::iv_size = 16
static

◆ iv_size [3/6]

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

◆ iv_size [4/6]

const int clan::AES192_Encrypt::iv_size = 16
static

◆ iv_size [5/6]

const int clan::AES256_Decrypt::iv_size = 16
static

◆ iv_size [6/6]

const int clan::AES128_Encrypt::iv_size = 16
static

◆ key_size [1/6]

const int clan::AES192_Encrypt::key_size = 24
static

◆ key_size [2/6]

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

◆ key_size [3/6]

const int clan::AES128_Encrypt::key_size = 16
static

◆ key_size [4/6]

const int clan::AES128_Decrypt::key_size = 16
static

◆ key_size [5/6]

const int clan::AES256_Encrypt::key_size = 32
static

◆ key_size [6/6]

const int clan::AES256_Decrypt::key_size = 32
static