feisty meow concerns codebase 2.140
crypto::twofish_crypto Class Reference

#include <twofish_crypto.h>

Inheritance diagram for crypto::twofish_crypto:
Collaboration diagram for crypto::twofish_crypto:

Public Member Functions

 twofish_crypto (int key_size)
 this will create a new random key of the "key_size", in bits.
 
 twofish_crypto (const basis::byte_array &key, int key_size)
 uses a pre-existing "key".
 
 twofish_crypto (const twofish_crypto &to_copy)
 copy constructor.
 
virtual ~twofish_crypto ()
 
twofish_crypto & operator= (const twofish_crypto &to_copy)
 
 DEFINE_CLASS_NAME ("twofish_crypto")
 
virtual int minimum_key_size_in_bits () const
 returns the minimum key size in bits supported here.
 
virtual int maximum_key_size_in_bits () const
 returns the maximum key size in bits supported here.
 
- Public Member Functions inherited from crypto::cryptical_envelopment
 cryptical_envelopment (const EVP_CIPHER *cipher_type)
 constructor requires the type of encryption to use.
 
 cryptical_envelopment (const cryptical_envelopment &to_copy)
 copy constructor.
 
virtual ~cryptical_envelopment ()
 
cryptical_envelopment & operator= (const cryptical_envelopment &to_copy)
 
bool set_key (int key_size)
 this will create a new random key of the "key_size", in bits.
 
bool set_key (const basis::byte_array &new_key, int key_size)
 sets the encryption key to "new_key" with a "key_size" in bits.
 
 DEFINE_CLASS_NAME ("cryptical_envelopment")
 
int key_size () const
 
const basis::byte_array & get_key () const
 returns our current key.
 
bool generate_key (int size, basis::byte_array &new_key)
 creates a "new_key" of the "size" (in bits) specified.
 
bool encrypt (const basis::byte_array &source, basis::byte_array &target) const
 encrypts the "source" array into the "target" array.
 
bool decrypt (const basis::byte_array &source, basis::byte_array &target) const
 decrypts the "target" array from the encrypted "source" array.
 
- Public Member Functions inherited from basis::nameable
virtual const char * class_name () const =0
 Returns the bare name of this class as a constant character pointer.
 

Static Public Member Functions

static int static_minimum_key_size_in_bits ()
 
static int static_maximum_key_size_in_bits ()
 
- Static Public Member Functions inherited from crypto::cryptical_envelopment
static const basis::byte_array & init_vector ()
 returns the initialization vector that is used by this class.
 

Detailed Description

Definition at line 24 of file twofish_crypto.h.

Constructor & Destructor Documentation

◆ twofish_crypto() [1/3]

crypto::twofish_crypto::twofish_crypto ( int  key_size)

this will create a new random key of the "key_size", in bits.

the valid sizes are from 128 bits to 256 bits. AES apparently only requires that 128, 192 and 256 actually work, but the intervening key sizes should be fine also.

Definition at line 55 of file twofish_crypto.cpp.

References crypto::cryptical_envelopment::key_size(), and crypto::cryptical_envelopment::set_key().

◆ twofish_crypto() [2/3]

crypto::twofish_crypto::twofish_crypto ( const basis::byte_array &  key,
int  key_size 
)

uses a pre-existing "key".

Definition at line 61 of file twofish_crypto.cpp.

References crypto::cryptical_envelopment::key_size(), and crypto::cryptical_envelopment::set_key().

◆ twofish_crypto() [3/3]

crypto::twofish_crypto::twofish_crypto ( const twofish_crypto &  to_copy)

copy constructor.

Definition at line 67 of file twofish_crypto.cpp.

◆ ~twofish_crypto()

crypto::twofish_crypto::~twofish_crypto ( )
virtual

Definition at line 73 of file twofish_crypto.cpp.

Member Function Documentation

◆ DEFINE_CLASS_NAME()

crypto::twofish_crypto::DEFINE_CLASS_NAME ( "twofish_crypto"  )

◆ maximum_key_size_in_bits()

virtual int crypto::twofish_crypto::maximum_key_size_in_bits ( ) const
inlinevirtual

returns the maximum key size in bits supported here.

Implements crypto::cryptical_envelopment.

Definition at line 46 of file twofish_crypto.h.

References static_maximum_key_size_in_bits().

◆ minimum_key_size_in_bits()

virtual int crypto::twofish_crypto::minimum_key_size_in_bits ( ) const
inlinevirtual

returns the minimum key size in bits supported here.

Implements crypto::cryptical_envelopment.

Definition at line 45 of file twofish_crypto.h.

References static_minimum_key_size_in_bits().

◆ operator=()

twofish_crypto & crypto::twofish_crypto::operator= ( const twofish_crypto &  to_copy)

Definition at line 77 of file twofish_crypto.cpp.

◆ static_maximum_key_size_in_bits()

static int crypto::twofish_crypto::static_maximum_key_size_in_bits ( )
inlinestatic

◆ static_minimum_key_size_in_bits()

static int crypto::twofish_crypto::static_minimum_key_size_in_bits ( )
inlinestatic

Definition at line 47 of file twofish_crypto.h.

Referenced by minimum_key_size_in_bits().


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