Logo Search packages:      
Sourcecode: dar version File versions

libdar::tronconneuse Class Reference
[Private]

#include <tronconneuse.hpp>

Inheritance diagram for libdar::tronconneuse:

libdar::generic_file libdar::blowfish

List of all members.


Detailed Description

this is a partial implementation of the generic_file interface to encrypt/decrypt data block by block.

This class is a pure virtual one, as several calls have to be defined by inherited classes

tronconneuse is either read_only or write_only, read_write is not allowed. The openning mode his mode is defined by encrupted_side's mode. In write_only no skip() is allowed, writing is sequential from the beginning of the file to the end (like writing to a pipe). In read_only all skip() functions are available.

Definition at line 58 of file tronconneuse.hpp.


Public Member Functions

infinint copy_to (generic_file &ref, infinint size)
 copy the given amount to the object in argument
U_32 copy_to (generic_file &ref, U_32 size)
 small copy (up to 4GB) with CRC calculation
void copy_to (generic_file &ref, crc &value)
 copy all data from the current position to the object in argument and computes a CRC value of the transmitted data
void copy_to (generic_file &ref)
 copy all data from current position to the object in argument
bool diff (generic_file &f)
 compares the contents with the object in argument
void get_crc (crc &val)
 get CRC of the transfered date since last reset
user_interactionget_gf_ui () const
 get the cached user_interaction for inherited classes in particular (this stay a public method, not a protected one)
gf_mode get_mode () const
 retreive the openning mode for this object
infinint get_position ()
 inherited from generic_file
tronconneuseoperator= (const tronconneuse &ref)
 assignment operator
S_I read (char *a, size_t size)
 read data from the generic_file
S_I read_back (char &a)
 skip back one char, read on char and skip back one char
S_I read_forward (char &a)
 read one char
void reset_crc ()
 reset CRC on read or writen data
bool skip (const infinint &pos)
 inherited from generic_file
bool skip_relative (S_I x)
 inherited from generic_file
bool skip_to_eof ()
 inherited from generic_file
 tronconneuse (const tronconneuse &ref)
 copy constructor
 tronconneuse (user_interaction &dialog, U_32 block_size, generic_file &encrypted_side)
 This is the constructor.
S_I write (const std::string &arg)
 write a string to the generic_file
S_I write (char *a, size_t size)
 write data to the generic_file
void write_end_of_file ()
 in write_only mode indicate that end of file is reached
virtual ~tronconneuse ()
 destructor

Protected Member Functions

virtual U_32 clear_block_allocated_size_for (U_32 clear_block_size)=0
 it may be necessary by the inherited class have few more bytes allocated after the clear data given for encryption
virtual U_32 decrypt_data (const infinint &block_num, const char *crypt_buf, const U_32 crypt_size, char *clear_buf, U_32 clear_size)=0
 this method is for decrypts data
virtual U_32 encrypt_data (const infinint &block_num, const char *clear_buf, const U_32 clear_size, const U_32 clear_allocated, char *crypt_buf, U_32 crypt_size)=0
 this method encrypts the clear data given
virtual U_32 encrypted_block_size_for (U_32 clear_block_size)=0
 defines the size necessary to encrypt a given amount of clear data
void set_mode (gf_mode x)

Private Member Functions

bool check_current_position ()
void copy_from (const tronconneuse &ref)
void detruit ()
U_32 fill_buf ()
void flush ()
S_I inherited_read (char *a, size_t size)
 inherited from generic_file
S_I inherited_write (char *a, size_t size)
 inherited from generic_file
void init_buf ()
void position_clear2crypt (const infinint &pos, infinint &file_buf_start, infinint &clear_buf_start, infinint &pos_in_buf, infinint &block_num)
void position_crypt2clear (const infinint &pos, infinint &clear_pos)

Private Attributes

infinint block_num
char * buf
U_32 buf_byte_data
infinint buf_offset
U_32 buf_size
U_32 clear_block_size
infinint current_position
generic_fileencrypted
char * encrypted_buf
U_32 encrypted_buf_size
infinint initial_shift
bool weof

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

Generated by  Doxygen 1.6.0   Back to index