#include <cypher.h>
Inheritance diagram for PTEACypher:
Public Member Functions | |
PTEACypher (BlockChainMode chainMode=ElectronicCodebook) | |
PTEACypher (const Key &keyData, BlockChainMode chainMode=ElectronicCodebook) | |
void | SetKey (const Key &newKey) |
void | GetKey (Key &newKey) const |
Static Public Member Functions | |
static void | GenerateKey (Key &newKey) |
Protected Member Functions | |
virtual void | Initialise (BOOL encoding) |
virtual void | EncodeBlock (const void *in, void *out) |
virtual void | DecodeBlock (const void *in, void *out) |
Classes | |
struct | Key |
This is a simple algorithm using a 128 bit binary key and encrypts data in 64 bit blocks.
PTEACypher::PTEACypher | ( | BlockChainMode | chainMode = ElectronicCodebook |
) |
Create a new TEA encryption object instance. The parameterless version automatically generates a new, random, key.
chainMode | Block chain mode |
PTEACypher::PTEACypher | ( | const Key & | keyData, | |
BlockChainMode | chainMode = ElectronicCodebook | |||
) |
keyData | Key for the encryption/decryption algorithm. |
chainMode | Block chain mode |
void PTEACypher::SetKey | ( | const Key & | newKey | ) |
Set the key used by this encryption method.
newKey | Variable to take the key used by cypher. |
void PTEACypher::GetKey | ( | Key & | newKey | ) | const |
Get the key used by this encryption method.
newKey | Variable to take the key used by cypher. |
static void PTEACypher::GenerateKey | ( | Key & | newKey | ) | [static] |
Generate a new key suitable for use for encryption using random data.
newKey | Variable to take the newly generated key. |
virtual void PTEACypher::Initialise | ( | BOOL | encoding | ) | [protected, virtual] |
Initialise the encoding/decoding sequence.
encoding | Flag for encoding/decoding sequence about to start. |
Implements PCypher.
virtual void PTEACypher::EncodeBlock | ( | const void * | in, | |
void * | out | |||
) | [protected, virtual] |
Encode an n bit block of memory according to the encryption algorithm.
in | Pointer to clear n bit block. |
out | Pointer to coded n bit block. |
Implements PCypher.
virtual void PTEACypher::DecodeBlock | ( | const void * | in, | |
void * | out | |||
) | [protected, virtual] |
Decode an n bit block of memory according to the encryption algorithm.
in | Pointer to coded n bit block. |
out | Pointer to clear n bit block. |
Implements PCypher.