COSA
An Object-Oriented Platform for Arduino Programming
Vigenere< N > Class Template Reference

#include <Vigenere.hh>

Collaboration diagram for Vigenere< N >:
Collaboration graph

Public Member Functions

 Vigenere (uint32_t seed, uint8_t n=N)
 
 Vigenere (const char *password)
 
void restart ()
 
char encrypt (char c)
 
void encrypt (void *buf, size_t n)
 
void encrypt (void *dest, const void *src, size_t n)
 
char decrypt (char c)
 
void decrypt (void *buf, size_t n)
 
void decrypt (void *dest, const void *src, size_t n)
 

Detailed Description

template<uint8_t N>
class Vigenere< N >

Vigenere auto-key cipher.

Parameters
[in]Nnumber of bytes in key.

References

http://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher

Definition at line 34 of file Vigenere.hh.

Constructor & Destructor Documentation

template<uint8_t N>
Vigenere< N >::Vigenere ( uint32_t  seed,
uint8_t  n = N 
)
inline

Construct Vigenere crypto with key generated from given seed. An autokey is generated when key length (n) is less than max key length (N).

Parameters
[in]seedfor random key generation.
[in]nlength of random key.

Definition at line 43 of file Vigenere.hh.

template<uint8_t N>
Vigenere< N >::Vigenere ( const char *  password)
inline

Construct Vigenere crypto with given password. An autokey is generated when the password length is less than max key length (N).

Parameters
[in]password.

Definition at line 59 of file Vigenere.hh.

Member Function Documentation

template<uint8_t N>
char Vigenere< N >::decrypt ( char  c)
inline

Decrypt the given character.

Parameters
[in]ccharacter to decode.
Returns
decoded character.

Definition at line 120 of file Vigenere.hh.

template<uint8_t N>
void Vigenere< N >::decrypt ( void *  buf,
size_t  n 
)
inline

Decrypt the given buffer.

Parameters
[in]bufbuffer pointer.
[in]nnumber of bytes.

Definition at line 133 of file Vigenere.hh.

template<uint8_t N>
void Vigenere< N >::decrypt ( void *  dest,
const void *  src,
size_t  n 
)
inline

Decrypt the given src buffer to the dest buffer.

Parameters
[in]destbuffer pointer.
[in]srcbuffer pointer.
[in]nnumber of bytes.

Definition at line 145 of file Vigenere.hh.

template<uint8_t N>
char Vigenere< N >::encrypt ( char  c)
inline

Encrypt the given character.

Parameters
[in]ccharacter to encode.
Returns
encoded character.

Definition at line 83 of file Vigenere.hh.

template<uint8_t N>
void Vigenere< N >::encrypt ( void *  buf,
size_t  n 
)
inline

Encrypt the given buffer.

Parameters
[in]bufbuffer pointer.
[in]nnumber of bytes.

Definition at line 96 of file Vigenere.hh.

template<uint8_t N>
void Vigenere< N >::encrypt ( void *  dest,
const void *  src,
size_t  n 
)
inline

Encrypt the given src buffer to the dest buffer.

Parameters
[in]destbuffer pointer.
[in]srcbuffer pointer.
[in]nnumber of bytes.

Definition at line 108 of file Vigenere.hh.

template<uint8_t N>
void Vigenere< N >::restart ( )
inline

Restart the crypto. Generate a new auto-key.

Definition at line 72 of file Vigenere.hh.


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