OSTC Companion  3.0
Companion sofftware for H&W dive computers
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | List of all members
Rijndael::ECB< keybits > Class Template Reference

#include <rijndael.h>

Inheritance diagram for Rijndael::ECB< keybits >:
Inheritance graph
[legend]

Public Types

typedef Byte Key [KEYLENGTH(keybits)]
 

Public Member Functions

 ECB ()
 
void setupEncrypt (const Key key)
 Initialize encryption state. More...
 
void encrypt (const Block plaintext, Block ciphertext)
 Encrypt a block of 16 bytes. More...
 
void setupDecrypt (const Key key)
 Initialize decryption state. More...
 
void decrypt (const Block ciphertext, Block plaintext)
 Decrypt a block of 16 bytes. More...
 
Word32 get_random ()
 Crypto base PRNG. More...
 

Member Typedef Documentation

template<int keybits>
typedef Byte Rijndael::ECB< keybits >::Key[KEYLENGTH(keybits)]

Constructor & Destructor Documentation

template<int keybits>
Rijndael::ECB< keybits >::ECB ( )

Member Function Documentation

template<int keybits>
void Rijndael::ECB< keybits >::decrypt ( const Block  ciphertext,
Block  plaintext 
)

Decrypt a block of 16 bytes.

Parameters
[in]ciphertextThe 16 bytes block of data to decrypt.
[out]plaintextSpace to store the 16 bytes result block.
template<int keybits>
void Rijndael::ECB< keybits >::encrypt ( const Block  plaintext,
Block  ciphertext 
)

Encrypt a block of 16 bytes.

Parameters
[in]plaintextThe 16 bytes block to encrypt.
[out]ciphertextSpace to store the 16 bytes of encrypted data.
template<int keybits>
Word32 Rijndael::ECB< keybits >::get_random ( )

Crypto base PRNG.

Based on wall-clock value and current key, but should be a crypto-secure generator.

template<int keybits>
void Rijndael::ECB< keybits >::setupDecrypt ( const Key  key)

Initialize decryption state.

Parameters
[in]keyAES key, where length is: keybits number of bytes 128 16 192 24 256 32
See also
KEYLENGTH macro.
Rijndael::ECB<128>::Key key = "my big secret";
dec.setupDecrypt(key);
...
Rijndael::Block cipher = ...;
Rijndael::decrypt(cipher, result);
template<int keybits>
void Rijndael::ECB< keybits >::setupEncrypt ( const Key  key)

Initialize encryption state.

Parameters
[in]keyAES key, where length is: keybits number of bytes 128 16 192 24 256 32
See also
KEYLENGTH macro.
Rijndael::ECB<128>::Key key = "my big secret";
enc.setupEncrypt(key);
...
Rijndael::Block plain = "Hello World!";
enc.encrypt(plain, result);

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