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::CFB< keybits > Class Template Reference

#include <rijndael.h>

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

Public Types

typedef Byte Key [KEYLENGTH(keybits)]
 
typedef Block IV
 
- Public Types inherited from Rijndael::ECB< keybits >
typedef Byte Key [KEYLENGTH(keybits)]
 

Public Member Functions

 CFB (const Key key, const IV iv)
 Initialize encryption/decription state. More...
 
void encrypt (const Block plaintext, Block ciphertext)
 Encrypt a block of 16 bytes, with IV (CFB mode) More...
 
void decrypt (const Block ciphertext, Block plaintext)
 Decrypt a block of 16 bytes, with IV (CFB mode) More...
 
- Public Member Functions inherited from Rijndael::ECB< keybits >
 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 Block Rijndael::CFB< keybits >::IV
template<int keybits>
typedef Byte Rijndael::CFB< keybits >::Key[KEYLENGTH(keybits)]

Constructor & Destructor Documentation

template<int keybits>
Rijndael::CFB< keybits >::CFB ( const Key  key,
const IV  iv 
)

Initialize encryption/decription state.

Parameters
[in]keyAES key, where length is: keybits number of bytes 128 16 192 24 256 32
See also
KEYLENGTH macro.
Parameters
[in]ivinitialization vector. Some randomness needed to enforce the sequence is non replayable.
Rijndael::CFB<128>::Key key = "my big secret";
Rijndael::CFB<128> enc(key, iv);
...
Rijndael::Block plain = "Hello World!";
Rijndael::Block cipher, again;
enc.encrypt(plain, cipher);
enc.decrypt(cipher, again);

Member Function Documentation

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

Decrypt a block of 16 bytes, with IV (CFB mode)

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

Encrypt a block of 16 bytes, with IV (CFB mode)

Parameters
[in]plaintextThe 16 bytes block to encrypt.
[out]ciphertextSpace to store the 16 bytes of encrypted data.

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