28 #ifndef TRONCONNEUSE_HPP 29 #define TRONCONNEUSE_HPP 31 #include "../my_config.h" 115 U_I inherited_read(
char *a, U_I size);
120 void inherited_write(
const char *a, U_I size);
123 void inherited_sync_write() { flush(); };
126 void inherited_terminate() {};
159 const char *clear_buf,
const U_32 clear_size,
const U_32 clear_allocated,
160 char *crypt_buf, U_32 crypt_size) = 0;
171 const char *crypt_buf,
const U_32 crypt_size,
172 char *clear_buf, U_32 clear_size) = 0;
183 U_32 clear_block_size;
188 U_32 encrypted_buf_size;
189 U_32 encrypted_buf_data;
217 void position_clear2crypt(
const infinint & pos,
227 bool check_current_position() {
return fill_buf() < buf_byte_data; };
233 void remove_trailing_clear_data_from_encrypted_buf(
const infinint & crypt_offset);
bool skip_relative(S_I x)
inherited from generic_file
bool skip_to_eof()
inherited from generic_file
infinint get_position()
inherited from generic_file
virtual ~tronconneuse()
destructor
void set_initial_shift(const infinint &x)
this method to modify the initial shift. This overrides the constructor "no_initial_shift" of the con...
void set_callback_trailing_clear_data(infinint(*call_back)(generic_file &below, const archive_version &reading_ver))
this is a partial implementation of the generic_file interface to cypher/decypher data block by block...
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
class generic_file is defined here as well as class fichierthe generic_file interface is widely used ...
const tronconneuse & operator=(const tronconneuse &ref)
assignment operator
bool skip(const infinint &pos)
inherited from generic_file
void write_end_of_file()
in write_only mode indicate that end of file is reached
bool is_terminated() const
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 f...
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
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 decyphers data
tronconneuse(U_32 block_size, generic_file &encrypted_side, bool no_initial_shift, const archive_version &reading_ver)
This is the constructor.
switch module to limitint (32 ou 64 bits integers) or infinint
this is the interface class from which all other data transfer classes inherit
the arbitrary large positive integer class
class archive_version manages the version of the archive format
tronconneuse(const tronconneuse &ref)
copy constructor
libdar namespace encapsulate all libdar symbols